/* Extracted from application/views/content/view_my_module_summary_new.php */
/* Modern Module Summary Dashboard Styles */
.module-dashboard-container {
    background: #ffffff;
    min-height: 0;
    padding: 0;
    color: #333333;
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    letter-spacing: 0.3px;
    margin-bottom: 0;
}

/* Ensure footer is properly positioned and visible */
.student-footer {
    position: relative;
    z-index: 100;
    clear: both;
    width: 100%;
    margin-top: auto;
}

/* Scope to course summary wrapper only — unscoped .container fought guest header/footer .container */
.course-summary-wrap.container,
.course-summary-wrap .container {
    position: relative;
    z-index: 1;
}

/* Equal height for left and right sections */
.row.equal-height {
    display: flex;
    flex-wrap: wrap;
}

.row.equal-height > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.course-details-panel,
.module-list-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

/* Right panel card should include "Course Miles" heading inside same box */
.module-list-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 10px 12px 12px 12px;
}

/* Course Miles heading: single line, no wrap */
.module-list-section .course-miles-heading {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px 10px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
}

.module-list-section .course-miles-label {
    flex-shrink: 0;
}

.module-list-section .legend-inline {
    flex-shrink: 0;
    font-size: 0.8rem;
}

.module-list-section .legend-inline i {
    margin-right: 2px;
    margin-left: 4px;
}

.module-list-section .scroll-hint-inline {
    font-size: 0.8rem;
    font-weight: 500;
    flex-shrink: 0;
    margin-left: 4px;
}

@media (max-width: 768px) {
    .module-list-section .course-miles-label,
    .module-list-section .legend-inline {
        display: none !important;
    }

    .module-list-section .course-miles-heading {
        justify-content: flex-end;
    }
}

/* Highlight miles border when no mile is selected (amber/orange) */
.module-list-section--no-mile-selected {
    border: 2px solid #e6a23c;
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(230, 162, 60, 0.3), 0 4px 20px rgba(230, 162, 60, 0.2);
    padding: 12px;
    animation: mile-border-pulse 2.5s ease-in-out infinite;
}
@keyframes mile-border-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(230, 162, 60, 0.3), 0 4px 20px rgba(230, 162, 60, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(230, 162, 60, 0.45), 0 4px 24px rgba(230, 162, 60, 0.3); }
}

/* Ensure equal heights for both sections */
.equal-height {
    display: flex;
    flex-wrap: wrap;
}

.equal-height > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.equal-height .course-details-panel,
.equal-height .module-list-section {
    flex: 1;
    height: 100%;
}

/* Removed conflicting smooth scroll behavior */

/* Module Hero Section - Compact Design */
.module-hero-section {
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.module-hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 50%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.module-hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

/* Hero Course Title - Compact */
.hero-course-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
    line-height: 1.2;
    margin-bottom: 8px !important;
}

.hero-book-icon {
    font-size: 1.4rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hero Badges - Compact */
.hero-badges {
    margin-top: 10px;
}

.hero-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.hero-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-badge-warning {
    background: rgba(255, 193, 7, 0.9);
    color: #000;
}

.hero-badge-success {
    background: rgba(40, 167, 69, 0.9);
    color: #fff;
}

.hero-badge-info {
    background: rgba(23, 162, 184, 0.9);
    color: #fff;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Learning Progress Card - Compact Design */
.learning-progress-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 18px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.learning-progress-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.learning-progress-card:hover::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out;
}

.learning-progress-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.progress-icon-container {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

.progress-icon {
    font-size: 2.5rem;
    color: #ffffff;
    z-index: 2;
    position: relative;
    animation: bounce 2s infinite;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.progress-ring-fill {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.progress-title {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
}

.progress-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin-bottom: 15px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.progress-stats .stat-item {
    text-align: center;
    flex: 1;
}

.progress-stats .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1;
    margin-bottom: 2px;
}

.progress-stats .stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Hero Stat Icons - Compact Design */
.hero-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
    margin-right: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.hero-stat-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.progress-stats .stat-item:first-child .hero-stat-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.progress-stats .stat-item:last-child .hero-stat-icon {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.hero-stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.progress-stats .stat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Module List Container - fills remaining height below Course Miles heading, scroll to see all (shows ~5 miles) */
.module-list-container {
    background: transparent;
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
    min-height: 0;
    max-height: 235px;
    overflow-y: auto;
    position: relative;
    padding: 8px 0 0 0;
    flex: 1;
}

/* Custom scrollbar for module list */
.module-list-container::-webkit-scrollbar {
    width: 8px;
}

.module-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.module-list-container::-webkit-scrollbar-thumb {
    background: #52b6ec;
    border-radius: 4px;
}

.module-list-container::-webkit-scrollbar-thumb:hover {
    background: #1586c3;
}

/* Scroll indicator */
.scroll-indicator {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #e9ecef;
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 0;
    border-radius: 0 0 12px 12px;
}

.scroll-indicator i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Course Details Panel - stretches to match right column height */
.course-details-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    height: 100%;
    min-height: 240px;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
}

.course-level-nav-top {
    /* Inset buttons from rounded panel edges (panel uses overflow:hidden). */
    margin-top: 12px;
    margin-left: 12px;
    margin-right: 12px;
}

/* Make top course Prev/Next buttons curved on this page */
.course-level-nav-top .btn {
    border-radius: 999px !important;
}

@media (max-width: 768px) {
    .course-level-nav-top {
        margin-top: 10px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .course-title-between-nav {
        padding-left: 10px;
        padding-right: 10px;
    }

    .course-current-title {
        font-size: 1rem;
        padding: 8px 10px;
        border-radius: 10px;
    }

    /* On mobile we don't need "Click to expand/collapse" hint text */
    .section-expand-hint {
        display: none !important;
    }

    /* Mobile: show badge as S1/S2 instead of SECTION 1/2 */
    .section-badge-prefix {
        display: none !important;
    }

    .section-number-badge::before {
        content: 'S';
        display: inline;
    }

    .section-number-badge {
        padding-left: 10px; /* space for the leading S */
        white-space: nowrap;
        flex-shrink: 0;
    }

    .section-header,
    .section-title-text {
        display: flex;
        align-items: center;
        flex-wrap: nowrap !important;
    }

    .section-header {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .section-title-text {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .section-title-display {
        flex: 1 1 auto;
        white-space: normal;
        overflow: hidden;
        text-overflow: initial;
        min-width: 0;
        display: block;
        line-height: 1.2;
    }

    /* Miles list (Assignment/Exam) - show icon only */
    .status-indicator .status-label {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .course-level-nav-top {
        flex-direction: column;
    }
}

.course-image-container {
    position: relative;
    height: 180px;
    flex-shrink: 0;
    overflow: hidden;
}

.course-title-between-nav {
    padding: 4px 12px 12px;
}

.course-current-title {
    text-align: center;
    font-weight: 800;
    color: #ffffff;
    font-size: 1.05rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    /* Active/badge look */
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(21, 134, 195, 0.25);

    animation: active-course-title-pulse 2.2s ease-in-out infinite;
}

@keyframes active-course-title-pulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(21, 134, 195, 0.25); transform: translateY(0); }
    50% { box-shadow: 0 10px 24px rgba(82, 182, 236, 0.35); transform: translateY(-1px); }
}

.course-image-title-overlay {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.course-image {
    width: 100%;
    height: 100%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s ease;
    text-indent: -9999px;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
}

.course-image:hover {
    transform: scale(1.05);
}

.course-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.course-info {
    padding: 10px 12px 12px;
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.course-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.3;
    position: relative;
    z-index: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-size: 0.8rem;
}

.meta-item i {
    width: 14px;
    margin-right: 4px;
    font-size: 0.75rem;
}

.course-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 0;
    margin-top: auto;
    gap: 12px;
}

.course-details-panel .stat-icon {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
}

.course-details-panel .stat-number {
    font-size: 1rem;
}

.course-details-panel .stat-label {
    font-size: 0.65rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.stat-item:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #17a2b8, #52b6ec);
}

.stat-item:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.stat-item:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 2px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Module List Items */
.module-list-item {
    background: white;
    border-bottom: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.module-list-item a {
    color: inherit;
    text-decoration: none;
}

.module-list-item:last-child {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
}

/* Module Separator */
.module-separator {
    height: 3px;
    background: linear-gradient(90deg, transparent, #52b6ec, transparent);
}

/* Compact module content */
.module-list-item h5 {
    margin-bottom: 2px !important;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
}

.module-list-item p {
    margin-bottom: 0 !important;
    font-size: 0.95rem;
    line-height: 1.1;
}

.module-list-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateX(5px);
    cursor: pointer;
}

.module-link {
    transition: all 0.3s ease;
}

.module-link--disabled {
    pointer-events: none;
}

.module-link:hover {
    text-decoration: none !important;
}


.module-list-item.completed {
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    border-left: 4px solid #28a745;
}

.module-list-item.locked {
    opacity: 0.7;
    background: linear-gradient(135deg, #fff5f5 0%, #ffeaea 100%);
    border-left: 4px solid #dc3545;
}

.module-list-item.current {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-left: 4px solid #52b6ec;
    box-shadow: 0 0 15px rgba(82, 182, 236, 0.2);
}

/* Module Status Icons - compact size before each mile */
.module-status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    margin-bottom: 0;
    flex-shrink: 0;
    text-align: center;
}

.module-status-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.module-status-icon.completed {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.module-status-icon.current {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.module-status-icon.locked {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

/* Guest: courses.seq === 0 — locked miles after free window = grey; seq ≠ 0 = default red .locked above */
.course-summary-wrap--guest .module-list-item.locked.guest-mile-locked--free {
    opacity: 0.92;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-left: 4px solid #6b7280;
}
.course-summary-wrap--guest .module-list-item.locked.guest-mile-locked--free:hover {
    background: linear-gradient(135deg, #eceef1 0%, #dde1e6 100%);
}
.course-summary-wrap--guest .module-list-item.locked.guest-mile-locked--free .module-status-icon.locked {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}
.course-summary-wrap--guest .module-list-item.locked.guest-mile-locked--free h5.text-dark {
    color: #374151 !important;
}
.course-summary-wrap--guest .module-list-item.locked.guest-mile-locked--free .text-muted {
    color: #6b7280 !important;
}

.module-status-icon.pending {
    background: linear-gradient(135deg, #52b6ec, #1586c3);
}

/* Module Name Display */
.module-name-display {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 10px 15px;
    border-left: 4px solid #52b6ec;
    margin-bottom: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Animated background elements */
.module-name-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(82, 182, 236, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(82, 182, 236, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(82, 182, 236, 0.05) 0%, transparent 50%);
    animation: breathe 4s infinite ease-in-out;
    z-index: 0;
}

.module-name-display::after {
    content: '✨';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 18px;
    animation: sparkle 2s infinite;
    z-index: 0;
}

/* Rotating geometric shapes */
/* Mile navigator above tabs - same style as upper section: Mile no: title */
.mile-navigator {
    position: relative;
    z-index: 1;
    flex-wrap: nowrap;
    white-space: nowrap;
    background: linear-gradient(135deg, #f8fbff 0%, #eef7fd 100%);
    border: 1px solid #d7eaf8;
    border-radius: 12px;
    padding: 8px 10px;
}
.mile-navigator .mile-navigator-title {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #ffffff;
    border: 1px solid #d7eaf8;
    border-radius: 999px;
    padding: 6px 10px;
    text-align: center;
}
.mile-navigator .mile-label {
    color: #52b6ec;
    font-weight: 700;
    margin-right: 4px;
}
.mile-navigator .mile-nav-link.mile-nav-disabled {
    font-size: 0.9rem;
    cursor: default;
    flex-shrink: 0;
}
.mile-navigator .mile-nav-prev,
.mile-navigator .mile-nav-next {
    flex-shrink: 0;
    border-radius: 999px !important;
}
.mile-navigator .mile-nav-prev:hover,
.mile-navigator .mile-nav-next:hover {
    transform: translateY(-1px);
}

/* Mile header prev/next: Previous/Next label + mile number only (title is in center) */
.mile-header-mile-nav .mile-header-nav-side {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 42%;
}
.mile-header-mile-nav .mile-header-btn-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}
.mile-header-mile-nav .mile-header-btn-stack--next {
    align-items: flex-end;
}
.mile-header-mile-nav .mile-header-btn-label {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.92;
}
.mile-header-mile-nav .mile-header-mile-no {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}
.mile-header-mile-nav .mile-header-btn-chevron {
    align-self: center;
}
@media (max-width: 576px) {
    .mile-header-mile-nav .mile-header-nav-side {
        max-width: 46%;
    }
}

/* Milestone Prev/Next — same gradient as .sidebar-nav .nav-link.active (not Bootstrap btn-primary blue) */
.btn.student-sidebar-brand-btn {
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    border: none;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(82, 182, 236, 0.22);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.btn.student-sidebar-brand-btn:hover,
.btn.student-sidebar-brand-btn:focus {
    background: linear-gradient(135deg, #1586c3 0%, #0d5a8a 100%);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(82, 182, 236, 0.35);
}
.btn.student-sidebar-brand-btn:focus-visible {
    outline: 2px solid rgba(82, 182, 236, 0.55);
    outline-offset: 2px;
}
.mile-header-mile-nav .mile-header-btn-label,
.mile-header-mile-nav .mile-header-mile-no {
    color: #fff;
}

/* Strip behind milestone nav — align with sidebar tint (level-theme-bar style) */
.mile-header-mile-nav--skin,
.lesson-mile-nav-strip--skin {
    border-color: rgba(82, 182, 236, 0.3) !important;
    background: linear-gradient(135deg, #f8fbff 0%, #eef7fd 100%) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    box-shadow: none !important;
}

.mile-header-current .mile-header-current-label {
    color: #1586c3 !important;
}

.module-name-display .rotating-shape {
    position: absolute;
    border: 2px solid rgba(82, 182, 236, 0.3);
    z-index: 0;
}

.module-name-display .rotating-shape:nth-child(1) {
    top: 20px;
    left: 20px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    animation: rotate 3s linear infinite;
}

.module-name-display .rotating-shape:nth-child(2) {
    bottom: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    animation: rotate-reverse 4s linear infinite;
}

.module-name-display .rotating-shape:nth-child(3) {
    top: 50%;
    left: 10px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: bounce 2s infinite;
}

/* Ensure content is above animations */
.module-name-display h2,
.module-name-display p {
    position: relative;
    z-index: 1;
}

/* Animation keyframes */
@keyframes breathe {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
    25% { transform: scale(1.2) rotate(90deg); opacity: 1; }
    50% { transform: scale(0.8) rotate(180deg); opacity: 0.8; }
    75% { transform: scale(1.1) rotate(270deg); opacity: 0.9; }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-reverse {
    0% { transform: rotate(45deg); }
    100% { transform: rotate(-315deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.module-title-display {
    color: #2c3e50;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-title-display i {
    color: #52b6ec;
    font-size: 20px;
}

.module-description-display {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0;
    color: #000000 !important;
}

/* Container overflow control */
/* Reduce space between menu and content, and between left/right sections */
.row.equal-height.course-summary-row > .course-summary-left {
    padding-right: 0.5rem;
}
.row.equal-height.course-summary-row > .course-summary-right {
    padding-left: 0.5rem;
}

/* Make the top-left summary panel a bit smaller */
@media (min-width: 992px) {
    .row.equal-height.course-summary-row > .course-summary-left {
        flex: 0 0 30%;
        max-width: 30%;
    }
    .row.equal-height.course-summary-row > .course-summary-right {
        flex: 0 0 70%;
        max-width: 70%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .row.equal-height.course-summary-row > .course-summary-left {
        flex: 0 0 38%;
        max-width: 38%;
    }
    .row.equal-height.course-summary-row > .course-summary-right {
        flex: 0 0 62%;
        max-width: 62%;
    }
}

.course-summary-wrap {
    --cs-space-1: 4px;
    --cs-space-2: 8px;
    --cs-space-3: 12px;
    --cs-space-4: 16px;
    --cs-space-5: 24px;
    --cs-radius-sm: 8px;
    --cs-radius-md: 12px;
    --cs-radius-pill: 999px;
    --cs-shadow: 0 2px 8px rgba(20, 35, 46, 0.08);
    --cs-type-sm: 0.8125rem;
    --cs-type-md: 0.875rem;
    --cs-type-base: 1rem;
    --cs-type-lg: 1.125rem;
    font-size: var(--cs-type-base);
    /* This view uses Bootstrap `px-4` (+ optional pt); keep bottom flush to the footer */
    padding: 0 !important;
    padding-bottom: 0 !important;
    /* Keep centered when the outer wrapper is Bootstrap `.container` */
    margin-left: auto !important;
    margin-right: auto !important;
}

.course-summary-wrap .tab-pane-title {
    font-size: var(--cs-type-lg);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 var(--cs-space-4);
    color: #14232e;
}

.course-summary-wrap .tab-surface-panel,
.course-summary-wrap .comments-section-modern,
.course-summary-wrap .lesson-content-modern {
    background: #fff;
    border-radius: var(--cs-radius-md);
    box-shadow: var(--cs-shadow);
    padding: var(--cs-space-4);
}

.course-summary-wrap .lesson-surface-header {
    position: relative;
    gap: var(--cs-space-3);
    padding-bottom: var(--cs-space-3);
    margin-bottom: var(--cs-space-3);
    border-bottom: 1px solid #e8eef4;
}

.course-summary-wrap .lesson-surface-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.course-summary-wrap .lesson-surface-header .tab-pane-title {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .course-summary-wrap .lesson-surface-header {
        flex-wrap: wrap;
    }
    .course-summary-wrap .lesson-surface-header-center {
        position: static;
        transform: none;
        width: 100%;
        text-align: center;
        order: 3;
    }
}

/* Guest uses Bootstrap `.container` and should keep its default gutters */
.course-summary-wrap--guest {
    padding-top: 0 !important; /* pt-1 on container handles top; avoid double gap */
    padding-bottom: 0 !important;
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5) !important;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5) !important;
}

/* Single parent container with inner sections */
.course-summary-section {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Prevent forced vertical stretch that creates empty gap below top block */
.course-summary-top-section {
    margin-bottom: 0 !important;
}

.course-summary-row {
    align-items: stretch !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.course-summary-top-section .course-summary-left,
.course-summary-top-section .course-summary-right {
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.course-summary-module-header-section .module-name-display {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Match mile header width with tabs/content section */
.course-summary-module-header-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
}

/* Guest preview: pull mile title strip closer to course overview + tabs */
.course-summary-wrap--guest .course-summary-module-header-section {
    margin-top: 2px !important;
    margin-bottom: 4px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

@media (max-width: 767.98px) {
    .course-summary-wrap--guest .mile-header-mile-nav {
        flex-wrap: wrap !important;
        row-gap: 0.45rem;
    }

    .course-summary-wrap--guest .mile-header-current {
        order: -1;
        flex: 1 1 100%;
        overflow: hidden;
        white-space: normal;
    }

    .course-summary-wrap--guest .mile-header-current-title {
        display: block;
        overflow-wrap: anywhere;
    }

    .course-summary-wrap--guest .mile-header-nav-side {
        flex: 1 1 0;
        max-width: none;
    }

    .course-summary-wrap--guest .mile-header-nav-side--next {
        justify-content: flex-end;
    }
}

.course-summary-wrap--guest .course-summary-content-section#content-tabs {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.course-summary-wrap--guest .content-tabs {
    margin-bottom: 0 !important;
}

.course-summary-wrap--guest .lesson-mile-nav-bottom {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove outer card so mile navigator shows as single container */
.course-summary-module-header-section .module-name-display {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.course-summary-module-header-section .module-name-display::before,
.course-summary-module-header-section .module-name-display::after,
.course-summary-module-header-section .module-name-display .rotating-shape {
    display: none !important;
}

/* Top level navigator theme bar (Prev / Current / Next) */
.level-theme-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef7fd 100%);
    border: 1px solid #d7eaf8;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

/* Keep top level theme bar width aligned with other sections */
.course-summary-level-theme-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.level-theme-bar .level-theme-center {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-weight: 700;
    color: #0f3e67;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #ffffff;
    border: 1px solid #d7eaf8;
    border-radius: 999px;
    padding: 6px 10px;
}

.level-theme-bar .level-theme-center-text {
    display: inline;
    white-space: nowrap;
}

.level-theme-bar--teacher-simple {
    justify-content: center;
}
.level-theme-bar--teacher-simple .level-theme-center {
    flex: 1 1 auto;
    max-width: 100%;
}

.level-theme-bar .level-theme-side {
    width: 180px;
    flex-shrink: 0;
}

.level-theme-bar .btn {
    border-radius: 999px !important;
}

.level-theme-bar .level-nav-btn--locked {
    color: #dc2626 !important;
    border-color: #f87171 !important;
    background: #fef2f2 !important;
    font-weight: 600;
}

.level-theme-bar .level-nav-btn--locked:hover,
.level-theme-bar .level-nav-btn--locked:focus {
    color: #b91c1c !important;
    border-color: #ef4444 !important;
    background: #fee2e2 !important;
}

.level-theme-bar .level-nav-btn--unlocked {
    font-weight: 600;
}

@media (max-width: 768px) {
    .level-theme-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 6px;
    }
    .level-theme-bar .level-theme-side {
        width: auto;
        min-width: 84px;
        flex: 0 0 auto;
    }
    .level-theme-bar .level-theme-center {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.9rem;
        padding: 5px 8px;
    }
    .level-theme-bar .btn {
        font-size: 0.78rem;
        padding: 4px 8px;
    }

    /* Slight polish for page header menu blocks on mobile */
    .course-summary-level-theme-section,
    .course-summary-module-header-section,
    .course-summary-content-section {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .level-theme-bar,
    .mile-navigator {
        padding: 6px 8px;
        border-radius: 10px;
    }
}

.course-summary-row > .course-summary-left,
.course-summary-row > .course-summary-right,
.course-summary-row .course-details-panel,
.course-summary-row .module-list-section {
    height: auto !important;
    min-height: 0 !important;
}

/* Disable sticky behavior in top card to avoid persistent blank gap */
.course-summary-row .course-details-panel {
    position: static !important;
    top: auto !important;
}

/* Keep left and right cards same height in top row */
.course-summary-row .course-details-panel,
.course-summary-row .module-list-section {
    height: 100% !important;
}

/* Prevent top two-column block from widening when sidebar expands */
.course-summary-top-section {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.course-summary-row > .course-summary-left,
.course-summary-row > .course-summary-right {
    min-width: 0;
}

.container-fluid.px-4 {
    overflow-x: hidden;
}

/* Ensure all rows with mb-4 have consistent width */
.container-fluid.px-4 > .row.mb-4 {
    width: 100%;
    max-width: 100%;
}

.container-fluid.px-4 > .row.mb-4 > .col-12 {
    width: 100%;
    max-width: 100%;
}

/* Select a mile guide notice (shown when no module is selected) */
.select-mile-guide {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4fc 100%);
    border: 2px dashed #52b6ec;
    border-radius: 16px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(82, 182, 236, 0.15);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
}
.select-mile-guide .select-mile-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: white;
    box-shadow: 0 6px 20px rgba(82, 182, 236, 0.4);
}
.select-mile-guide .select-mile-content {
    flex: 1;
    min-width: 0;
}
.select-mile-guide h4 {
    color: #1586c3;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}
.select-mile-guide p {
    color: #555;
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
}
.select-mile-guide .hint-arrow {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #52b6ec;
    animation: hint-bounce 2s ease-in-out infinite;
}
@media (max-width: 576px) {
    .select-mile-guide {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* Mobile: show icon-only tabs when space is limited */
    .content-tab-nav .tab-text {
        display: none !important;
    }

    .content-tab-nav .tab-icon {
        margin-right: 0;
    }

    .content-tab-nav li a {
        justify-content: center;
        padding-left: 14px;
        padding-right: 14px;
    }

    /* Spread tab icons across full mobile width */
    .content-tab-nav {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: hidden !important;
    }

    .content-tab-nav li {
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }

    .content-tab-nav li a {
        width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
        min-height: 34px;
    }

    .content-tab-nav .tab-icon {
        font-size: 20px;
    }
}
@keyframes hint-bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

/* Ensure hero section and tab section have identical width constraints */
.module-hero-section,
.content-tabs {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure tab content also respects width */
.tab-content-modern {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Module name display */
.module-name-display {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
}

/* Content Tabs - Professional Menu Style */
.content-tabs {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 0;
    overflow: hidden;
    overflow-x: hidden;
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.content-tab-nav {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
}

.content-tab-nav li {
    flex: 1;
    position: relative;
    border-right: 1px solid #e9ecef;
}

.content-tab-nav li:last-child {
    border-right: none;
}

.content-tab-nav li a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    text-align: center;
    padding: 4px 10px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    position: relative;
    border-bottom: 3px solid transparent;
    min-height: 40px;
}

.content-tab-nav li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(82, 182, 236, 0.12) 0%, rgba(21, 134, 195, 0.12) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.content-tab-nav li a:hover::before {
    opacity: 1;
}

.content-tab-nav li a:hover {
    color: #1586c3;
    background: rgba(82, 182, 236, 0.16);
    transform: translateY(-1px);
    border-bottom-color: rgba(21, 134, 195, 0.6);
}

.content-tab-nav li a.active {
    color: #ffffff;
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    border-bottom-color: #0f6ab8;
    font-weight: 700;
    position: relative;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4);
    border-radius: 8px;
}

.content-tab-nav li a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, #0f6ab8, #52b6ec);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.3);
}

/* Tab Icons Enhancement */
.content-tab-nav li a {
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
}

.content-tab-nav .tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 22px;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.content-tab-nav .tab-text {
    display: inline;
    position: relative;
    z-index: 1;
}

.content-tab-nav li a:hover {
    box-shadow: 0 2px 8px rgba(82, 182, 236, 0.15);
}

.content-tab-nav li a.active {
    box-shadow: 0 4px 12px rgba(82, 182, 236, 0.2);
}

/* Menu Animation Enhancements */
.content-tab-nav li a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-tab-nav li a:hover {
    transform: translateY(-2px);
}

.content-tab-nav li a:active {
    transform: translateY(0);
}

/* Tab Content */
.tab-content-modern {
    display: none;
    padding: 10px 0;
    margin-top: 5px;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.tab-content-modern.active {
    display: block;
}


/* Video Cards */
.video-card-modern {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(20, 35, 46, 0.08);
    transition: border-color 0.2s ease;
    border: 1px solid #e8eef4;
    overflow: hidden;
    margin-bottom: 16px;
}

.video-card-modern:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(20, 35, 46, 0.08);
    border-color: #d7e3ee;
}

.video-thumbnail-modern {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-right: 15px;
}

.video-thumbnail-modern.youtube {
    background: linear-gradient(135deg, #ff0000, #cc0000);
}

.video-thumbnail-modern.s3 {
    background: linear-gradient(135deg, #51B5EB, #0056b3);
}

.video-thumbnail-modern.file {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.video-card-modern.video-card-embed {
    margin-bottom: 0;
    width: 280px;
    max-width: 100%;
}
.video-card-modern.video-card-embed:hover {
    transform: none;
    border-color: rgba(82, 182, 236, 0.35);
}
.youtube-inline-player {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.youtube-inline-player__frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #111;
}
.youtube-inline-player__frame iframe,
.youtube-inline-player__frame img,
.youtube-inline-player__frame video,
.youtube-inline-player__facade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.youtube-inline-player__facade {
    padding: 0;
    margin: 0;
    background: #111;
    cursor: pointer;
}
.youtube-inline-player__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}
.youtube-inline-player__facade:hover .youtube-inline-player__play {
    background: #cc0000;
}
.library-inline-player__facade:hover .youtube-inline-player__play {
    background: #1586c3;
}
.library-inline-player__poster {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 2.25rem;
}
.youtube-inline-player__frame img {
    object-fit: cover;
    filter: brightness(0.55);
}
.youtube-inline-player__lock {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.youtube-inline-player__lock .btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
}
.youtube-inline-player__meta {
    padding: 8px 10px;
    background: #fff;
}
.youtube-inline-player__title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1e293b;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

/* Lesson Content */
.lesson-content-modern {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(20, 35, 46, 0.08);
    padding: 16px;
    margin-bottom: 16px;
    min-width: 0;
    max-width: 100%;
}

.lesson-section {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid #e8eef4;
    padding: 0;
    margin-bottom: 0;
    background: transparent;
    min-width: 0;
}

.lesson-content-modern .lesson-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* Section Rating Styles — directly under lesson HTML; clear floats */
.section-rating-container {
    background: transparent;
    border-radius: 0;
    padding: 6px 0 0;
    margin-top: 4px;
    margin-bottom: 0;
    clear: both;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.section-rating-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.star-icon {
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 20px;
    margin: 0;
    line-height: 1;
    color: #ffc107;
}

.star-icon:hover {
    transform: scale(1.2);
    color: #ffc107 !important;
}

.star-icon.rated {
    color: #ffc107 !important;
}

.star-rating.already-rated .star-icon {
    pointer-events: none;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.star-rating.already-rated .star-icon.rated {
    opacity: 1;
}

.rating-feedback {
    text-align: right;
    min-height: 0;
    margin-bottom: 0;
}

.rating-label {
    font-size: 0.95rem;
    color: #495057;
}

@media (max-width: 768px) {
    .section-rating-container .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .section-rating-wrapper {
        width: 100%;
        align-items: flex-start;
        margin-top: 10px;
    }
    
    .rating-label {
        margin-bottom: 10px !important;
    }
}

.section-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    margin: 0;
    padding: 10px 8px;
    border-radius: 8px;
    gap: 8px;
}

.section-header--locked {
    cursor: not-allowed;
}

.section-title-text {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.section-title-display {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #1e293b;
    line-height: 1.35;
}

.section-number-badge {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 6px;
    margin-right: 10px;
    font-size: 10px;
    font-weight: 700;
    border: none;
    box-shadow: none;
    text-shadow: none;
    flex-shrink: 0;
}

.section-badge-prefix {
    display: inline;
}

.section-badge-value {
    display: inline;
    margin-left: 0;
}

.section-expand-hint {
    display: none;
}

.section-header:hover {
    background: #f4f8fb;
    color: inherit;
}

.section-header:hover .section-expand-hint {
    opacity: 1;
}

.section-toggle {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    color: #64748b;
    font-size: 11px;
    transform: rotate(-90deg);
    flex-shrink: 0;
}

.section-toggle.expanded {
    transform: rotate(0deg);
    color: #1586c3;
}

.section-content {
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
}

/* Lesson tab: authored HTML (.lesson-section-html) renders like admin — layout safety only, no forced colors/code theme */
.lesson-content-modern .section-content,
.lesson-content-modern .section-content * {
    max-width: 100%;
    box-sizing: border-box;
}

.lesson-content-modern .section-content {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.lesson-content-modern .lesson-section-html {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Tight gap before “Rate this section” — trim trailing margin on last authored block */
.lesson-content-modern .section-lesson-body .lesson-section-html > :last-child,
.lesson-content-modern .section-lesson-body .lesson-type-item:last-child > :last-child {
    margin-bottom: 0;
}

.lesson-content-modern .lesson-read-time,
#fullscreen-content-display .lesson-read-time {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.85rem 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    text-transform: none;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(81, 181, 235, 0.18) 0%, rgba(45, 139, 196, 0.1) 55%, rgba(28, 74, 99, 0.06) 100%);
    border: 1px solid rgba(81, 181, 235, 0.45);
    box-shadow: 0 1px 3px rgba(45, 139, 196, 0.12);
}

.lesson-content-modern .lesson-read-time-icon,
#fullscreen-content-display .lesson-read-time-icon {
    font-size: 0.95em;
    flex-shrink: 0;
    color: var(--vaanii-primary, #51b5eb);
    filter: drop-shadow(0 1px 1px rgba(45, 139, 196, 0.25));
}

.lesson-content-modern .lesson-read-time-text,
#fullscreen-content-display .lesson-read-time-text {
    background: linear-gradient(90deg, var(--vaanii-primary-dark, #2d8bc4) 0%, var(--vaanii-primary, #51b5eb) 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lesson-content-modern.dark-mode .lesson-read-time,
#fullscreen-overlay.dark-mode #fullscreen-content-display .lesson-read-time {
    background: linear-gradient(135deg, rgba(81, 181, 235, 0.22) 0%, rgba(56, 189, 248, 0.12) 100%);
    border-color: rgba(125, 211, 252, 0.4);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.lesson-content-modern.dark-mode .lesson-read-time-icon,
#fullscreen-overlay.dark-mode #fullscreen-content-display .lesson-read-time-icon {
    color: #7dd3fc;
}

.lesson-content-modern.dark-mode .lesson-read-time-text,
#fullscreen-overlay.dark-mode #fullscreen-content-display .lesson-read-time-text {
    background: linear-gradient(90deg, #7dd3fc 0%, #bae6fd 50%, #e0f2fe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lesson-content-modern .lesson-type-item + .lesson-type-divider {
    margin-top: 0;
}

.lesson-content-modern .lesson-section-html img,
.lesson-content-modern .lesson-section-html svg,
.lesson-content-modern .lesson-section-html video,
.lesson-content-modern .lesson-section-html canvas,
.lesson-content-modern .lesson-section-html iframe,
.lesson-content-modern .lesson-section-html object,
.lesson-content-modern .lesson-section-html picture,
.lesson-content-modern .lesson-section-html figure {
    max-width: 100% !important;
    height: auto !important;
}

/* Safari draws a large bordered "?" frame for a missing image that has a width.
   Chrome collapses the same image, so hide the broken frame in both. */
.lesson-content-modern .lesson-section-html img.is-broken,
#fullscreen-content-display img.is-broken {
    display: none !important;
}

.lesson-content-modern .lesson-section-html picture img {
    max-width: 100% !important;
    height: auto !important;
}

/* Preserve CKEditor-authored table rendering: keep native table layout (so
   columns line up + per-cell borders show like the editor), honour any
   author-set width/border attributes, and let the .lesson-section-html
   wrapper handle horizontal scrolling for tables wider than the viewport.
   We explicitly opt out of the .section-content * { max-width:100% } cap
   below — otherwise the author's intended width is clamped. */
.lesson-content-modern .lesson-section-html table {
    display: table;
    width: auto;
    max-width: none;
    border-collapse: collapse;
}

.lesson-content-modern .section-content-fullscreen img,
.lesson-content-modern .section-content-fullscreen svg,
.lesson-content-modern .section-content-fullscreen video,
.lesson-content-modern .section-content-fullscreen canvas,
.lesson-content-modern .section-content-fullscreen iframe,
.lesson-content-modern .section-content-fullscreen object,
.lesson-content-modern .section-content-fullscreen picture,
.lesson-content-modern .section-content-fullscreen figure {
    max-width: 100% !important;
    height: auto !important;
}

.lesson-content-modern .section-content-fullscreen picture img {
    max-width: 100% !important;
    height: auto !important;
}

/* Lesson tab & fullscreen reader: no forced Monokai/hljs theme — use stored HTML + site hljs/CSS (modals below keep themed code) */

/* Apply same colors to modal/popup containers */
.modal-body pre code.hljs .hljs-keyword,
.modal-body pre code.hljs .hljs-selector-tag,
.modal-body pre code.hljs .hljs-literal,
.modal-body pre code.hljs .hljs-title,
.modal-body pre code.hljs .hljs-section,
.modal-body pre code.hljs .hljs-doctag,
.modal-body pre code.hljs .hljs-type,
.modal-body pre code.hljs .hljs-name,
.modal-body pre code.hljs .hljs-strong,
.modal-body code.hljs .hljs-keyword,
.modal-body code.hljs .hljs-selector-tag,
.modal-body code.hljs .hljs-literal,
.modal-body code.hljs .hljs-title,
.modal-body code.hljs .hljs-section,
.modal-body code.hljs .hljs-doctag,
.modal-body code.hljs .hljs-type,
.modal-body code.hljs .hljs-name,
.modal-body code.hljs .hljs-strong {
    color: #f92672 !important; /* Pink for keywords */
}

.modal-body pre code.hljs .hljs-string,
.modal-body pre code.hljs .hljs-attr,
.modal-body pre code.hljs .hljs-symbol,
.modal-body pre code.hljs .hljs-bullet,
.modal-body pre code.hljs .hljs-addition,
.modal-body code.hljs .hljs-string,
.modal-body code.hljs .hljs-attr,
.modal-body code.hljs .hljs-symbol,
.modal-body code.hljs .hljs-bullet,
.modal-body code.hljs .hljs-addition {
    color: #e6db74 !important; /* Yellow for strings */
}

.modal-body pre code.hljs .hljs-comment,
.modal-body pre code.hljs .hljs-quote,
.modal-body pre code.hljs .hljs-deletion,
.modal-body pre code.hljs .hljs-meta,
.modal-body code.hljs .hljs-comment,
.modal-body code.hljs .hljs-quote,
.modal-body code.hljs .hljs-deletion,
.modal-body code.hljs .hljs-meta {
    color: #75715e !important; /* Gray for comments */
}

.modal-body pre code.hljs .hljs-number,
.modal-body pre code.hljs .hljs-regexp,
.modal-body pre code.hljs .hljs-link,
.modal-body code.hljs .hljs-number,
.modal-body code.hljs .hljs-regexp,
.modal-body code.hljs .hljs-link {
    color: #ae81ff !important; /* Purple for numbers */
}

.modal-body pre code.hljs .hljs-function,
.modal-body pre code.hljs .hljs-built_in,
.modal-body pre code.hljs .hljs-class .hljs-title,
.modal-body code.hljs .hljs-function,
.modal-body code.hljs .hljs-built_in,
.modal-body code.hljs .hljs-class .hljs-title {
    color: #66d9ef !important; /* Cyan for functions */
}

.modal-body pre code.hljs .hljs-variable,
.modal-body code.hljs .hljs-variable {
    color: #fd971f !important; /* Orange for variables */
}

.modal-body pre code.hljs .hljs-title,
.modal-body code.hljs .hljs-title {
    color: #a6e22e !important; /* Green for titles */
}

/* Default white color for modal code blocks */
.modal-body pre code.hljs,
.modal-body code.hljs {
    background: #272822 !important;
    color: #f8f8f2 !important; /* Default white/light color */
}

.modal-body pre {
    background: #272822 !important;
    border-radius: 4px;
    padding: 0;
    margin: 1em 0;
    overflow-x: auto;
    position: relative;
    color: #f8f8f2 !important; /* Default white/light color */
}

.modal-body pre code {
    background: transparent !important;
    padding: 0;
    color: #f8f8f2 !important; /* Default white/light color */
}

/* Ensure all text in modal code blocks defaults to white, but exclude hljs spans (they have their own colors) */
.modal-body pre code.hljs,
.modal-body code.hljs {
    color: #f8f8f2 !important; /* Default white/light color for base code block */
}

/* Default white for text nodes and non-hljs elements in modals */
.modal-body pre code.hljs > *:not([class*="hljs-"]),
.modal-body code.hljs > *:not([class*="hljs-"]) {
    color: #f8f8f2 !important;
}

/* Ensure all direct text content in modal code blocks is white - override global modal-body color */
.modal-body pre,
.modal-body pre *:not([class*="hljs-"]),
.modal-body pre code,
.modal-body pre code *:not([class*="hljs-"]) {
    color: #f8f8f2 !important;
}

/* Override global modal-body black text color for code blocks - must be very specific */
.modal-body pre code.hljs,
.modal-body pre code.hljs *,
.modal-body code.hljs,
.modal-body code.hljs *,
.modal-body pre code,
.modal-body pre code *,
.modal-body pre,
.modal-body pre * {
    color: #f8f8f2 !important; /* Force white - override global black text */
}

/* Additional override with even higher specificity to beat front.css */
.modal .modal-body pre code.hljs,
.modal .modal-body pre code.hljs *,
.modal .modal-body code.hljs,
.modal .modal-body code.hljs *,
.modal .modal-body pre code,
.modal .modal-body pre code *,
.modal .modal-body pre,
.modal .modal-body pre * {
    color: #f8f8f2 !important; /* Force white - override global black text */
}

/* But let hljs spans keep their colors - these rules have higher specificity */
.modal-body pre code.hljs span[class*="hljs-"],
.modal-body code.hljs span[class*="hljs-"],
.modal .modal-body pre code.hljs span[class*="hljs-"],
.modal .modal-body code.hljs span[class*="hljs-"] {
    /* Colors are set by the specific hljs rules above - they override this */
}

/* But let hljs spans keep their colors */
.modal-body pre code.hljs span[class*="hljs-"],
.modal-body code.hljs span[class*="hljs-"] {
    /* Colors are set by the specific hljs rules above */
}

.section-content.expanded {
    max-height: none;
    padding: 12px 0 4px;
    margin: 0;
    opacity: 1;
    overflow-x: auto;
    overflow-y: visible;
    visibility: visible;
    min-width: 0;
}

/* Stack lesson HTML + rating: keep rating directly under content (no forced tall section). */
.lesson-content-modern .section-content.expanded {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.lesson-content-modern .section-content.expanded .section-lesson-body {
    flex: 0 1 auto;
    min-width: 0;
}

.section-lesson-body::after {
    content: "";
    display: table;
    clear: both;
}

@media (max-width: 576px) {
    .lesson-content-modern .section-content.expanded {
        min-height: 0;
    }
}

/* Ensure inline-colored text in expanded sections is never overridden */
.lesson-content-modern .section-content.expanded [style*="color"] {
    opacity: 1 !important;
    visibility: visible !important;
}

.lesson-section:last-child {
    border-bottom: none;
}

/* Lesson reader toolbar — unified + / − / A / dark / fullscreen */
.lesson-controls,
.lesson-reader-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lesson-controls .btn:hover,
.fullscreen-controls .btn:hover {
    transform: none;
    box-shadow: none;
}

.lesson-reader-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d7e3ee;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.lesson-reader-btn,
.lesson-reader-toolbar .font-control-btn,
.lesson-reader-toolbar .dark-mode-toggle-btn,
.lesson-reader-toolbar .fullscreen-toggle-btn,
.lesson-reader-toolbar .close-fullscreen-btn,
.fullscreen-controls .font-control-btn,
.fullscreen-controls .dark-mode-toggle-btn,
.fullscreen-controls .close-fullscreen-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 32px;
    margin: 0;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #334155 !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1;
    transform: none !important;
    cursor: pointer;
}

.lesson-reader-group .lesson-reader-btn + .lesson-reader-btn,
.lesson-reader-group .font-control-btn + .font-control-btn {
    border-left: 1px solid #d7e3ee !important;
}

.lesson-reader-btn:hover,
.lesson-reader-toolbar .font-control-btn:hover,
.lesson-reader-toolbar .dark-mode-toggle-btn:hover,
.lesson-reader-toolbar .fullscreen-toggle-btn:hover,
.fullscreen-controls .font-control-btn:hover,
.fullscreen-controls .dark-mode-toggle-btn:hover {
    background: #f0f7fc !important;
    color: #1586c3 !important;
}

.lesson-reader-btn:focus-visible {
    outline: 2px solid #51b5eb;
    outline-offset: -2px;
    z-index: 1;
}

.lesson-reader-a {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.lesson-reader-toolbar .close-fullscreen-btn,
.fullscreen-controls .close-fullscreen-btn {
    color: #b42318 !important;
}

.lesson-reader-toolbar .close-fullscreen-btn:hover,
.fullscreen-controls .close-fullscreen-btn:hover {
    background: #fef2f2 !important;
    color: #912018 !important;
}

.decrease-btn,
.reset-btn,
.increase-btn {
    background: #fff !important;
    color: #334155 !important;
}

.decrease-btn:hover,
.reset-btn:hover,
.increase-btn:hover {
    background: #f0f7fc !important;
    color: #1586c3 !important;
    box-shadow: none !important;
    transform: none !important;
}

.font-size-controls {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
}

.font-control-btn i,
.dark-mode-toggle-btn i,
.fullscreen-toggle-btn i,
.close-fullscreen-btn i {
    font-size: 12px !important;
}

.fullscreen-toggle-btn {
    background: #fff !important;
    color: #334155 !important;
}

.fullscreen-toggle-btn:hover {
    background: #f0f7fc !important;
    color: #1586c3 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Text Size Controls */
.lesson-content-modern.font-small .section-content {
    font-size: 0.75rem;
    line-height: 1.3;
    font-weight: 400;
}

.lesson-content-modern.font-small .section-header {
    font-size: 0.85rem;
    font-weight: 600;
}

.lesson-content-modern.font-normal .section-content {
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 500;
}

.lesson-content-modern.font-normal .section-header {
    font-size: 0.95rem;
    font-weight: 700;
}

.lesson-content-modern.font-large .section-content {
    font-size: 1.4rem;
    line-height: 1.7;
    font-weight: 600;
}

.lesson-content-modern.font-large .section-header {
    font-size: 1.1rem;
    font-weight: 800;
}

.lesson-content-modern.font-extra-large .section-content {
    font-size: 1.8rem;
    line-height: 1.8;
    font-weight: 700;
}

.lesson-content-modern.font-extra-large .section-header {
    font-size: 1.3rem;
    font-weight: 900;
}

/* Fullscreen text size controls */
.lesson-content-modern.font-small .fullscreen-main .section-content-fullscreen {
    font-size: 0.75rem;
    line-height: 1.3;
    font-weight: 400;
}

.lesson-content-modern.font-small .fullscreen-main h3 {
    font-size: 1rem;
    font-weight: 600;
}

.lesson-content-modern.font-normal .fullscreen-main .section-content-fullscreen {
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 500;
}

.lesson-content-modern.font-normal .fullscreen-main h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.lesson-content-modern.font-large .fullscreen-main .section-content-fullscreen {
    font-size: 1.4rem;
    line-height: 1.7;
    font-weight: 600;
}

.lesson-content-modern.font-large .fullscreen-main h3 {
    font-size: 1.6rem;
    font-weight: 800;
}

.lesson-content-modern.font-extra-large .fullscreen-main .section-content-fullscreen {
    font-size: 1.8rem;
    line-height: 1.8;
    font-weight: 700;
}

.lesson-content-modern.font-extra-large .fullscreen-main h3 {
    font-size: 2rem;
    font-weight: 900;
}




.fullscreen-header {
    position: relative;
    background: #ffffff;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: minmax(110px, auto) 1fr minmax(110px, auto);
    align-items: center;
    column-gap: 12px;
    flex-shrink: 0;
    min-height: 60px;
}

.fullscreen-header-side {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.fullscreen-header-side--prev {
    justify-content: flex-start;
}

.fullscreen-header-side--next {
    justify-content: flex-end;
}

.fullscreen-mile-title {
    margin: 0;
    color: #51B5EB;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
    text-align: center;
    justify-self: center;
    grid-column: 2;
}

.fullscreen-mile-nav-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.fullscreen-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .fullscreen-mile-nav-label {
        display: none;
    }
    .fullscreen-header {
        grid-template-columns: auto 1fr auto;
        padding: 10px 12px;
        row-gap: 8px;
    }
    .fullscreen-header-side--next {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .fullscreen-controls {
        width: 100%;
        justify-content: center;
        order: 3;
        grid-column: 1 / -1;
    }
}

/* Fullscreen overlay styles */
#fullscreen-overlay {
    font-family: inherit;
}

/* Hover effects for section items */
.fullscreen-section-item:hover:not(.active) {
    background: #f8f9fa !important;
}

/* Font size control buttons — inherit reader toolbar chrome */
.font-size-controls {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
}

.font-control-btn:first-child,
.font-control-btn:last-child {
    border-radius: 0;
}

/* Close button styling */
.close-fullscreen-btn i {
    font-size: 12px !important;
}

/* Documents Button Styling - Student Dashboard Colors */
.btn-modern-documents {
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(82, 182, 236, 0.3);
    position: relative;
    overflow: hidden;
}

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

.btn-modern-documents:hover::before {
    left: 100%;
}

.btn-modern-documents:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(82, 182, 236, 0.4);
    background: linear-gradient(135deg, #1586c3 0%, #0d5a8a 100%);
}

.btn-modern-documents:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(82, 182, 236, 0.3);
}

.btn-modern-documents i {
    margin-right: 8px;
}

/* Font size controls */
#fullscreen-overlay.font-small #fullscreen-content-display {
    font-size: 0.75rem !important;
    line-height: 1.3 !important;
}

#fullscreen-overlay.font-normal #fullscreen-content-display {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

#fullscreen-overlay.font-large #fullscreen-content-display {
    font-size: 1.4rem !important;
    line-height: 1.7 !important;
}

#fullscreen-overlay.font-extra-large #fullscreen-content-display {
    font-size: 1.8rem !important;
    line-height: 1.8 !important;
}

.fullscreen-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fullscreen-controls .btn:hover {
    transform: none;
    box-shadow: none;
}

/* Fullscreen content overflow safety (scoped to authored lesson HTML only) */
#fullscreen-content-display .lesson-section-html {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#fullscreen-content-display .lesson-section-html img,
#fullscreen-content-display .lesson-section-html svg,
#fullscreen-content-display .lesson-section-html video,
#fullscreen-content-display .lesson-section-html canvas,
#fullscreen-content-display .lesson-section-html iframe,
#fullscreen-content-display .lesson-section-html object,
#fullscreen-content-display .lesson-section-html picture,
#fullscreen-content-display .lesson-section-html figure {
    max-width: 100% !important;
    height: auto !important;
}

#fullscreen-content-display .lesson-section-html picture img {
    max-width: 100% !important;
    height: auto !important;
}

/* Same rule as inline lesson view: keep native table layout so columns
   align and the author's width is preserved. The #fullscreen-content-display
   container scrolls if the table is wider than the reader pane. */
#fullscreen-content-display .lesson-section-html table {
    display: table;
    width: auto;
    max-width: none;
    border-collapse: collapse;
}

#fullscreen-content-display pre {
    overflow-x: auto !important;
}

/* Mobile-friendly fullscreen lesson view */
@media (max-width: 768px) {
    #fullscreen-overlay .fullscreen-header {
        padding: 10px 12px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    #fullscreen-overlay .fullscreen-header h4 {
        font-size: 0.95rem !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        width: 100%;
    }

    #fullscreen-overlay .fullscreen-controls {
        width: 100% !important;
        justify-content: flex-end !important;
        gap: 6px !important;
    }

    #fullscreen-overlay .fullscreen-controls .btn {
        padding: 6px 8px !important;
        font-size: 12px !important;
    }

    #fullscreen-overlay .font-size-controls {
        margin-right: 4px !important;
    }

    #fullscreen-overlay .fullscreen-sections-toggle-btn {
        display: inline-flex !important;
        align-items: center;
        gap: 4px;
    }

    #fullscreen-overlay .fullscreen-body-wrapper {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    #fullscreen-overlay .fullscreen-sidebar {
        width: 100% !important;
        max-height: 34vh !important;
        border-right: none !important;
        border-bottom: 1px solid #dee2e6 !important;
    }

    #fullscreen-overlay.mobile-sections-collapsed .fullscreen-sidebar {
        display: none !important;
    }

    #fullscreen-overlay .fullscreen-main {
        padding: 12px !important;
        min-height: 0 !important;
        height: auto !important;
    }

    #fullscreen-overlay #fullscreen-content-display {
        padding: 12px !important;
        border-radius: 8px !important;
    }

    #fullscreen-overlay .fullscreen-section-item {
        padding: 10px 12px !important;
    }
}

.fullscreen-close {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-close:hover {
    background: #c82333;
    transform: scale(1.1);
}


.fullscreen-sidebar {
    width: 300px;
    background: #ffffff;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
    flex-shrink: 0;
}

.fullscreen-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px;
    background: #ffffff;
    min-height: 100vh !important;
    width: 100% !important;
    height: 100% !important;
}

#fullscreen-content-display {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 300px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    padding: 20px;
    display: flex !important;
    flex-direction: column;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 99999 !important;
    position: relative;
    box-sizing: border-box;
}

#fullscreen-content-display .section-lesson-body {
    flex: 1 1 auto;
    min-width: 0;
}

#fullscreen-content-display .section-rating-container {
    margin-top: auto;
    flex-shrink: 0;
}


#fullscreen-content-display .section-content {
    background: transparent;
    border: none;
    padding: 15px 0;
    margin: 0;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    min-width: 0;
}

/* Rating row uses Bootstrap d-flex — block rule above breaks it; keep label + stars on one row */
#fullscreen-content-display .section-rating-container .d-flex {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
}

#fullscreen-content-display .section-rating-container .rating-label {
    margin-bottom: 0 !important;
    flex-shrink: 0;
}

#fullscreen-content-display .section-rating-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    width: auto !important;
    max-width: 100%;
    margin-top: 0 !important;
}

#fullscreen-content-display .star-rating {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
}


.fullscreen-section-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-section-item:hover {
    background-color: #f8f9fa;
}

.fullscreen-section-item.active {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    font-weight: 600;
}

.fullscreen-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 14px 12px;
    border-bottom: 2px solid #51B5EB;
    margin-bottom: 0;
}

.fullscreen-sidebar-title {
    margin: 0;
    font-size: 1.1rem;
    color: #51B5EB;
    font-weight: 600;
    line-height: 1.3;
}

.fullscreen-sidebar-collapse-btn {
    flex-shrink: 0;
    padding: 4px 8px !important;
    line-height: 1 !important;
}

.fullscreen-section-num {
    flex-shrink: 0;
    min-width: 1.75em;
    font-weight: 700;
    color: #51B5EB;
    line-height: 1.35;
}

.fullscreen-section-item.active .fullscreen-section-num {
    color: #1565c0;
}

.fullscreen-section-label {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    line-height: 1.35;
}

.fullscreen-section-label strong {
    font-weight: 600;
}

/* Desktop: collapse sidebar to section numbers only */
@media (min-width: 769px) {
    .fullscreen-sidebar {
        transition: width 0.25s ease;
    }

    #fullscreen-overlay.sidebar-collapsed .fullscreen-sidebar {
        width: 56px !important;
    }

    #fullscreen-overlay.sidebar-collapsed .fullscreen-sidebar-header {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 12px 8px;
        gap: 6px;
    }

    #fullscreen-overlay.sidebar-collapsed .fullscreen-sidebar-title {
        display: none;
    }

    #fullscreen-overlay.sidebar-collapsed .fullscreen-section-label {
        display: none !important;
    }

    #fullscreen-overlay.sidebar-collapsed .fullscreen-section-item {
        justify-content: center;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    #fullscreen-overlay.sidebar-collapsed .fullscreen-section-num {
        min-width: 0;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .fullscreen-sidebar-collapse-btn {
        display: none !important;
    }
}

.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    z-index: 99998;
    display: none;
}

/* Comments Section */
.comments-section-modern {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(20, 35, 46, 0.08);
    padding: 16px;
}

.comment-item {
    border-bottom: 1px solid #e9ecef;
    padding: 15px 0;
    display: block;
    width: 100%;
}

.comment-item:last-child {
    border-bottom: none;
}

.comments-list {
    margin-top: 20px;
}

.comments-list .comment-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.comments-list .comment-item:last-child {
    margin-bottom: 0;
}

/* Assignment/Exam Status */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.passed {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}

.status-badge.failed {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

.status-badge.pending {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
}

.status-badge.not-attempted {
    background: linear-gradient(135deg, #e2e3e5, #d6d8db);
    color: #383d41;
}

/* Module Status Indicators */
.module-status-badges {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    padding: 0 6px;
    gap: 4px;
}

.status-indicator:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.status-indicator i {
    font-size: 14px;
}

.status-label {
    font-size: 10px;
    font-weight: 600;
    color: #000000;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status indicator colors */
.status-indicator .text-success {
    color: #28a745 !important;
}

.status-indicator .text-danger {
    color: #dc3545 !important;
}

.status-indicator .text-warning {
    color: #ffc107 !important;
}

.status-indicator .text-info {
    color: #17a2b8 !important;
}

/* Teacher: mark-complete control in mile list (same slot as Assign/Exam) */
a.teacher-mile-complete-btn {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    padding: 0 6px;
    min-width: auto;
}
a.teacher-mile-complete-btn:hover {
    text-decoration: none;
}
a.teacher-mile-complete-btn--todo {
    background: rgba(40, 167, 69, 0.12);
}
a.teacher-mile-complete-btn--todo:hover {
    background: rgba(40, 167, 69, 0.22);
}
a.teacher-mile-complete-btn--done {
    background: rgba(40, 167, 69, 0.18);
}

/* Inline Status Legend */
.legend-inline {
    font-size: 14px;
    font-weight: normal;
    color: #000000;
    margin-left: 8px;
}

.legend-inline i {
    margin-right: 4px;
    margin-left: 8px;
}

/* Assignment and Exam Items */
.assignment-list, .exam-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.assignment-item, .exam-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.assignment-item:hover, .exam-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.assignment-header, .exam-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.assignment-title, .exam-title {
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

.assignment-meta, .exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.assignment-description, .exam-description {
    margin-bottom: 15px;
    color: #000000;
    line-height: 1.6;
}

.assignment-actions, .exam-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.assignment-actions .btn, .exam-actions .btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.assignment-actions .btn:hover, .exam-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Assignment and Exam Tables - Matching Exam Results Page */
.assignment-history-table, .exam-history-table, .assignment-available-table, .exam-available-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
}

.assignment-history-table thead th, .exam-history-table thead th, .assignment-available-table thead th, .exam-available-table thead th {
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border: none;
    padding: 15px 12px;
}

.assignment-history-table tbody tr, .exam-history-table tbody tr, .assignment-available-table tbody tr, .exam-available-table tbody tr {
    border: none;
    transition: all 0.3s ease;
}

.assignment-history-table tbody tr:hover, .exam-history-table tbody tr:hover, .assignment-available-table tbody tr:hover, .exam-available-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.assignment-history-table tbody td, .exam-history-table tbody td, .assignment-available-table tbody td, .exam-available-table tbody td {
    padding: 15px 12px;
    vertical-align: middle;
    border: none;
    border-bottom: 1px solid #f8f9fa;
}

/* Table Row Status Colors */
.table-success-light {
    background: rgba(40, 167, 69, 0.05);
}

.table-success-light:hover {
    background: rgba(40, 167, 69, 0.1);
}

.table-danger-light {
    background: rgba(220, 53, 69, 0.05);
}

.table-danger-light:hover {
    background: rgba(220, 53, 69, 0.1);
}

.table-warning-light {
    background: rgba(255, 193, 7, 0.05);
}

.table-warning-light:hover {
    background: rgba(255, 193, 7, 0.1);
}

.table-secondary {
    background: rgba(108, 117, 125, 0.05);
}

.table-secondary:hover {
    background: rgba(108, 117, 125, 0.1);
}

.table-info-light {
    background: rgba(23, 162, 184, 0.05);
}

.table-info-light:hover {
    background: rgba(23, 162, 184, 0.1);
}

/* Score Badges */
.score-badge-assignment, .score-badge-exam {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    position: relative;
}

.score-badge-assignment:hover, .score-badge-exam:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.score-excellent {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.score-good {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
}

.score-poor {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
}

/* Icons */
.assignment-icon, .exam-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #52b6ec 0%, #1586c3 100%);
    color: white;
    font-size: 14px;
}

/* Button Styling */
.btn-group-sm .btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-group-sm .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}


/* Progress Indicators */
.progress-modern {
    height: 8px;
    border-radius: 10px;
    background: #e9ecef;
    overflow: hidden;
}

.progress-bar-modern {
    height: 100%;
    background: linear-gradient(135deg, #52b6ec, #1586c3);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .module-hero-section {
        margin-bottom: 15px;
        padding: 15px !important;
    }
    
    .hero-course-title {
        font-size: 1.3rem;
    }
    
    .hero-book-icon {
        font-size: 1.1rem;
    }
    
    .hero-badge {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .learning-progress-card {
        padding: 15px 12px;
    }
    
    .progress-icon {
        font-size: 2rem;
    }
    
    .progress-ring {
        width: 60px;
        height: 60px;
    }
    
    .progress-ring-fill {
        width: 60px;
        height: 60px;
    }
    
    .course-details-panel {
        position: static;
        margin-bottom: 20px;
    }
    
    .course-image-container {
        height: 150px;
    }
    
    .course-stats {
        flex-direction: row;
        gap: 8px;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    .stat-item {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 6px 0;
        border-bottom: none;
        border-right: 1px solid #f8f9fa;
        flex: 1 1 0;
    }
    
    .stat-item:last-child {
        border-right: none;
    }
    
    .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 1.05rem;
    }
    
    .stat-label {
        display: none !important; /* show icon + count only on mobile */
        font-size: 0.65rem;
    }
    
    .module-list-item {
        margin-bottom: 6px;
    }
    
    .module-separator {
        margin: 8px 15px;
    }
    
    .module-list-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        text-align: left;
    }
    
    .module-list-item .module-status-icon {
        margin-bottom: 0;
        margin-right: 0 !important;
        align-self: center;
    }
    
    .module-list-item .ms-2 {
        margin-left: 0 !important;
        margin-top: 8px;
    }
    
    .module-list-item .d-flex {
        padding: 5px 8px !important;
    }

    /* Reduce empty space in mobile mile cards */
    .module-list-item .d-flex {
        padding: 5px 8px !important;
    }

    .module-list-item h5.mb-1 {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        line-height: 1.1;
        font-size: 0.98rem;
    }

    .module-list-item .flex-grow-1 {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .module-list-item p.text-muted.small,
    .module-list-item p.text-muted {
        margin-top: 2px !important;
        margin-bottom: 0 !important;
        line-height: 1.2 !important;
    }

    .module-list-item p.text-muted.small,
    .module-list-item p.text-muted {
        margin-bottom: 0 !important;
        font-size: 0.78rem;
        line-height: 1.25;
    }
    
    .content-tab-nav {
        flex-direction: row;
        overflow-x: hidden;
        overflow-y: hidden;
        flex-wrap: nowrap;
    }
    .module-status-badges {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start;
        gap: 6px !important;
        white-space: nowrap;
    }

    /* Option: on mobile, hide assignment/exam icons entirely */
    .module-status-badges {
        display: none !important;
    }

    .module-status-badges .status-indicator {
        display: inline-flex !important;
        flex: 0 0 auto;
        min-width: 0 !important;
        width: auto !important;
        white-space: nowrap;
    }

    /* Hide the main status icon before each mile (check/clock/play) */
    .module-status-icon {
        display: none !important;
    }
    
    .module-title-display {
        font-size: 20px;
    }
    
    .module-name-display {
        padding: 8px 12px;
        margin-bottom: 6px;
    }
    
    .module-description-display {
        font-size: 13px;
    }
    
    .learning-progress-card {
        padding: 20px 15px;
        margin-top: 20px;
    }
    
    .progress-icon {
        font-size: 2.5rem;
    }
    
    .progress-ring {
        width: 70px;
        height: 70px;
    }
    
    .progress-ring-fill {
        width: 70px;
        height: 70px;
    }
    
    .progress-title {
        font-size: 1.1rem;
    }
    
    .progress-stats {
        gap: 10px;
    }
    
    .progress-stats .stat-number {
        font-size: 1.5rem;
    }
    
    .hero-stat-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        margin-right: 8px;
    }
    
    .progress-stats .stat-item {
        justify-content: flex-start;
    }
}

/* #videoModal styles: css/partials/course_video_modal.css (loaded with partials/course_video_modal_player) */

/* =============================================================================
   Guest preview only — kill phantom vertical whitespace
   (flex:1 + margin-top:auto on stats; mile list flex-grow; lesson min-heights;
   must live at EOF in this file so rules beat earlier !important pairs.)
   ============================================================================= */
.course-summary-wrap--guest .course-summary-row .course-details-panel,
.course-summary-wrap--guest .course-summary-row .module-list-section {
    height: auto !important;
    min-height: 0 !important;
}

.course-summary-wrap--guest .module-list-section {
    justify-content: flex-start !important;
}

.course-summary-wrap--guest .module-list-container {
    flex: 0 1 auto !important;
}

.course-summary-wrap--guest .course-details-panel {
    min-height: 0 !important;
    position: static !important;
}

/* Left card: stats were pushed to bottom of a flex-growing .course-info → huge empty band */
.course-summary-wrap--guest .course-info {
    flex: 0 1 auto !important;
}

.course-summary-wrap--guest .course-stats {
    margin-top: 0 !important;
}

.course-summary-wrap--guest .lesson-content-modern .section-content.expanded {
    min-height: 0 !important;
}

@media (max-width: 576px) {
    .course-summary-wrap--guest .lesson-content-modern .section-content.expanded {
        min-height: 0 !important;
    }
}

.course-summary-wrap--guest .tab-content-modern {
    margin-top: 0;
    padding-top: 6px;
    padding-bottom: 0;
}

/* Guest: compact Prev / Current / Next level strip (less padding above, below, inside bar) */
.course-summary-wrap--guest .course-summary-level-theme-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.course-summary-wrap--guest .level-theme-bar {
    padding: 12px !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    gap: 12px !important;
}

.course-summary-wrap--guest .level-theme-bar .level-theme-center {
    padding: 4px 8px !important;
    font-size: 0.88rem;
}

.course-summary-wrap--guest .course-summary-top-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

@media (max-width: 768px) {
    .course-summary-wrap--guest .level-theme-bar {
        padding: 5px 6px !important;
        margin-bottom: 5px !important;
        gap: 5px !important;
    }
}

/* Course-program embed: start at the mile, without the site menu or course list. */
body.guest-preview-embed {
    padding-top: 0 !important;
}

body.guest-preview-embed .navbar,
body.guest-preview-embed .guest-top-navbar,
body.guest-preview-embed .flash-banner-bar,
body.guest-preview-embed .guest-footer-edu,
body.guest-preview-embed .guest-breadcrumb-bar,
body.guest-preview-embed .course-summary-level-theme-section,
body.guest-preview-embed .course-summary-top-section {
    display: none !important;
}

body.guest-preview-embed .guest-content-wrapper,
body.guest-preview-embed #main-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.guest-preview-embed .course-summary-module-header-section {
    margin-top: 0;
}

