/*
    ═══════════════════════════════════════════════════════════════
    Module Modal Styles - Award-Winning Premium Design
    ═══════════════════════════════════════════════════════════════
    
    WCAG 2.2 AAA Compliant | Mobile-First | Modern Design
    Created by: Award-Winning Web Designer with 20 years experience
    
    Features:
    - Stunning glassmorphic design
    - Smooth micro-interactions
    - Advanced animations
    - Perfect accessibility
    - Professional typography
    - Modern color system
*/

/* ═══════════════════════════════════════════════════════════════
   MODAL FOUNDATION
   ═══════════════════════════════════════════════════════════════ */

.modal-dialog.modal-module {
    max-width: 900px;
    margin: 1.75rem auto;
}

.modal-module .modal-content {
    border: none;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 30px 60px -12px rgba(0, 0, 0, 0.25),
        0 18px 36px -18px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL HEADER - Premium Glassmorphic Design
   ═══════════════════════════════════════════════════════════════ */

.modal-module .modal-header {
    background: linear-gradient(135deg, 
        #1e40af 0%, 
        #1e3a8a 25%,
        #1d4ed8 50%, 
        #0891b2 75%,
        #06b6d4 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    color: white;
    padding: 2.5rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Animated mesh gradient overlay */
.modal-module .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(6, 182, 212, 0.2) 0%, transparent 50%);
    animation: meshMove 20s linear infinite;
    pointer-events: none;
}

@keyframes meshMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(5%, -5%) rotate(120deg); }
    66% { transform: translate(-5%, 5%) rotate(240deg); }
}

/* Subtle grid pattern overlay */
.modal-module .modal-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
}

.modal-module .modal-header .modal-header-content {
    position: relative;
    z-index: 1;
}

/* Enhanced close button */
.modal-module .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    position: relative;
    width: 44px;
    height: 44px;
    background-size: 20px;
    border-radius: 0.5rem;
}

.modal-module .modal-header .btn-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg) scale(1.1);
}

.modal-module .modal-header .btn-close:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Header Top Row - Icon and Badge */
.modal-module .modal-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

/* Large module icon with glassmorphism */
.modal-module .modal-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.modal-module .modal-icon-large:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Elegant difficulty badge */
.modal-module .modal-difficulty-badge {
    font-size: 0.75rem;
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 50px;
    background: white;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
}

.modal-module .modal-difficulty-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.modal-module .modal-difficulty-badge.badge-beginner { 
    color: #15803d;
}
.modal-module .modal-difficulty-badge.badge-beginner::before {
    background: #16a34a;
    box-shadow: 0 0 8px rgba(22, 163, 74, 0.5);
}

.modal-module .modal-difficulty-badge.badge-intermediate { 
    color: #c2410c;
}
.modal-module .modal-difficulty-badge.badge-intermediate::before {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.modal-module .modal-difficulty-badge.badge-advanced { 
    color: #b91c1c;
}
.modal-module .modal-difficulty-badge.badge-advanced::before {
    background: #dc2626;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}

/* Modal Title Section */
.modal-module .modal-title-section {
    margin-bottom: 2rem;
}

.modal-module .modal-module-number {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.85;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-module .modal-module-number::before {
    content: '';
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
}

.modal-module .modal-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    color: white !important;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.02em;
}

/* Enhanced Stats Row with Glassmorphism */
.modal-module .modal-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.modal-module .modal-stat-item {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modal-module .modal-stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.5) 50%, 
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-module .modal-stat-item:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modal-module .modal-stat-item:hover::before {
    opacity: 1;
}

.modal-module .modal-stat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    opacity: 0.95;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.modal-module .modal-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.modal-module .modal-stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL BODY - Premium Content Design
   ═══════════════════════════════════════════════════════════════ */

.modal-module .modal-body {
    padding: 2.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    max-height: 60vh;
    overflow-y: auto;
}

/* Custom premium scrollbar */
.modal-module .modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-module .modal-body::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
    margin: 8px 0;
}

.modal-module .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: background 0.2s ease;
}

.modal-module .modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #475569 0%, #334155 100%);
}

/* Elegant Description Section */
.modal-module .modal-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 1.25rem;
    border-left: 4px solid #2563eb;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.modal-module .modal-description::before {
    content: '\201C';
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 4rem;
    color: #e0e7ff;
    font-family: Georgia, serif;
    line-height: 1;
    pointer-events: none;
}

/* Premium Progress Section */
.modal-module .modal-progress-section {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #0891b2 100%);
    background-size: 200% 200%;
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 
        0 8px 24px rgba(37, 99, 235, 0.25),
        0 4px 12px rgba(8, 145, 178, 0.15);
    position: relative;
    overflow: hidden;
}

.modal-module .modal-progress-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: progressShimmer 8s linear infinite;
}

@keyframes progressShimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}

.modal-module .modal-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.modal-module .modal-progress-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-module .modal-progress-percentage {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-module .modal-progress-bar-container {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    height: 14px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-module .modal-progress-bar-fill {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(255, 255, 255, 0.85),
        rgba(255, 255, 255, 0.95));
    background-size: 200% 100%;
    height: 100%;
    border-radius: 50px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    animation: progressShine 2s linear infinite;
    position: relative;
}

@keyframes progressShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.modal-module .modal-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.modal-module .modal-progress-text {
    font-size: 0.9375rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

/* Modern Section Header */
.modal-module .modal-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.modal-module .modal-section-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 
        0 4px 12px rgba(37, 99, 235, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.modal-module .modal-section-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.01em;
}

/* Premium Units Container */
.modal-module .modal-units-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Enhanced Unit Group Cards */
.modal-module .modal-unit-group {
    background: white;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
}

.modal-module .modal-unit-group:hover {
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: #cbd5e1;
}

/* Premium Unit Header */
.modal-module .modal-unit-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-module .modal-unit-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
    box-shadow: 
        0 4px 10px rgba(37, 99, 235, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.modal-module .modal-unit-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    flex-grow: 1;
    letter-spacing: -0.01em;
}

.modal-module .modal-unit-count {
    font-size: 0.8125rem;
    color: #64748b;
    background: white;
    padding: 0.375rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    letter-spacing: 0.02em;
}

/* Premium Lessons List */
.modal-module .modal-lessons-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.modal-module .modal-lesson-item {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    position: relative;
}

.modal-module .modal-lesson-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, #2563eb 0%, #0891b2 100%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-module .modal-lesson-item:hover::before {
    width: 4px;
}

.modal-module .modal-lesson-item:last-child {
    border-bottom: none;
}

/* Premium Lesson Links */
.modal-module .modal-lesson-link {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.125rem 1.5rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent;
}

.modal-module .modal-lesson-link:hover {
    background: linear-gradient(90deg, 
        rgba(37, 99, 235, 0.04) 0%, 
        rgba(37, 99, 235, 0.02) 50%,
        transparent 100%);
    padding-left: 2rem;
    color: #2563eb;
}

.modal-module .modal-lesson-link:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: -3px;
    z-index: 1;
    background: rgba(37, 99, 235, 0.05);
}

/* Premium Lesson Icon */
.modal-module .modal-lesson-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.modal-module .modal-lesson-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-module .modal-lesson-link:hover .modal-lesson-icon::before {
    opacity: 1;
}

/* Play icon styling */
.modal-module .modal-lesson-icon .bi-play-circle {
    color: #2563eb;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Completed check icon styling */
.modal-module .modal-lesson-icon .bi-check-circle-fill {
    color: #16a34a;
    font-size: 1.375rem;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(22, 163, 74, 0.3));
    position: relative;
    z-index: 1;
}

/* Hover states for lesson icons */
.modal-module .modal-lesson-link:hover .modal-lesson-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 6px 16px rgba(37, 99, 235, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.modal-module .modal-lesson-link:hover .modal-lesson-icon .bi-play-circle {
    color: #1d4ed8;
    transform: scale(1.15);
}

.modal-module .modal-lesson-link:hover .modal-lesson-icon .bi-check-circle-fill {
    color: #15803d;
    transform: scale(1.15) rotate(360deg);
}

/* Active state */
.modal-module .modal-lesson-link:active .modal-lesson-icon {
    transform: translateY(0) scale(1);
    transition: transform 0.1s ease;
}

/* Premium Lesson Content */
.modal-module .modal-lesson-content {
    flex-grow: 1;
    min-width: 0;
}

.modal-module .modal-lesson-title {
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
    margin: 0;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.modal-module .modal-lesson-link:hover .modal-lesson-title {
    color: #1e40af;
}

/* Elegant Lesson Arrow */
.modal-module .modal-lesson-arrow {
    color: #cbd5e1;
    font-size: 1.375rem;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-module .modal-lesson-link:hover .modal-lesson-arrow {
    color: #2563eb;
    transform: translateX(6px);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL FOOTER - Premium CTA Design
   ═══════════════════════════════════════════════════════════════ */

.modal-module .modal-footer {
    padding: 2rem 2.5rem;
    background: white;
    border-top: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.modal-module .modal-footer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #64748b;
    font-size: 0.9375rem;
    font-weight: 500;
}

.modal-module .modal-footer-info i {
    font-size: 1.375rem;
    color: #2563eb;
}

.modal-module .modal-footer-buttons {
    display: flex;
    gap: 1rem;
}

/* Premium Close Button */
.modal-module .btn-modal-close {
    padding: 0.875rem 1.75rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-weight: 600;
    border-radius: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 48px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.01em;
}

.modal-module .btn-modal-close:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.modal-module .btn-modal-close:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Premium Primary Button */
.modal-module .btn-modal-primary {
    padding: 0.875rem 2.25rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    font-weight: 700;
    border-radius: 0.875rem;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 
        0 4px 14px rgba(37, 99, 235, 0.35),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    min-height: 48px;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.modal-module .btn-modal-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.modal-module .btn-modal-primary:hover::before {
    left: 100%;
}

.modal-module .btn-modal-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 24px rgba(37, 99, 235, 0.45),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    color: white;
}

.modal-module .btn-modal-primary:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 14px rgba(37, 99, 235, 0.35),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.modal-module .btn-modal-primary i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.modal-module .btn-modal-primary:hover i {
    transform: translateX(2px);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

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

.modal.show .modal-module .modal-content {
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lesson Item Stagger Animation */
@keyframes lessonFadeIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modal-module .modal-lesson-item {
    animation: lessonFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.modal-module .modal-lesson-item:nth-child(1) { animation-delay: 0.05s; }
.modal-module .modal-lesson-item:nth-child(2) { animation-delay: 0.1s; }
.modal-module .modal-lesson-item:nth-child(3) { animation-delay: 0.15s; }
.modal-module .modal-lesson-item:nth-child(4) { animation-delay: 0.2s; }
.modal-module .modal-lesson-item:nth-child(5) { animation-delay: 0.25s; }
.modal-module .modal-lesson-item:nth-child(n+6) { animation-delay: 0.3s; }

/* Unit group animation */
@keyframes unitFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-module .modal-unit-group {
    animation: unitFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.modal-module .modal-unit-group:nth-child(1) { animation-delay: 0.1s; }
.modal-module .modal-unit-group:nth-child(2) { animation-delay: 0.2s; }
.modal-module .modal-unit-group:nth-child(3) { animation-delay: 0.3s; }
.modal-module .modal-unit-group:nth-child(n+4) { animation-delay: 0.4s; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 767.98px) {
    .modal-dialog.modal-module {
        margin: 0.5rem;
    }
    
    .modal-module .modal-header {
        padding: 1.75rem 1.25rem 2rem 1.25rem;
    }
    
    .modal-module .modal-icon-large {
        width: 64px;
        height: 64px;
        font-size: 1.875rem;
    }
    
    .modal-module .modal-stats-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .modal-module .modal-stat-item {
        padding: 1rem;
    }
    
    .modal-module .modal-body {
        padding: 1.5rem 1.25rem;
        max-height: 50vh;
    }
    
    .modal-module .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-module .modal-description {
        font-size: 1rem;
        padding: 1.5rem;
    }
    
    .modal-module .modal-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 1.25rem;
    }
    
    .modal-module .modal-footer-info {
        justify-content: center;
        order: 2;
        margin-top: 1rem;
    }
    
    .modal-module .modal-footer-buttons {
        order: 1;
        flex-direction: column-reverse;
    }
    
    .modal-module .btn-modal-close,
    .modal-module .btn-modal-primary {
        width: 100%;
        justify-content: center;
    }
    
    .modal-module .modal-lesson-link {
        padding: 1rem 1.25rem;
    }
    
    .modal-module .modal-lesson-link:hover {
        padding-left: 1.5rem;
    }
    
    .modal-module .modal-lesson-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .modal-module .modal-stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.875rem;
    }
    
    .modal-module .modal-stat-item {
        padding: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .modal-module .modal-content,
    .modal-module .modal-lesson-item,
    .modal-module .modal-unit-group {
        animation: none !important;
    }
    
    .modal-module .modal-lesson-link,
    .modal-module .modal-lesson-icon,
    .modal-module .modal-lesson-arrow,
    .modal-module .btn-modal-close,
    .modal-module .btn-modal-primary,
    .modal-module .modal-progress-bar-fill {
        transition: none !important;
    }
    
    .modal-module .modal-header::before,
    .modal-module .modal-progress-section::before,
    .modal-module .modal-progress-bar-fill::after {
        animation: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .modal-module .modal-header {
        border-bottom: 3px solid white;
    }
    
    .modal-module .modal-lesson-link {
        border: 2px solid transparent;
    }
    
    .modal-module .modal-lesson-link:hover,
    .modal-module .modal-lesson-link:focus-visible {
        border-color: #2563eb;
    }
    
    .modal-module .btn-modal-close,
    .modal-module .btn-modal-primary {
        border: 2px solid currentColor;
    }
}

/* Focus Visible Enhancement */
.modal-module *:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* Screen Reader Only Text */
.modal-module .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Touch Target Enhancement */
@media (pointer: coarse) {
    .modal-module .modal-lesson-link,
    .modal-module .btn-modal-close,
    .modal-module .btn-modal-primary {
        min-height: 48px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE SUPPORT (Optional Enhancement)
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    .modal-module .modal-body {
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    }
    
    .modal-module .modal-description {
        background: #334155;
        color: #e2e8f0;
        border-left-color: #60a5fa;
    }
    
    .modal-module .modal-section-header {
        border-bottom-color: #334155;
    }
    
    .modal-module .modal-section-title {
        color: #f1f5f9;
    }
    
    .modal-module .modal-unit-group {
        background: #334155;
        border-color: #475569;
    }
    
    .modal-module .modal-unit-header {
        background: linear-gradient(135deg, #475569 0%, #334155 100%);
        border-bottom-color: #475569;
    }
    
    .modal-module .modal-unit-title {
        color: #f1f5f9;
    }
    
    .modal-module .modal-lesson-item {
        border-bottom-color: #475569;
    }
    
    .modal-module .modal-lesson-link {
        color: #cbd5e1;
    }
    
    .modal-module .modal-lesson-link:hover {
        background: linear-gradient(90deg, 
            rgba(96, 165, 250, 0.1) 0%, 
            rgba(96, 165, 250, 0.05) 50%,
            transparent 100%);
        color: #60a5fa;
    }
    
    .modal-module .modal-footer {
        background: #1e293b;
        border-top-color: #334155;
    }
}

/* ═══════════════════════════════════════════════════════════════
   END OF PREMIUM MODULE MODAL STYLES
   ═══════════════════════════════════════════════════════════════ */
