/* SNOMED CT Tree Browser Animations */

/* Tree children animations */
.tree-children {
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.tree-children.expanding {
    animation: slideDown 0.3s ease-out forwards;
}

.tree-children.collapsing {
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
}

/* Tree icon rotation animation */
.tree-icon {
    transition: transform 0.2s ease-in-out;
}

.tree-icon.rotating {
    transform: rotate(90deg);
}

/* Loading spinner styles */
.tree-loading {
    display: inline-flex;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.2s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Smooth hover effects */
.tree-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

/* Tree item appearance animation */
.tree-item {
    opacity: 0;
    animation: fadeInItem 0.2s ease-in forwards;
}

@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced hover container styling */
.hover-container {
    position: relative;
    display: inline-block;
    border-radius: 6px;
    padding: 2px 4px;
    transition: all 0.2s ease-in-out;
    cursor: default;
    
    .content {
        display: inline-block;
        transition: all 0.2s ease-in-out;
    }
    
    .icons {
        display: none;
        position: absolute;
        top: 50%;
        right: -5px;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        padding: 4px;
        gap: 2px;
        opacity: 0;
        transform: translateY(-50%) translateX(10px);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10;
        
        .material-symbols-outlined {
            font-size: 18px;
            padding: 4px;
            border-radius: 4px;
            cursor: pointer;
            color: #6b7280;
            transition: all 0.15s ease-in-out;
            user-select: none;
            position: relative;
            overflow: hidden;
            
            /* Ripple effect */
            &::before {
                content: '';
                position: absolute;
                top: 50%;
                left: 50%;
                width: 0;
                height: 0;
                border-radius: 50%;
                background: rgba(59, 130, 246, 0.3);
                transform: translate(-50%, -50%);
                transition: width 0.3s, height 0.3s;
                pointer-events: none;
            }
            
            &:hover {
                background-color: rgba(59, 130, 246, 0.1);
                color: #3b82f6;
                transform: scale(1.1);
                
                &::before {
                    width: 24px;
                    height: 24px;
                }
            }
            
            &:active {
                transform: scale(0.95);
            }
            
            &:focus {
                outline: 2px solid rgba(59, 130, 246, 0.5);
                outline-offset: 2px;
            }
            
            /* Special animation for successful actions */
            &.success {
                color: #10b981;
                animation: successPulse 0.6s ease-in-out;
            }
        }
    }
}

.hover-container:hover {
    background-color: rgba(59, 130, 246, 0.05);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    
    .content {
        padding-right: 60px;
    }
    
    .icons {
        display: inline-flex !important;
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Success animation for icons */
@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: #10b981;
        background-color: rgba(16, 185, 129, 0.1);
    }
}

/* Enhanced feedback tooltips */
.hover-container .feedback-tooltip {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hover-container .feedback-tooltip.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.hover-container .feedback-tooltip.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .hover-container {
        .icons {
            background: rgba(31, 41, 55, 0.95);
            border-color: rgba(255, 255, 255, 0.1);
            
            .material-symbols-outlined {
                color: #9ca3af;
                
                &:hover {
                    background-color: rgba(59, 130, 246, 0.2);
                    color: #60a5fa;
                }
                
                &:focus {
                    outline-color: rgba(96, 165, 250, 0.5);
                }
            }
        }
    }
    
    .hover-container:hover {
        background-color: rgba(59, 130, 246, 0.1);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    }
}

/* Feedback Dialog Styling */
#feedback-dialog {
    animation: fadeIn 0.3s ease-out;
}

#feedback-dialog .ui-modal-box {
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#feedback-dialog::backdrop {
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header styling */
#feedback-dialog .bg-blue-100 {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

/* Info cards styling */
#feedback-dialog .bg-base-200 {
    background: linear-gradient(135deg, var(--fallback-b2,oklch(var(--b2)/0.8)), var(--fallback-b1,oklch(var(--b1)/0.4)));
    border: 1px solid var(--fallback-b3,oklch(var(--b3)/0.5));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Badge styling */
#feedback-dialog .text-blue-600 { color: #2563eb !important; }
#feedback-dialog .bg-blue-100 { background-color: #dbeafe !important; }
#feedback-dialog .text-green-600 { color: #16a34a !important; }
#feedback-dialog .bg-green-100 { background-color: #dcfce7 !important; }
#feedback-dialog .text-purple-600 { color: #9333ea !important; }
#feedback-dialog .bg-purple-100 { background-color: #f3e8ff !important; }

/* Form styling */
#feedback-dialog .ui-textarea,
#feedback-dialog .ui-input {
    transition: all 0.2s ease-in-out;
    border-width: 2px;
}

#feedback-dialog .ui-textarea:focus,
#feedback-dialog .ui-input:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    transform: translateY(-1px);
}

#feedback-dialog .ui-textarea::placeholder,
#feedback-dialog .ui-input::placeholder {
    color: var(--fallback-bc,oklch(var(--bc)/0.4));
}

/* Button styling */
#feedback-dialog .ui-btn {
    transition: all 0.2s ease-in-out;
    font-weight: 600;
    border-width: 2px;
}

#feedback-dialog .ui-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

#feedback-dialog .ui-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #2563eb;
}

#feedback-dialog .ui-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

#feedback-dialog .ui-btn-outline {
    border-color: var(--fallback-bc,oklch(var(--bc)/0.3));
    color: var(--fallback-bc,oklch(var(--bc)/0.8));
}

#feedback-dialog .ui-btn-outline:hover {
    background: var(--fallback-bc,oklch(var(--bc)/0.05));
    border-color: var(--fallback-bc,oklch(var(--bc)/0.5));
}

/* Content display area */
#feedback-content {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.6;
    word-wrap: break-word;
    background: var(--fallback-b1,oklch(var(--b1)/1));
    border: 2px dashed var(--fallback-bc,oklch(var(--bc)/0.2));
}

/* Material icons styling */
#feedback-dialog .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* Close button */
#feedback-dialog .ui-btn-circle {
    transition: all 0.2s ease-in-out;
}

#feedback-dialog .ui-btn-circle:hover {
    transform: rotate(90deg) scale(1.1);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Required field indicator */
.text-red-500 {
    color: #ef4444 !important;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    #feedback-dialog .ui-modal-box {
        max-width: 95vw;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    #feedback-dialog .grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #feedback-dialog .grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    #feedback-dialog .flex-col.sm\\:flex-row {
        flex-direction: column;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    #feedback-dialog .bg-blue-100 {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
    }
    
    #feedback-dialog .text-blue-600 { color: #60a5fa !important; }
    #feedback-dialog .bg-blue-100 { background-color: rgba(59, 130, 246, 0.1) !important; }
    #feedback-dialog .text-green-600 { color: #4ade80 !important; }
    #feedback-dialog .bg-green-100 { background-color: rgba(34, 197, 94, 0.1) !important; }
    #feedback-dialog .text-purple-600 { color: #a855f7 !important; }
    #feedback-dialog .bg-purple-100 { background-color: rgba(147, 51, 234, 0.1) !important; }
}