/* Enhanced Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
}

.modal-close:hover,
.modal-close:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
    text-decoration: none;
    cursor: pointer;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    display: block;
    max-width: 80%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    object-fit: contain;
}

/* Animation when the modal opens */
.modal.show .modal-content {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Caption text */
#imageCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 40px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal.show #imageCaption {
    opacity: 1;
}

/* Add Animation */
@keyframes zoom {
    from {transform: translate(-50%, -50%) scale(0.8); opacity: 0;}
    to {transform: translate(-50%, -50%) scale(1); opacity: 1;}
}

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

/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px){
    .modal-content {
        max-width: 90%;
    }
    
    .modal-close {
        top: 15px;
        right: 25px;
        font-size: 35px;
        width: 40px;
        height: 40px;
    }
}

/* Course Modal Styles */
.course-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

.course-modal-dialog {
    position: relative;
    margin: 2rem auto;
    max-width: 900px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.course-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #666;
    font-size: 28px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2001;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.course-modal-close:hover {
    background-color: #f44336;
    color: white;
    transform: rotate(90deg);
}

.course-modal-content {
    padding: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.course-modal-header {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #236bcf 0%, #f08cf5 100%);
    color: white;
    position: relative;
}

.course-modal-image {
    position: relative;
    flex-shrink: 0;
}

.course-modal-image img {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.course-level-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(255, 255, 255, 0.9);
    color: #236bcf;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.course-modal-info {
    flex: 1;
}

.course-modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.course-modal-meta {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.course-price {
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.course-duration {
    font-size: 1rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.course-duration::before {
    content: "⏱️";
}

.course-modal-body {
    padding: 2rem;
}

.course-description {
    margin-bottom: 2rem;
    line-height: 1.7;
    color: #333;
}

.course-description h3 {
    color: #236bcf;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.course-description h4 {
    color: #444;
    margin-top: 1.2rem;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.course-description ul {
    margin: 0.5rem 0 1rem 1rem;
}

.course-description li {
    margin-bottom: 0.5rem;
    color: #555;
}

.course-features,
.course-benefits {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.course-features h4,
.course-benefits h4 {
    color: #236bcf;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.course-features h4::before {
    content: "🎯";
}

.course-benefits h4::before {
    content: "✨";
}

.course-features ul,
.course-benefits ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.course-features li,
.course-benefits li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    padding-left: 1.5rem;
    color: #555;
}

.course-features li:last-child,
.course-benefits li:last-child {
    border-bottom: none;
}

.course-features li::before,
.course-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.course-modal-footer {
    display: flex;
    gap: 1rem;
    padding: 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.enroll-btn,
.contact-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.enroll-btn {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.enroll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.contact-btn {
    background: linear-gradient(135deg, #236bcf 0%, #1a5bb8 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(35, 107, 207, 0.3);
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 107, 207, 0.4);
}

/* Mobile responsiveness for course modal */
@media (max-width: 768px) {
    .course-modal-dialog {
        margin: 1rem;
        max-width: none;
    }
    
    .course-modal-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .course-modal-image {
        align-self: center;
    }
    
    .course-modal-title {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .course-modal-meta {
        justify-content: center;
        gap: 1rem;
    }
    
    .course-modal-body {
        padding: 1.5rem;
    }
    
    .course-modal-footer {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .course-modal-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
        width: 35px;
        height: 35px;
    }
}
