/* Language Modal Styles */

.language-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.language-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 1;
    transform: scale(0.8);
    background: linear-gradient(135deg, #1a2332 0%, #2c3e50 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    min-width: 400px;
    max-width: 90vw;
    overflow: hidden;
    transition: all 0.3s ease;
}

.language-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

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

.modal-body {
    padding: 30px;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.language-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(116, 185, 255, 0.1), transparent);
    transition: left 0.6s;
}

.language-option:hover::before {
    left: 100%;
}

.language-option:hover {
    background: rgba(116, 185, 255, 0.1);
    border-color: rgba(116, 185, 255, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.2);
}

.language-option.active {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    border-color: #74b9ff;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.3);
}

.language-option .flag {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.language-option .language-name {
    font-weight: 600;
}

/* RTL Support */
[dir="rtl"] .modal-header {
    direction: rtl;
}

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

[dir="rtl"] .modal-content {
    direction: rtl;
}

/* Language-specific body styles */
.lang-fa {
    font-family: 'A-Iranian-Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lang-fa h1, .lang-fa h2, .lang-fa h3, .lang-fa h4, .lang-fa h5, .lang-fa h6 {
    font-family: 'A-Iranian-Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: normal;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        min-width: 350px;
        margin: 20px;
    }
    
    .modal-header {
        padding: 20px 25px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .language-option {
        padding: 18px 20px;
        font-size: 1rem;
    }
    
    .language-option .flag {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        min-width: 300px;
        margin: 15px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .language-option {
        padding: 15px 18px;
        gap: 12px;
    }
}

/* Animation for language switching */
.language-switching {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.language-switched {
    animation: fadeInUp 0.5s ease;
}

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