/* Modern Language Selector Overlay */
.language-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    backdrop-filter: blur(100px) saturate(180%);
    -webkit-backdrop-filter: blur(100px) saturate(180%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.language-selector {
    background: rgba(15, 25, 60, 0.5);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    position: relative;
    overflow: hidden;
}

.language-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(5, 18, 45, 0.2));
    z-index: -1;
}

.language-selector h2 {
    color: #fff;
    margin: 0 0 2rem 0;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Playfair Display', serif;
    position: relative;
    display: inline-block;
}

.language-selector h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #D4AF37, #F7EF8A);
    border-radius: 3px;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 1.2rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: white; /* Set text color to white */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.language-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), rgba(247, 239, 138, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-option:hover {
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    border-color: rgba(212, 175, 55, 0.5);
    color: white; /* Ensure text stays white on hover */
}

.language-option:hover::before {
    opacity: 1;
}

.language-flag {
    width: 28px;
    height: 20px;
    margin-right: 15px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.language-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    flex-grow: 1;
    text-align: left;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
}

.language-english-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
}

.language-native-name {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.language-rtl {
    direction: rtl;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .language-selector {
        padding: 1.8rem 1.5rem;
    }
    
    .language-option {
        padding: 1rem 1.5rem;
    }
    
    .language-selector h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}
