/* Language Switcher V2 - Complete Fix for Overflow Issue */

.lang-switcher {
    position: relative;
    display: inline-block;
    z-index: 200000 !important;
}

/* Button */
.lang-btn {
    background-color: #2563eb;
    color: #ffffff;
    border: 2px solid #2563eb;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 130px;
    justify-content: space-between;
    line-height: 1.2;
    font-family: inherit;
}

.lang-btn:hover {
    background-color: #1d4ed8;
}

.lang-btn .flag-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-btn .arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

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

/* Dropdown - Complete Fix */
.lang-dropdown {
    display: none;
    position: fixed !important;
    top: 65px !important;
    right: 20px !important;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    max-width: 250px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200001 !important;
}

.lang-switcher.open .lang-dropdown {
    display: block;
}

.lang-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
    background: #ffffff;
}

.lang-item:first-child {
    border-radius: 10px 10px 0 0;
}

.lang-item:last-child {
    border-radius: 0 0 10px 10px;
}

.lang-item:hover {
    background: #f3f4f6;
}

.lang-item.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
}

.lang-item .checkmark {
    color: #1d4ed8;
    margin-left: 8px;
}

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

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

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

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

/* Mobile specific */
@media (max-width: 768px) {
    .lang-dropdown {
        min-width: 180px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        right: 10px !important;
    }
}

/* Mobile - Icon Only */
@media (max-width: 560px) {
    .lang-btn {
        min-width: 45px;
        width: 45px;
        height: 45px;
        padding: 0;
        justify-content: center;
        gap: 0;
        font-size: 22px;
    }
    
    .lang-btn .lang-name,
    .lang-btn .arrow {
        display: none;
    }
    
    .lang-dropdown {
        min-width: 180px;
    }
}
