/* ==============================================
   ULTRA PROFESSIONAL LANGUAGE SELECTOR
   Modern Glassmorphism Design
   ============================================== */

.language-switcher {
    position: relative;
    z-index: 100;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.lang-current:hover {
    background: rgba(0, 255, 163, 0.1);
    border-color: rgba(0, 255, 163, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 255, 163, 0.15);
}

.lang-current::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.language-switcher.open .lang-current::after {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.lang-options {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 220px;
    background: rgba(14, 14, 16, 0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 255, 163, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateY(-10px);
    animation: dropdownFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.language-switcher.open .lang-options {
    display: flex;
}

.lang-options button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.lang-options button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 163, 0.1), transparent);
    transition: left 0.5s ease;
}

.lang-options button:hover::before {
    left: 100%;
}

.lang-options button:hover {
    background: rgba(0, 255, 163, 0.08);
    color: #fff;
    transform: translateX(4px);
}

.lang-options button.active {
    background: rgba(0, 255, 163, 0.12);
    color: var(--primary, #00ffa3);
    font-weight: 700;
}

.lang-options button.active::after {
    content: '✓';
    margin-left: auto;
    font-size: 1rem;
    color: var(--primary, #00ffa3);
    font-weight: 700;
}

.lang-flag {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.lang-name {
    flex: 1;
    text-align: left;
}

/* Responsive */
@media (max-width: 900px) {
    .language-switcher {
        display: none;
        /* Hidden on mobile, use mobile menu instead */
    }
}

/* Click outside to close */
.lang-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 99;
    display: none;
}

.language-switcher.open~.lang-backdrop {
    display: block;
}