/* Language Selector Styles */
.language-selector {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'GalanoGrotesqueAlt-Regular', Arial, sans-serif;
}

.language-selector-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    border: 2px solid #ff0000; /* red border around detector */
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    transition: all 0.3s ease;
    min-width: 160px;
}

.language-selector-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
}

.language-selector-toggle:active {
    transform: translateY(0);
}

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

.lang-name {
    flex: 1;
    text-align: left;
}

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

.language-selector-toggle:hover .lang-arrow {
    transform: translateY(2px);
}

.language-selector-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    /* Allow scrolling when there are many languages */
    max-height: 480px; /* ~50% higher than before */
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    min-width: 200px;
}

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

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s ease;
    text-align: left;
}

.language-option:hover {
    background: #f5f5f5;
}

.language-option:active {
    background: #e0e0e0;
}

.language-option .lang-name {
    color: #333;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .language-selector {
        /* Place at bottom on mobile so it doesn't cover Login/Register */
        bottom: 20px;
        top: auto;
        right: 20px;
    }
    
    .language-selector-toggle {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 140px;
    }
    
    .lang-flag {
        font-size: 20px;
    }
    
    .language-selector-dropdown {
        min-width: 180px;
        max-height: 60vh; /* keep within viewport height on mobile */
        /* Use desktop positioning (above the toggle) */
        top: auto;
        bottom: 100%;
        margin-top: 0;
        margin-bottom: 10px;
    }
    
    .language-option {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .language-selector {
        bottom: 15px;
        top: auto;
        right: 15px;
    }
    
    .language-selector-toggle {
        padding: 8px 14px;
        font-size: 13px;
        min-width: 120px;
    }
    
    .lang-flag {
        font-size: 18px;
    }
    
    .lang-name {
        font-size: 13px;
    }
    
    .language-selector-dropdown {
        min-width: 160px;
    }
}

/* RTL Support for Urdu */
html[dir="rtl"] .language-selector {
    left: 30px;
    right: auto;
}

html[dir="rtl"] .language-selector-dropdown {
    left: 0;
    right: auto;
}

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

html[dir="rtl"] .language-option {
    text-align: right;
}

@media (max-width: 768px) {
    html[dir="rtl"] .language-selector {
        bottom: 20px;
        top: auto;
        left: 20px;
        right: auto;
    }
}

@media (max-width: 480px) {
    html[dir="rtl"] .language-selector {
        bottom: 15px;
        top: auto;
        left: 15px;
        right: auto;
    }
}

/* Animation for language change */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-selector {
    animation: fadeIn 0.5s ease;
}

/* Ensure language selector stays on top */
.language-selector {
    z-index: 99999 !important;
}

