/**
 * Language Switcher Styles
 * Matches DisplayMaster Pro dark theme
 */

.language-switcher {
    position: relative;
    display: inline-block;
}

.lang-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-button:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(96, 165, 250, 0.5);
    color: #93c5fd;
}

.lang-button:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.lang-button.loading {
    opacity: 0.6;
    cursor: wait;
}

.lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.lang-arrow {
    font-size: 0.625rem;
    transition: transform 0.2s ease;
    color: #94a3b8;
}

.lang-button[aria-expanded="true"] .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown::-webkit-scrollbar {
    width: 6px;
}

.lang-dropdown::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.lang-dropdown::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.lang-option:first-child {
    border-radius: 0.75rem 0.75rem 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 0.75rem 0.75rem;
}

.lang-option:hover {
    background: rgba(100, 116, 139, 0.3);
    color: #f1f5f9;
}

.lang-option.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    color: #a5b4fc;
    font-weight: 600;
}

.lang-option.active:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
}

.lang-name {
    flex: 1;
}

.lang-check {
    color: #60a5fa;
    font-size: 0.75rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .lang-button {
        padding: 0.4rem 0.6rem;
        font-size: 0.8125rem;
    }
    
    .lang-code {
        display: none;
    }
    
    .lang-dropdown {
        right: auto;
        left: 0;
        min-width: 180px;
    }
}

/* RTL support */
[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-option {
    text-align: right;
}

/* Animation for language change */
@keyframes langChange {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.lang-changing {
    animation: langChange 0.3s ease;
}
