/* Ensure nav-wrapper has enough space for lang-switcher */
.nav-wrapper {
    padding: 0 40px !important;
    overflow: visible !important;
}

/* Language Switcher Styles */
/* Ensure lang-switcher is visible */
.lang-switcher {
    position: relative;
    z-index: 1001;
    margin-left: 24px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #111;
    border-radius: 24px;
    color: #111;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.lang-btn:hover {
    background: #111;
    color: #fff;
}

.lang-btn i.fa-globe {
    font-size: 14px;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-current img {
    flex-shrink: 0;
}

.lang-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.lang-switcher:hover .lang-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1002;
    padding: 8px;
}

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

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

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

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

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

/* Language Option */
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #111;
}

.lang-option:hover {
    background: #f5f5f7;
}

.lang-option.active {
    background: #f0f0f2;
    font-weight: 500;
}

.lang-flag {
    font-size: 20px;
    line-height: 1;
}

.lang-name {
    font-size: 14px;
    white-space: nowrap;
}

/* Scrolled state - dark text */
.navbar.scrolled .lang-btn {
    border-color: rgba(0, 0, 0, 0.2);
    color: #111;
}

.navbar.scrolled .lang-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.4);
}

/* Mobile styles */
@media (max-width: 992px) {
    .lang-switcher {
        position: static;
        margin: 0;
    }

    .lang-btn {
        background: transparent;
        border-color: rgba(0, 0, 0, 0.3);
        color: #111;
        padding: 6px 12px;
        font-size: 12px;
    }

    .lang-dropdown {
        position: fixed;
        top: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-10px);
        width: 250px;
        max-height: 60vh;
    }

    .lang-dropdown.active {
        transform: translateX(-50%) translateY(0);
    }

    .navbar:not(.scrolled) .lang-btn {
        border-color: rgba(255, 255, 255, 0.6);
        color: #fff;
    }
}

@media (max-width: 768px) {
    .lang-switcher {
        position: static;
        margin: 20px 0;
    }

    .lang-btn {
        background: rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 0, 0, 0.2);
        color: #111;
    }

    .lang-dropdown {
        position: fixed;
        top: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(-10px);
        width: 250px;
        max-height: 60vh;
    }

    .lang-dropdown.active {
        transform: translateX(-50%) translateY(0);
    }

    /* When nav menu is active (mobile menu open) */
    .nav-menu.active ~ .lang-switcher .lang-btn {
        color: #111;
    }
}

/* Dark background state (for pages with dark hero) */
.navbar:not(.scrolled) .lang-btn {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.navbar:not(.scrolled) .lang-btn:hover {
    background: #fff;
    color: #111;
    border-color: #fff;
}

.navbar:not(.scrolled) .lang-arrow {
    color: #fff;
}

/* Animation for dropdown items */
.lang-option {
    animation: fadeIn 0.2s ease forwards;
}

.lang-option:nth-child(1) { animation-delay: 0.02s; }
.lang-option:nth-child(2) { animation-delay: 0.04s; }
.lang-option:nth-child(3) { animation-delay: 0.06s; }
.lang-option:nth-child(4) { animation-delay: 0.08s; }
.lang-option:nth-child(5) { animation-delay: 0.1s; }
.lang-option:nth-child(6) { animation-delay: 0.12s; }
.lang-option:nth-child(7) { animation-delay: 0.14s; }

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