/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    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(8px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    margin: 2.5vh auto;
    padding: 0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s ease;
}

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

.modal-header {
    position: relative;
    padding: 20px 30px 0 30px;
    display: flex;
    justify-content: flex-end;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 0 30px 30px 30px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.module-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

.module-detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.3);
    flex-shrink: 0;
}

.module-detail-info h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.module-detail-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.detail-duration,
.detail-level {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.875rem;
    color: #e5e7eb;
    backdrop-filter: blur(10px);
}

.detail-level {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    border: none;
}

.module-detail-description,
.module-detail-lessons,
.module-detail-requirements {
    margin-bottom: 30px;
}

.module-detail-description h3,
.module-detail-lessons h3,
.module-detail-requirements h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-detail-description h3::before {
    content: "📝";
    font-size: 1.2em;
}

.module-detail-lessons h3::before {
    content: "🎯";
    font-size: 1.2em;
}

.module-detail-requirements h3::before {
    content: "⚡";
    font-size: 1.2em;
}

.module-detail-description p {
    color: #d1d5db;
    line-height: 1.6;
    font-size: 1rem;
}

.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-item-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lesson-item-modal:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(96, 165, 250, 0.3);
    transform: translateX(5px);
}

.lesson-number {
    display: inline-block;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 12px;
    min-width: 45px;
    text-align: center;
}

.lesson-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.lesson-description {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.5;
}

.module-detail-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.module-detail-requirements li {
    color: #d1d5db;
    padding: 8px 0;
    position: relative;
    padding-left: 25px;
}

.module-detail-requirements li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #34d399;
    font-weight: 600;
}

.module-detail-cta {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-modal-cta {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-modal-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(96, 165, 250, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5vh auto;
        max-height: 90vh;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 15px 20px 0 20px;
    }
    
    .modal-body {
        padding: 0 20px 20px 20px;
    }
    
    .module-detail-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .module-detail-icon {
        width: 70px;
        height: 70px;
        font-size: 28px;
        align-self: center;
    }
    
    .module-detail-info h2 {
        font-size: 1.5rem;
    }
    
    .module-detail-meta {
        justify-content: center;
    }
    
    .lesson-item-modal {
        padding: 12px 16px;
    }
    
    .lesson-item-modal:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 2vh auto;
        border-radius: 12px;
    }
    
    .module-detail-info h2 {
        font-size: 1.25rem;
    }
    
    .btn-modal-cta {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
    }
}

/* Animation classes */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
}

.modal-content.fade-in {
    animation: modalFadeIn 0.3s ease forwards;
}

.modal-content.fade-out {
    animation: modalFadeOut 0.3s ease forwards;
}