/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background-color: var(--section-bg-color);
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 15px var(--box-shadow-color);
    border-radius: 8px;
    animation: modalFadeIn 0.3s;
}

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

.modal-header {
    padding: 20px 25px;
    background-color: var(--header-background-color);
    color: var(--text-color);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    color: var(--header-color);
    font-size: 1.8em;
    flex-grow: 1;
}

.modal-instructor {
    display: flex;
    align-items: center;
    margin-right: 40px;
}

.modal-instructor .avatar-container {
    margin-right: 10px;
}

.modal-instructor .section-avatar {
    width: 50px;
    height: 50px;
}

.modal-instructor span {
    font-weight: bold;
    color: var(--header-color);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--text-color);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--header-color);
}

.modal-body {
    padding: 25px;
}

.modal-schedule {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.schedule-item {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.modal-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    fill: var(--header-color);
}

.modal-description, .modal-topics, .modal-prerequisites, .modal-materials {
    margin-bottom: 25px;
}

.modal-description h3, .modal-topics h3, .modal-prerequisites h3, .modal-materials h3 {
    color: var(--header-color);
    margin-top: 0;
    margin-bottom: 15px;
}

.modal-footer {
    padding: 20px 25px;
    background-color: var(--header-background-color);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-price {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--header-color);
}

.modal-cta {
    display: flex;
    gap: 15px;
}

/* Level-specific styling */
.modal-header.beginner {
    border-top: 4px solid #4CAF50;
}

.modal-header.intermediate {
    border-top: 4px solid #2196F3;
}

.modal-header.advanced {
    border-top: 4px solid #9C27B0;
}

.modal-header.premium {
    border-top: 4px solid #F44336;
}

.modal-header.special {
    border-top: 4px solid #FF9800;
}

/* Dark mode specific adjustments */
.dark-mode .modal-content {
    border: 1px solid #333;
}

.dark-mode .modal-schedule {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Responsive Design for Modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-instructor {
        margin-top: 15px;
        margin-right: 0;
    }
    
    .close {
        top: 10px;
        right: 15px;
    }
    
    .modal-schedule {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-price {
        margin-bottom: 15px;
    }
    
    .modal-cta {
        width: 100%;
        flex-direction: column;
    }
    
    .modal-cta a {
        width: 100%;
        text-align: center;
    }
}
