/* ================================================================
   INNOVALEAD FOUNDATION — Slideshow Presentation Engine
   PowerPoint-style in-browser lesson viewer
   ================================================================ */

/* ---- Lesson Page Layout ---- */
.lesson-page {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* ---- Top Bar ---- */
.lesson-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
}

.lesson-topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lesson-topbar-left a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.lesson-topbar-left a:hover {
    color: #fff;
}

.lesson-topbar-left .module-title {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.95rem;
}

.lesson-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.topbar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.topbar-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* ---- Main Content Area ---- */
.lesson-main {
    padding-top: 56px;
    display: flex;
    height: calc(100vh - 56px);
}

/* ---- Sidebar (Lesson List) ---- */
.lesson-sidebar {
    width: 300px;
    background: #1e293b;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.lesson-sidebar.collapsed {
    transform: translateX(-300px);
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.sidebar-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar-mini {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-mini .fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
}

.lesson-list {
    padding: 0.75rem 0;
}

.lesson-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.lesson-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.lesson-item.active {
    background: rgba(37, 99, 235, 0.12);
    border-left-color: #2563eb;
}

.lesson-item.completed .lesson-number {
    background: #22c55e;
    color: #fff;
}

.lesson-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

.lesson-item.active .lesson-number {
    background: #2563eb;
    color: #fff;
}

.lesson-item-info h4 {
    font-size: 0.88rem;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.lesson-item-info span {
    font-size: 0.72rem;
    color: #64748b;
}

/* ---- Presentation Area ---- */
.presentation-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* ---- Slide Container ---- */
.slide-container {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

.slide {
    position: absolute;
    inset: 0;
    padding: 3rem 3.5rem;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.slide.active {
    display: flex;
}

/* ---- Slide Types ---- */

/* Title Slide */
.slide.slide-title {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 40%, #3b82f6 100%);
    color: #fff;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.slide.slide-title .slide-icon {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
}

.slide.slide-title h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #fff;
    line-height: 1.2;
}

.slide.slide-title .slide-subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 600px;
}

.slide.slide-title .slide-meta {
    margin-top: 2rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

.slide.slide-title.accent-theme {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 40%, #a855f7 100%);
}

.slide.slide-title.green-theme {
    background: linear-gradient(135deg, #059669 0%, #10b981 40%, #34d399 100%);
}

.slide.slide-title.orange-theme {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 40%, #f97316 100%);
}

.slide.slide-title.dark-theme {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
}

/* Content Slide */
.slide.slide-content {
    background: #ffffff;
    color: #1e293b;
}

.slide.slide-content .slide-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #2563eb;
}

.slide.slide-content .slide-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
}

.slide.slide-content .slide-header .slide-tag {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.slide-body {
    flex: 1;
    display: flex;
    gap: 2rem;
}

.slide-body.single-column {
    flex-direction: column;
}

.slide-body .col {
    flex: 1;
}

/* Bullet Points */
.slide-bullets {
    list-style: none;
    padding: 0;
}

.slide-bullets li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #334155;
}

.slide-bullets li .bullet-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.slide-bullets.green li .bullet-icon {
    background: #ecfdf5;
    color: #059669;
}

.slide-bullets.orange li .bullet-icon {
    background: #fff7ed;
    color: #ea580c;
}

.slide-bullets.purple li .bullet-icon {
    background: #faf5ff;
    color: #7c3aed;
}

/* Info Box */
.slide-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-top: auto;
}

.slide-info-box.highlight {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.slide-info-box.warning {
    background: #fefce8;
    border-color: #fde68a;
}

.slide-info-box.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.slide-info-box h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.slide-info-box p {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
}

/* Stats Row */
.slide-stats {
    display: flex;
    gap: 1.25rem;
    margin-top: 1rem;
}

.slide-stat {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.slide-stat .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
}

.slide-stat .stat-label {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Diagram / Visual Cards */
.slide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.slide-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s;
}

.slide-card:hover {
    transform: translateY(-2px);
}

.slide-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.slide-card h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.slide-card p {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

/* Quote slide */
.slide.slide-quote {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.slide.slide-quote blockquote {
    font-size: 1.6rem;
    font-style: italic;
    line-height: 1.5;
    max-width: 700px;
    opacity: 0.95;
}

.slide.slide-quote cite {
    display: block;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    font-style: normal;
    opacity: 0.6;
}

/* Key Takeaway Slide */
.slide.slide-takeaway {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    justify-content: center;
}

.slide.slide-takeaway h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.slide.slide-takeaway .takeaway-list {
    list-style: none;
    padding: 0;
}

.slide.slide-takeaway .takeaway-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.4;
}

.slide.slide-takeaway .takeaway-list li .check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* Flow/Process Slide */
.slide-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.flow-step {
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-align: center;
    min-width: 140px;
}

.flow-step .step-num {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 28px;
    margin-bottom: 0.5rem;
}

.flow-step h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.2rem;
}

.flow-step p {
    font-size: 0.7rem;
    color: #64748b;
}

.flow-arrow {
    font-size: 1.5rem;
    color: #94a3b8;
}

/* ---- Slide Footer ---- */
.slide-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: #94a3b8;
    background: rgba(248, 250, 252, 0.9);
    border-top: 1px solid #e2e8f0;
}

.slide.slide-title .slide-footer,
.slide.slide-quote .slide-footer,
.slide.slide-takeaway .slide-footer {
    background: rgba(0, 0, 0, 0.15);
    border-top-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

/* ---- Navigation Controls ---- */
.slide-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.slide-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.slide-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.slide-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.slide-counter {
    font-size: 0.85rem;
    color: #94a3b8;
    min-width: 80px;
    text-align: center;
}

.slide-dots {
    display: flex;
    gap: 6px;
}

.slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s;
}

.slide-dot.active {
    background: #2563eb;
    transform: scale(1.3);
}

.slide-dot.visited {
    background: rgba(255, 255, 255, 0.35);
}

/* ---- Lesson Complete Banner ---- */
.lesson-complete-banner {
    display: none;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    max-width: 960px;
    width: 100%;
    animation: slideUp 0.4s ease;
}

.lesson-complete-banner.show {
    display: block;
}

.lesson-complete-banner h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.3rem;
}

.lesson-complete-banner p {
    font-size: 0.85rem;
    opacity: 0.85;
}

.lesson-complete-banner .next-lesson-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.lesson-complete-banner .next-lesson-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Fullscreen Mode ---- */
.lesson-page.fullscreen .lesson-sidebar {
    display: none;
}

.lesson-page.fullscreen .lesson-topbar {
    display: none;
}

.lesson-page.fullscreen .lesson-main {
    padding-top: 0;
    height: 100vh;
}

.lesson-page.fullscreen .slide-container {
    max-width: 100%;
    border-radius: 0;
    height: 100%;
    aspect-ratio: unset;
}

.lesson-page.fullscreen .presentation-area {
    padding: 0;
}

.lesson-page.fullscreen .slide-nav {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: rgba(15, 23, 42, 0.85);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    backdrop-filter: blur(8px);
}

/* ---- Ask Tutor Button ---- */
.ask-tutor-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.2s;
    font-family: inherit;
}

.ask-tutor-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(37, 99, 235, 0.5);
}

.ask-tutor-float .tutor-icon {
    font-size: 1.1rem;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .lesson-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        z-index: 90;
        transform: translateX(-100%);
    }

    .lesson-sidebar.mobile-open {
        transform: translateX(0);
    }

    .slide-container {
        aspect-ratio: unset;
        min-height: 400px;
        height: auto;
    }

    .slide {
        padding: 2rem;
    }

    .slide.slide-title h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 640px) {
    .presentation-area {
        padding: 1rem;
    }

    .slide {
        padding: 1.5rem;
    }

    .slide.slide-title h1 {
        font-size: 1.3rem;
    }

    .slide.slide-content .slide-header h2 {
        font-size: 1.2rem;
    }

    .slide-body {
        flex-direction: column;
        gap: 1rem;
    }

    .slide-bullets li {
        font-size: 0.82rem;
    }

    .slide-stats {
        flex-wrap: wrap;
    }

    .slide-stat {
        min-width: 100px;
    }

    .slide-cards {
        grid-template-columns: 1fr;
    }

    .slide-flow {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }
}