/* Language Selector Styles */

.language-selector {
    position: fixed;
    top: 80px;
    /* Moved down to avoid overlapping with navigation */
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.lang-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-btn:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.lang-btn .lang-name {
    color: #1e293b;
}

.lang-btn .arrow {
    color: #64748b;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.lang-dropdown.active .arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-height: 450px;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.lang-dropdown.active {
    display: flex;
}

.lang-search {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-bottom: 2px solid #f1f5f9;
    font-size: 14px;
    outline: none;
}

.lang-search:focus {
    border-bottom-color: #3b82f6;
}

.lang-search::placeholder {
    color: #94a3b8;
}

.lang-list {
    overflow-y: auto;
    max-height: 380px;
}

.lang-list::-webkit-scrollbar {
    width: 8px;
}

.lang-list::-webkit-scrollbar-track {
    background: #f8fafc;
}

.lang-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

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

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

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

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

.lang-option .name {
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .language-selector {
        top: 10px;
        right: 10px;
    }

    .lang-btn {
        padding: 8px 12px;
    }

    .lang-btn .lang-name {
        display: none;
    }

    .lang-dropdown {
        min-width: 240px;
        right: -10px;
    }
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-dropdown.active {
    animation: slideDown 0.2s ease;
}

/* RTL Support for Arabic */
html[lang="ar"] .language-selector {
    left: 20px;
    right: auto;
}

html[lang="ar"] .lang-dropdown {
    left: 0;
    right: auto;
}

html[lang="ar"] .lang-btn,
html[lang="ar"] .lang-option {
    flex-direction: row-reverse;
}