/* Modern Language Dropdown Styles */

.lang-switcher.dropdown {
    position: relative;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 8px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.lang-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-dropdown-btn .lang-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-dropdown-btn .lang-label {
    font-size: 14px;
}

.lang-dropdown-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.lang-dropdown-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.lang-dropdown-menu {
    min-width: 280px;
    max-height: 500px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px;
    margin-top: 8px;
}

.lang-dropdown-menu .dropdown-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lang-dropdown-menu .dropdown-divider {
    margin: 8px 0;
    border-color: rgba(0, 0, 0, 0.08);
}

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

.lang-option:hover {
    background: #f8f9fa;
    color: #533cae;
}

.lang-option.active {
    background: rgba(83, 60, 174, 0.1);
    color: #533cae;
    font-weight: 600;
}

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

.lang-option .bx-check {
    color: #533cae;
    font-size: 20px;
}

/* Language Grid */
.lang-grid-container {
    padding: 8px;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.lang-grid-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 13px;
}

.lang-grid-item:hover {
    background: #f8f9fa;
    color: #533cae;
}

.lang-grid-item.active {
    background: rgba(83, 60, 174, 0.1);
    color: #533cae;
    font-weight: 600;
}

.lang-grid-item .lang-flag-item {
    font-size: 18px;
    line-height: 1;
}

.lang-grid-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading State */
.lang-switcher.loading .lang-dropdown-btn {
    opacity: 0.6;
    pointer-events: none;
}

.lang-switcher.loading .lang-dropdown-btn::after {
    content: '⏳';
    margin-left: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

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

.lang-dropdown-menu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .lang-dropdown-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .lang-dropdown-btn .lang-label {
        display: none;
    }
    
    .lang-dropdown-menu {
        min-width: 260px;
        max-height: 400px;
    }
    
    .lang-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lang-dropdown-btn {
        padding: 6px 10px;
    }
    
    .lang-dropdown-btn .lang-flag {
        font-size: 16px;
    }
    
    .lang-dropdown-menu {
        min-width: 240px;
        max-height: 350px;
    }
}

/* RTL Support */
[dir="rtl"] .lang-dropdown-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-option,
[dir="rtl"] .lang-grid-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .lang-dropdown-menu {
    text-align: right;
}

