/* ============================================
   LANGUAGE SWITCHER STYLES (Modern Glassmorphism Design)
   ============================================ */
.language-switcher {
    position: relative;
    display: inline-block;
    width: auto;
    min-width: 120px;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.lang-switch-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    width: 100%;

    /* Modern Glass Effect */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;

    /* Typography */
    color: #f8fafc;
    /* Slate 50 - High contrast */
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;

    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.lang-switch-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.lang-switch-btn:active:not(:disabled) {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.08);
}

.lang-switch-btn i.fa-globe {
    color: #818cf8;
    /* Indigo 400 - Accent color */
    font-size: 1.1rem;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

.lang-switch-btn .chevron-icon {
    color: #94a3b8;
    /* Slate 400 */
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.lang-switch-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
    /* Primary Accent Border */
}

.lang-switch-btn[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
    color: #ffffff;
}

/* ============================================
   DROPDOWN STYLES
   ============================================ */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-start: 0;
    inset-inline-end: auto;

    /* Deep Glass Background */
    background: rgba(15, 23, 42, 0.95);
    /* Slate 900 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;

    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.5),
        0 10px 10px -5px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Highlight ring */

    min-width: 160px;
    width: 100%;
    z-index: 1000;
    overflow: hidden;
    padding: 6px;

    /* Animation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    transform: translateY(-8px) scale(0.95);
    opacity: 0;
    visibility: hidden;
}

/* RTL positioning */
[dir="rtl"] .lang-dropdown,
html[dir="rtl"] .lang-dropdown {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

[dir="ltr"] .lang-dropdown,
html[dir="ltr"] .lang-dropdown {
    inset-inline-start: 0;
    inset-inline-end: auto;
}

/* Open State */
.lang-dropdown[style*="display: block"] {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* ============================================
   OPTION STYLES
   ============================================ */
.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;

    /* Text */
    color: #cbd5e1;
    /* Slate 300 */
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: start;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding-inline-start: 16px;
    /* Smooth slide effect */
}

.lang-option.active {
    background: rgba(99, 102, 241, 0.15);
    /* Indigo tint */
    color: #818cf8;
    /* Indigo 400 */
    font-weight: 700;
}

.lang-option i.fa-check {
    color: #10b981;
    /* Emerald 500 */
    font-size: 0.9rem;
    margin-inline-start: auto;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.4));
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .language-switcher {
        width: 100%;
    }

    .lang-switch-btn {
        justify-content: center;
    }

    .lang-dropdown {
        width: 100%;
        min-width: 100%;
    }
}