/* Language Switcher Styles */
.language-switcher {
    position: relative;
    margin-right: 1rem;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid rgba(53, 255, 0, 0.3);
    color: #35FF00;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.language-btn::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background: #35FF00;
    color: #000;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 10px;
    min-width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.language-btn:hover {
    background: rgba(53, 255, 0, 0.1);
    border-color: #35FF00;
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(53, 255, 0, 0.3);
    border-radius: 0.5rem;
    min-width: 180px;
    max-width: 200px;
    max-height: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #35FF00 #2a2a2a;
}

/* Custom scrollbar for webkit browsers */
.language-menu::-webkit-scrollbar {
    width: 6px;
}

.language-menu::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 3px;
}

.language-menu::-webkit-scrollbar-thumb {
    background: #35FF00;
    border-radius: 3px;
}

.language-menu::-webkit-scrollbar-thumb:hover {
    background: #28cc00;
}

/* Scroll fade indicators */
.language-menu::before {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, #1a1a1a, transparent);
    z-index: 1;
    pointer-events: none;
}

.language-menu::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to top, #1a1a1a, transparent);
    z-index: 1;
    pointer-events: none;
}

/* Scroll hint for mobile */
@media (max-width: 768px) {
    .language-menu.show::before {
        content: '⇈ Scroll up ⇈';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: rgba(53, 255, 0, 0.6);
        font-size: 0.7rem;
        text-align: center;
        z-index: 10;
        pointer-events: none;
        animation: scrollHint 3s ease-in-out;
    }
}

@keyframes scrollHint {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.language-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.language-option:hover {
    background: rgba(53, 255, 0, 0.1);
    color: #35FF00;
}

.language-option.active {
    background: rgba(53, 255, 0, 0.2);
    color: #35FF00;
}

.language-option .flag {
    font-size: 0.7rem;
    font-weight: bold;
    color: #35FF00;
    background: rgba(53, 255, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 24px;
    text-align: center;
    border: 1px solid rgba(53, 255, 0, 0.3);
}

/* RTL Support - Only for language attribute, not layout */
.rtl {
    /* Language-specific settings handled by JavaScript */
}

/* Keep navbar elements in their original positions */
.rtl .navbar-container,
.rtl .nav-links,
.rtl .auth-buttons {
    direction: ltr;
}

/* Keep navbar text content left-aligned */
.rtl .nav-links a,
.rtl .btn-login,
.rtl .btn-signup {
    direction: ltr;
    text-align: center;
}

/* Mobile Language Switcher */
@media (max-width: 992px) {
    .language-switcher {
        margin-right: 0;
        margin-left: 1rem;
    }
    
    .language-menu {
        right: 0;
        left: auto;
        max-height: 250px;
        min-width: 160px;
        max-width: 180px;
    }
}

@media (max-width: 576px) {
    .language-menu {
        max-height: 200px;
        min-width: 140px;
        max-width: 160px;
        font-size: 0.8rem;
    }
    
    .language-option {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .language-option .flag {
        font-size: 1rem;
    }
}
