/* ===================================
   MODERN GAMIFIED LESSON UI
   =================================== */

/* Reset e Base */
.lesson-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #f3e8ff 100%);
}

/* ===================================
   HEADER FIXO COM PROGRESSO
   =================================== */

.lesson-header-fixed {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lesson-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
}

.lesson-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.btn-back-lesson {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-back-lesson:hover {
    color: #1e293b;
}

/* Header Actions (Timer + Continue Button) */
.lesson-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
}

.lesson-timer svg {
    width: 16px;
    height: 16px;
    color: #2563eb;
}

.lesson-timer span {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #1e40af;
}

.btn-continue-lesson {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-continue-lesson:hover {
    background: #16a34a;
    transform: scale(1.05);
}

.lesson-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.study-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #dbeafe;
    padding: 8px 16px;
    border-radius: 999px;
}

.study-timer svg {
    width: 16px;
    height: 16px;
    color: #2563eb;
}

.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #1e40af;
}

.btn-audio-toggle,
.btn-play-pause {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-audio-toggle:hover {
    background: #f1f5f9;
}

.btn-play-pause {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #22c55e;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.btn-play-pause:hover {
    background: #16a34a;
}

.btn-play-pause.paused {
    background: #f97316;
}

.btn-play-pause.paused:hover {
    background: #ea580c;
}

/* Barra de Progresso */
.lesson-progress-container {
    position: relative;
}

.lesson-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.lesson-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    transition: width 0.5s ease-out;
    border-radius: 999px;
}

.lesson-progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.progress-text {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.progress-percentage {
    font-size: 12px;
    font-weight: 700;
    color: #8b5cf6;
}

/* ===================================
   LAYOUT PRINCIPAL
   =================================== */

.lesson-main-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    gap: 24px;
}

/* ===================================
   SIDEBAR VERTICAL
   =================================== */

.lesson-sidebar-vertical {
    width: 280px;
    flex-shrink: 0;
}

.lesson-sidebar-sticky {
    position: sticky;
    top: 140px;
}

.lesson-info-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 2px solid #e9d5ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lesson-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lesson-trophy-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.lesson-info-text h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.lesson-info-text p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.lesson-ai-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
}

/* Steps Navigation */
.lesson-steps-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-step-item {
    position: relative;
    padding: 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lesson-step-item:hover:not(.locked) {
    transform: scale(1.02);
    border-color: #cbd5e1;
}

.lesson-step-item.current {
    background: #fef3c7;
    border-color: #fbbf24;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3);
    transform: scale(1.05);
}

.lesson-step-item.completed {
    background: #dcfce7;
    border-color: #86efac;
}

.lesson-step-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.lesson-step-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.lesson-step-item.completed .lesson-step-icon {
    background: #22c55e;
    color: white;
}

.lesson-step-item.current .lesson-step-icon {
    background: #f59e0b;
    color: white;
}

.lesson-step-item.locked .lesson-step-icon {
    background: #e2e8f0;
    color: #94a3b8;
}

.lesson-step-info {
    flex: 1;
}

.lesson-step-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.lesson-step-duration {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
}

/* ===================================
   ÁREA DE CONTEÚDO
   =================================== */

.lesson-content-main {
    flex: 1;
    min-width: 0;
}

/* Card de Introdução da Etapa */
.lesson-intro-card {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border-radius: 20px;
    padding: 32px;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.lesson-intro-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.lesson-intro-left {
    flex: 1;
}

.lesson-intro-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lesson-intro-title-row svg {
    width: 32px;
    height: 32px;
}

.lesson-intro-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.lesson-intro-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.lesson-intro-duration-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
}

.lesson-intro-duration-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}

.lesson-intro-duration-value {
    font-size: 24px;
    font-weight: 700;
}

/* ===================================
   BLOCOS DE CONTEÚDO
   =================================== */

.lesson-blocks-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

/* Stat Card (Frequência) */
.stat-card {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    border: 2px solid #fdba74;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.15);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 8px 24px rgba(251, 146, 60, 0.25);
    transform: translateY(-2px);
}

.stat-card-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-card-icon {
    width: 64px;
    height: 64px;
    background: #f97316;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.stat-card-body {
    flex: 1;
}

.stat-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #9a3412;
    margin: 0 0 12px 0;
}

.stat-card-value-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-card-value {
    font-size: 48px;
    font-weight: 900;
    color: #ea580c;
    line-height: 1;
}

.stat-card-description {
    font-size: 13px;
    color: #c2410c;
    padding-bottom: 8px;
}

.stat-card-badge {
    display: inline-block;
    background: #fed7aa;
    color: #9a3412;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

/* Why It Matters Card */
.why-matters-card {
    background: white;
    border: 2px solid #bfdbfe;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.why-matters-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.why-matters-header svg {
    width: 24px;
    height: 24px;
    color: #2563eb;
}

.why-matters-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

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

.why-matters-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #eff6ff;
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.why-matters-item:hover {
    background: #dbeafe;
    transform: translateX(4px);
}

.why-matters-item svg {
    width: 20px;
    height: 20px;
    color: #2563eb;
    flex-shrink: 0;
    margin-top: 2px;
}

.why-matters-item span {
    color: #334155;
    line-height: 1.6;
}

/* Impact Card */
.impact-card {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #6ee7b7;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.impact-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.impact-card-icon {
    width: 64px;
    height: 64px;
    background: #22c55e;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.impact-card-body {
    flex: 1;
}

.impact-card-label {
    font-size: 12px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 4px;
}

.impact-card-value {
    font-size: 32px;
    font-weight: 900;
    color: #15803d;
    margin-bottom: 4px;
}

.impact-card-message {
    font-size: 13px;
    color: #166534;
}

/* ===================================
   BOTÃO DE AÇÃO
   =================================== */

.lesson-action-button {
    width: 100%;
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
    transition: all 0.3s ease;
}

.lesson-action-button:hover {
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
    transform: scale(1.02);
}

.lesson-action-button svg {
    width: 24px;
    height: 24px;
}

/* ===================================
   CONFETE
   =================================== */

.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confetti-emoji {
    font-size: 80px;
    animation: confetti-bounce 1s ease-in-out;
}

@keyframes confetti-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* ===================================
   RESPONSIVIDADE
   =================================== */

/* ===================================
   QUIZ INTERACTIVE
   =================================== */

.quiz-container-modern {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 2px solid #e9d5ff;
}

.quiz-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #f3e8ff;
}

.quiz-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.quiz-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.quiz-question-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #8b5cf6;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.quiz-question {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.quiz-option {
    padding: 16px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #475569;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover:not(:disabled) {
    border-color: #8b5cf6;
    background: #faf5ff;
    transform: translateX(4px);
}

.quiz-option:active:not(:disabled) {
    transform: translateX(4px) scale(0.98);
}

.quiz-option.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #166534;
    font-weight: 600;
}

.quiz-option.correct::before {
    content: '✅ ';
}

.quiz-option.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    font-weight: 600;
}

.quiz-option.wrong::before {
    content: '❌ ';
}

.quiz-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-explanation {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 12px;
    border-left: 4px solid #22c55e;
    animation: slide-down 0.4s ease-out;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.explanation-correct {
    margin-bottom: 16px;
}

.explanation-correct strong {
    color: #166534;
    font-size: 16px;
}

.explanation-correct p {
    color: #15803d;
    margin: 8px 0 0 0;
    line-height: 1.6;
}

.explanation-wrong strong {
    color: #991b1b;
    font-size: 16px;
}

.explanation-wrong p {
    color: #b91c1c;
    margin: 8px 0 0 0;
    line-height: 1.6;
}

/* ===================================
   RESPONSIVIDADE
   =================================== */

@media (max-width: 1024px) {
    .lesson-main-layout {
        flex-direction: column;
    }

    .lesson-sidebar-vertical {
        width: 100%;
    }

    .lesson-sidebar-sticky {
        position: static;
    }

    .lesson-steps-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .lesson-step-item {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .lesson-header-content {
        padding: 12px 16px;
    }

    .lesson-main-layout {
        padding: 16px;
    }

    .lesson-intro-card {
        padding: 24px;
    }

    .lesson-intro-title {
        font-size: 24px;
    }

    .lesson-intro-description {
        font-size: 14px;
    }

    .stat-card-value {
        font-size: 36px;
    }

    .btn-play-pause span {
        display: none;
    }
}