/* Conditional UI Styles */

/* Header controls layout */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Action buttons container */
.header-controls .actions {
    gap: 8px;
    align-items: center;
    animation: slideInFromRight 0.3s ease-out;
}

#file-actions {
    display: none !important; /* Hidden by default, override inline styles */
}

#file-actions.show {
    display: flex !important;
}

/* Language switcher in main header */
#language-switcher {
    background: var(--light-gradient);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

#language-switcher:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

#language-switcher.active {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
}

/* Conditional button states */
.actions .btn {
    transition: all 0.2s ease;
    opacity: 1;
}

.actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.actions .btn:not(:disabled):hover {
    transform: translateY(-2px);
}

/* File-specific button styling */
.actions .btn#save-btn:not(:disabled) {
    background: var(--green-gradient);
    border-color: #27ae60;
}

.actions .btn#copy-btn:not(:disabled) {
    background: var(--secondary-gradient);
    border-color: var(--secondary-color);
}

.actions .btn#delete-btn:not(:disabled) {
    background: var(--red-gradient);
    border-color: #c0392b;
}

/* Animation for showing/hiding buttons */
@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutToRight {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* Context indicator */
.content-header h2 {
    position: relative;
    transition: color 0.3s ease;
}

.content-header h2.file-selected {
    color: var(--primary-color);
}

.content-header h2.file-selected::after {
    content: "📄";
    margin-left: 8px;
    font-size: 0.8em;
    animation: pulse 2s ease-in-out infinite;
}

.content-header h2.folder-selected::after {
    content: "📁";
    margin-left: 8px;
    font-size: 0.8em;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Selection feedback */
.tree-item.selected {
    background: linear-gradient(135deg, rgba(79, 108, 247, 0.1) 0%, rgba(59, 95, 226, 0.05) 100%);
    border-left: 3px solid var(--primary-color);
    padding-left: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-controls {
        gap: 10px;
    }
    
    .header-controls .actions {
        gap: 5px;
    }
    
    .header-controls .actions .btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    #language-switcher {
        min-width: 40px;
        padding: 6px 8px;
    }
}

/* Improved content header styling */
.content-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: visible;
}

.content-header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.3;
}

/* Language switcher dropdown positioning in new location */
#language-switcher .language-dropdown {
    right: 0;
    top: calc(100% + 5px);
    min-width: 140px;
}