/* Language Switcher Styles */

.language-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    margin-right: 12px;
    z-index: 1000;
}

/* Ensure it appears in the header properly */
.language-switcher-injected {
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
    flex-shrink: 0;
}

.language-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: currentColor;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 38px;
    min-width: 150px;
}

.language-trigger:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .language-trigger {
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .language-trigger:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.25);
    }
}

.language-trigger .flag-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

#currentLanguageName {
    font-weight: 500;
    color: inherit;
    flex-grow: 1;
}

.language-trigger .chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
    flex-shrink: 0;
    opacity: 0.6;
}

.language-trigger.active .chevron {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: none;
    z-index: 10000;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-dropdown.active {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #374151;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.language-option.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 500;
}

.language-option .flag-icon {
    font-size: 20px;
    line-height: 1;
}

.language-option .language-name {
    flex: 1;
    font-size: 14px;
}

.language-option .checkmark {
    width: 16px;
    height: 16px;
    color: #3b82f6;
    opacity: 0;
}

.language-option.active .checkmark {
    opacity: 1;
}

/* Dark mode support */
.dark .language-trigger {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .language-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.dark .language-dropdown {
    background: #1f2937;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .language-option {
    border-color: rgba(255, 255, 255, 0.05);
    color: #f9fafb;
}

.dark .language-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dark .language-option.active {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .language-switcher {
        margin-right: 8px !important;
    }
    
    .language-dropdown {
        right: auto;
        left: 0;
    }
    
    .language-trigger {
        padding: 6px 10px;
        font-size: 12px;
    }
}
