/* ============================================
   LANGUAGE-SWITCHER.CSS - Language Switcher Styles (Apple Style)
   ============================================ */

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

/* Fixed language switcher in top-right corner */
.language-switcher-fixed {
    position: fixed;
    top: 6px; /* Center in navbar: (44px - 32px) / 2 = 6px */
    right: 1rem;
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    height: 32px;
}

.language-switcher-button {
    background: transparent !important;
    border: none;
    cursor: pointer;
    padding: 0 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #1d1d1f;
    font-weight: 400;
    letter-spacing: -0.011em;
    opacity: 0.88;
    transition: opacity 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    border-radius: 0;
    height: 32px; /* Match menu-toggle height */
    line-height: 1;
    box-sizing: border-box;
}

.language-switcher-button:hover {
    opacity: 1;
    background: transparent !important;
}

.language-switcher-button:active,
.language-switcher-button:focus {
    background: transparent !important;
    outline: none;
}

.language-switcher-button svg {
    width: 10px;
    height: 6px;
    opacity: 0.6;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.language-switcher.open .language-switcher-button svg {
    transform: rotate(180deg);
}

.language-switcher.open .language-switcher-button {
    background: transparent !important;
}

.language-switcher-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    min-width: 160px;
    background: rgba(251, 251, 253, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10001;
    overflow: hidden;
    pointer-events: none;
}

.language-switcher.open .language-switcher-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.language-switcher-list {
    list-style: none;
    padding: 0.25rem;
    margin: 0;
}

.language-switcher-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.4;
}

.language-switcher-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: #1d1d1f;
}

.language-switcher-item.active {
    background-color: rgba(0, 0, 0, 0.06);
    color: #1d1d1f;
    font-weight: 500;
}

.language-switcher-item-flag {
    font-size: 1.125rem;
    line-height: 1;
}

@media (max-width: 768px) {
    .language-switcher-fixed {
        top: 6px; /* Center in navbar: (44px - 32px) / 2 = 6px */
        right: 4rem; /* Moved left to avoid overlapping with menu toggle */
        z-index: 1000; /* Below menu toggle */
        display: inline-flex;
        align-items: center;
        height: 32px;
    }
    
    .language-switcher-fixed .language-switcher-dropdown {
        right: auto;
        left: 0; /* Align dropdown to the left edge of the button */
        min-width: 140px;
        z-index: 10001; /* Above overlay but below menu */
    }

    .language-switcher-button {
        padding: 0 0.5rem;
        font-size: 0.7rem;
        min-width: 44px; /* Touch-friendly size */
        height: 32px; /* Match menu-toggle height */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        box-sizing: border-box;
        background: transparent !important;
    }
}

@media (max-width: 480px) {
    .language-switcher-fixed {
        top: 6px; /* Center in navbar: (44px - 32px) / 2 = 6px */
        right: 3.5rem;
        display: inline-flex;
        align-items: center;
        height: 32px;
    }

    .language-switcher-button {
        padding: 0 0.4rem;
        font-size: 0.65rem;
        height: 32px; /* Match menu-toggle height */
        line-height: 1;
        box-sizing: border-box;
        background: transparent !important;
    }

    .language-switcher-fixed .language-switcher-dropdown {
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .language-switcher-dropdown {
        min-width: 120px;
    }

    .language-switcher-item {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }

    .language-switcher-item-flag {
        font-size: 1rem;
    }
}



