/* Team Modal Styles - Simple Version */
.team-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.team-modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    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;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10001;
}

/* إخفاء شريط التمرير */
.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.team-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(30, 60, 114, 0.1);
    border-radius: 50%;
    color: #1e3c72;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(30, 60, 114, 0.2);
    transform: rotate(90deg);
}

.modal-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 30px 30px 15px;
    border-bottom: 1px solid rgba(30, 60, 114, 0.1);
}

.modal-image-container {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 280px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    transition: transform 0.3s ease;
}

/* Ultimate override rule - Maximum specificity */
body .team-modal .modal-content .modal-header .modal-image-container .modal-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    filter: none !important;
    transform: none !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Additional override for any possible conflicts */
.modal-image#modalImage {
    object-fit: contain !important;
    filter: none !important;
}

.modal-image:hover {
    transform: scale(1.05);
}

.modal-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e3c72;
    margin-bottom: 8px;
    font-family: 'Tajawal', sans-serif;
}

.modal-role {
    font-size: 0.95rem;
    color: #64b5f6;
    margin-bottom: 10px;
    font-weight: 500;
}

.modal-body {
    padding: 20px 30px;
}

.modal-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 15px;
    position: relative;
    padding-right: 20px;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #1e3c72, #64b5f6);
    border-radius: 2px;
}

.modal-bio {
    line-height: 1.8;
    color: #666666;
    font-size: 1rem;
    text-align: justify;
}

.modal-footer {
    display: flex;
    justify-content: center;
    padding: 20px 40px 40px;
}

.close-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(30, 60, 114, 0.1);
    color: #1e3c72;
}

.close-btn:hover {
    background: rgba(30, 60, 114, 0.2);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
        padding: 30px 20px 20px;
    }
    
    .modal-image-container {
        display: block;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        overflow: hidden;
        margin: 0 auto 20px auto;
        border: 3px solid #1e3c72;
        box-shadow: 0 4px 15px rgba(30, 60, 114, 0.2);
    }

    .modal-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .modal-name {
        font-size: 1.3rem;
    }
    
    .modal-role {
        font-size: 0.85rem;
    }
    
    .modal-body {
        padding: 15px 20px;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 12px;
        padding-right: 15px;
    }
    
    .section-title::before {
        width: 3px;
        height: 16px;
    }
    
    .modal-bio {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .modal-section {
        margin-bottom: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
        padding: 20px;
    }
    
    .close-btn {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px 25px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 20px 15px 15px;
    }
    
    .modal-image-container {
        width: 100px;
        height: 100px;
    }
    
    .modal-name {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }
    
    .modal-role {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
    
    .modal-body {
        padding: 12px 15px;
    }
    
    .section-title {
        font-size: 0.9rem;
        margin-bottom: 10px;
        padding-right: 12px;
    }
    
    .section-title::before {
        width: 2px;
        height: 14px;
    }
    
    .modal-bio {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .modal-section {
        margin-bottom: 15px;
    }
    
    .modal-footer {
        padding: 15px;
    }
    
    .close-btn {
        font-size: 0.85rem;
        padding: 8px 20px;
    }
}

/* Animation Classes */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-section {
    animation: slideInUp 0.5s ease forwards;
}
