/**
 * EduQuest 5º Ano - Core App & Portal Styles
 *
 * @package EduQuest
 */

/* ==========================================================================
   1. CSS VARIABLES & DESIGN SYSTEM
   ========================================================================== */
:root {
    --bg-page: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: #243048;
    --bg-card-hover: #2e3d5b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Theme colors */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-gold: #fbbf24;
    --color-gold-dark: #d97706;
    --color-emerald: #10b981;
    --color-rose: #f43f5e;
    --color-cyan: #06b6d4;
    --color-purple: #8b5cf6;

    /* Disciplinas */
    --subj-math: #0284c7;
    --subj-pt: #8b5cf6;
    --subj-sci: #10b981;
    --subj-hist: #f59e0b;
    --subj-geo: #06b6d4;

    /* Fonts */
    --font-heading: 'Fredoka', cursive, system-ui, sans-serif;
    --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-btn: 0 4px 0 rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

input, button, select, textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

/* Zero-leak protection: completely suppress WordPress admin bar and offsets for students */
html {
    margin-top: 0 !important;
}

body.is-student,
body.eduquest-portal-active {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.is-student #wpadminbar,
body.eduquest-portal-active #wpadminbar {
    display: none !important;
}

/* ==========================================================================
   3. PORTAL / LOGIN & REGISTRATION SCREEN (NON-LOGGED)
   ========================================================================== */
.edu-portal-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 100%);
}

.edu-portal-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.edu-portal-bg .shape {
    position: absolute;
    font-size: 42px;
    opacity: 0.18;
    animation: floatShape 8s ease-in-out infinite alternate;
}

.shape-1 { top: 10%; left: 8%; animation-delay: 0s; }
.shape-2 { top: 15%; right: 10%; animation-delay: 1.5s; }
.shape-3 { bottom: 15%; left: 12%; animation-delay: 3s; }
.shape-4 { bottom: 20%; right: 15%; animation-delay: 4.5s; }
.shape-5 { top: 50%; left: 4%; animation-delay: 2s; }
.shape-6 { top: 55%; right: 6%; animation-delay: 3.5s; }

@keyframes floatShape {
    0% { transform: translateY(0px) rotate(0deg) scale(1); }
    100% { transform: translateY(-25px) rotate(15deg) scale(1.1); }
}

.edu-portal-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    background: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    padding: 40px 36px;
}

.edu-portal-header {
    text-align: center;
    margin-bottom: 28px;
}

.edu-logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: #a5b4fc;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.edu-portal-title {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.edu-portal-title span {
    color: var(--color-gold);
}

.edu-portal-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 auto;
}

.edu-portal-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    padding: 6px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    gap: 6px;
}

.edu-tab-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-align: center;
}

.edu-tab-btn.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.edu-portal-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.edu-portal-alert.alert-error {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fda4af;
}

.edu-portal-alert.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.edu-auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 18px;
    pointer-events: none;
    opacity: 0.8;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 14px 14px 46px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-icon input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    outline: none;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.remember-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-checkbox input {
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
}

/* Avatar selection grid */
.avatar-selection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 4px;
}

.avatar-option {
    cursor: pointer;
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.avatar-box .av-emoji {
    font-size: 26px;
    margin-bottom: 4px;
}

.avatar-box .av-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.avatar-option:hover .avatar-box {
    background: rgba(255, 255, 255, 0.05);
}

.avatar-option.selected .avatar-box {
    border-color: var(--color-gold);
    background: rgba(251, 191, 36, 0.12);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
    transform: translateY(-2px);
}

.avatar-option.selected .av-name {
    color: var(--color-gold);
}

.edu-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-bottom: 4px solid #3730a3;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 10px;
}

.edu-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(79, 70, 229, 0.45);
}

.edu-btn-submit:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.edu-btn-submit.btn-register {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-bottom-color: #047857;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.35);
}

.edu-portal-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.feature-item .feat-icon {
    font-size: 24px;
}

.feature-item strong {
    display: block;
    font-size: 13px;
    color: #fff;
}

.feature-item span {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   4. APP LAYOUT (LOGGED IN USER)
   ========================================================================== */
.edu-app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-page);
}

/* Teacher Top Bar */
.edu-teacher-bar {
    background: #1e1b4b;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    padding: 8px 24px;
}

.teacher-bar-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.teacher-tag {
    font-size: 12px;
    font-weight: 800;
    color: #a5b4fc;
    letter-spacing: 0.5px;
}

.teacher-bar-actions {
    display: flex;
    gap: 10px;
}

.teacher-link {
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    background: var(--color-primary);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    transition: opacity 0.2s;
}

.teacher-link.secondary {
    background: rgba(255, 255, 255, 0.1);
}

.teacher-link:hover {
    opacity: 0.9;
}

/* Navbar */
.edu-navbar {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.edu-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.brand-mascot {
    font-size: 32px;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.5));
    animation: mascotHover 3s ease-in-out infinite alternate;
}

@keyframes mascotHover {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.brand-grade {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-gold);
    letter-spacing: 0.5px;
}

.edu-nav-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.5);
    padding: 4px;
    border-radius: var(--radius-md);
}

.nav-tab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
}

.nav-tab-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab-item.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Daily Timer Badge (1h target) */
.edu-timer-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.timer-icon {
    font-size: 18px;
    animation: tickPulse 1.5s infinite;
}

@keyframes tickPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.timer-details {
    display: flex;
    flex-direction: column;
}

.timer-val {
    font-size: 14px;
    font-weight: 800;
    color: #67e8f9;
    font-variant-numeric: tabular-nums;
}

.timer-sub {
    font-size: 10px;
    color: var(--text-muted);
}

/* Stars pill */
.edu-stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.pill-val {
    font-size: 15px;
    font-weight: 800;
    color: var(--color-gold);
}

.edu-icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    transition: background 0.2s;
}

.edu-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Student profile pill */
.student-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-light);
    padding: 4px 8px 4px 6px;
    border-radius: var(--radius-full);
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--av-theme, var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.profile-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.profile-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-days {
    font-size: 11px;
    color: var(--color-gold);
    font-weight: 600;
}

.logout-btn {
    background: rgba(244, 63, 94, 0.15);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-left: 4px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   5. MAIN CONTENT & VIEWS
   ========================================================================== */
.edu-main-content {
    flex: 1;
    max-width: 1260px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

.edu-view {
    display: none;
    animation: fadeInView 0.3s ease;
}

.edu-view.active {
    display: block;
}

@keyframes fadeInView {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 24px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 15px;
}

.subsection-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

/* ==========================================================================
   6. VIEW 1: TRILHA DOS 30 DIAS (MAPA)
   ========================================================================== */
/* Mission Today Featured Card */
.mission-today-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
    border: 1px solid rgba(165, 180, 252, 0.25);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 36px;
    box-shadow: 0 15px 30px -10px rgba(49, 46, 129, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.mission-today-left {
    flex: 1;
}

.mission-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: var(--color-gold);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
}

.mission-today-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.mission-today-sub {
    font-size: 15px;
    color: #c7d2fe;
    margin-bottom: 16px;
}

.mission-meta-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #e0e7ff;
}

.mission-meta-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-start-mission {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-bottom: 4px solid #b45309;
    color: #1e1b4b;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-start-mission:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.5);
}

.btn-start-mission:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

/* Week filter pills */
.trilha-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.week-filter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.week-pill {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    transition: all 0.2s;
}

.week-pill:hover {
    color: #fff;
    border-color: var(--border-light);
}

.week-pill.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Trilha Nodes Map Grid */
.trilha-map-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    position: relative;
}

.node-day-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    position: relative;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.node-day-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.node-day-card.status-unlocked {
    border-color: var(--color-primary);
    background: linear-gradient(180deg, #1e293b 0%, #243048 100%);
}

.node-day-card.status-current {
    border-color: var(--color-gold);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
    animation: currentPulse 2.5s infinite;
}

@keyframes currentPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(251, 191, 36, 0.2); }
    50% { box-shadow: 0 0 25px rgba(251, 191, 36, 0.45); }
}

.node-day-card.status-completed {
    border-color: rgba(16, 185, 129, 0.5);
}

.node-day-card.status-locked {
    opacity: 0.5;
    filter: grayscale(0.6);
    cursor: not-allowed;
}

.node-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.node-day-badge {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.node-subject-badge {
    font-size: 20px;
}

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

.node-subject-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.node-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 8px;
}

.node-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.node-stars {
    color: var(--color-gold);
    font-size: 14px;
    letter-spacing: 2px;
}

.node-action-btn {
    font-size: 12px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.node-day-card:hover .node-action-btn {
    background: var(--color-primary);
}

/* ==========================================================================
   7. VIEW 2: SALA DE ESTUDOS ATIVA (THEORY + GAME + QUIZ)
   ========================================================================== */
.classroom-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.class-header-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.class-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-back-trilha {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-back-trilha:hover {
    background: rgba(255, 255, 255, 0.16);
}

.class-title-group h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.class-title-group p {
    font-size: 14px;
    color: var(--text-secondary);
}

.class-steps-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
}

.step-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.step-tab-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.step-tab-btn.completed {
    color: var(--color-emerald);
}

/* Step 1: Teoria */
.theory-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.theory-intro-box {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--color-primary);
    padding: 16px 20px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 24px;
    font-size: 16px;
    color: #e0e7ff;
    line-height: 1.6;
}

.theory-steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.theory-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    font-size: 15px;
    color: #fff;
    line-height: 1.5;
}

.theory-tip-box {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: #fef08a;
    display: flex;
    align-items: center;
    gap: 12px;
}

.class-footer-nav {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-next-step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--color-primary);
    border-bottom: 4px solid #4338ca;
    color: #fff;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transition: all 0.2s;
}

.btn-next-step:hover {
    transform: translateY(-2px);
}

.btn-next-step:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

/* Step 3: Desafio Avaliativo / Quiz */
.quiz-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.quiz-progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.quiz-meter {
    flex: 1;
    max-width: 250px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 16px;
}

.quiz-meter-fill {
    height: 100%;
    background: var(--color-emerald);
    transition: width 0.3s ease;
}

.quiz-question-box {
    margin-bottom: 28px;
}

.quiz-q-text {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 20px;
}

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

.quiz-option-btn {
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.quiz-option-btn:hover {
    border-color: var(--color-primary);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.quiz-option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--color-gold);
}

.quiz-option-btn.selected-correct {
    border-color: var(--color-emerald);
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.quiz-option-btn.selected-wrong {
    border-color: var(--color-rose);
    background: rgba(244, 63, 94, 0.15);
    color: #fda4af;
}

.quiz-feedback-box {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    line-height: 1.5;
    animation: fadeIn 0.3s;
}

.quiz-feedback-box.correct {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
}

.quiz-feedback-box.wrong {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fecdd3;
}

/* Quiz Completion Modal / Screen */
.quiz-finish-card {
    text-align: center;
    padding: 40px 24px;
}

.finish-trophy-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounceTrophy 1s infinite alternate;
}

@keyframes bounceTrophy {
    0% { transform: scale(1); }
    100% { transform: scale(1.15) rotate(5deg); }
}

.finish-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.finish-stars-row {
    font-size: 36px;
    margin: 16px 0;
    letter-spacing: 8px;
    color: var(--color-gold);
}

.finish-score-pill {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
}

/* ==========================================================================
   8. VIEW 3: JOGOS HUB & MODAL
   ========================================================================== */
.games-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.game-hub-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: var(--border-light);
}

.hub-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.hub-tag {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-gold);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.game-hub-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.game-hub-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.edu-btn-play {
    width: 100%;
    padding: 12px;
    background: var(--color-primary);
    border-bottom: 3px solid #4338ca;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: all 0.15s;
}

.edu-btn-play:hover {
    background: var(--color-primary-hover);
}

/* Game Modal */
.edu-game-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
}

.game-modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.game-modal-header h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.btn-close-modal {
    font-size: 18px;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.game-modal-body {
    padding: 24px;
}

/* ==========================================================================
   9. VIEW 4: BOLETIM & EVOLUÇÃO
   ========================================================================== */
.progress-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.stat-overview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.stat-overview-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-overview-value {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin: 6px 0;
}

.stat-overview-sub {
    font-size: 13px;
    color: var(--text-muted);
}

.subject-mastery-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.mastery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.mastery-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
}

.mastery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mastery-subj-name {
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mastery-subj-pct {
    font-weight: 800;
    font-size: 16px;
    color: var(--color-gold);
}

.mastery-bar-bg {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
}

.mastery-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.history-table-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.history-table th {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    padding: 14px 20px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.history-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: #fff;
}

/* ==========================================================================
   10. VIEW 5: GALERIA DE BADGES
   ========================================================================== */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.badge-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: transform 0.2s;
}

.badge-card.unlocked {
    border-color: rgba(251, 191, 36, 0.4);
    background: linear-gradient(180deg, #1e293b 0%, #292842 100%);
}

.badge-card.locked {
    opacity: 0.45;
    filter: grayscale(0.8);
}

.badge-icon-box {
    font-size: 48px;
    margin-bottom: 12px;
}

.badge-card h4 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.badge-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.badge-status-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.badge-status-pill.unlocked {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.badge-status-pill.locked {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

/* ==========================================================================
   11. VIEW 6: RANKING AMIGO
   ========================================================================== */
.leaderboard-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 860px;
    margin: 0 auto;
}

.leaderboard-table-header {
    display: grid;
    grid-template-columns: 80px 1fr 140px 140px;
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 80px 1fr 140px 140px;
    padding: 16px 24px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
    color: #fff;
    transition: background 0.2s;
}

.leaderboard-row.is-me {
    background: rgba(99, 102, 241, 0.15);
    border-left: 4px solid var(--color-primary);
}

.leaderboard-rank {
    font-weight: 800;
    font-size: 18px;
    color: var(--color-gold);
}

.leaderboard-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.leaderboard-user .user-emoji {
    font-size: 24px;
}

/* Confetti Canvas */
.confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

/* ==========================================================================
   12. RESPONSIVENESS
   ========================================================================== */
@media (max-width: 900px) {
    .edu-navbar {
        flex-direction: column;
        gap: 14px;
        padding: 12px 16px;
    }

    .navbar-left {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .edu-nav-tabs {
        overflow-x: auto;
        max-width: 100%;
    }

    .navbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .mission-today-card {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-start-mission {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .edu-portal-card {
        padding: 28px 20px;
    }

    .avatar-selection-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .edu-portal-features {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .trilha-map-container {
        grid-template-columns: 1fr;
    }

    .leaderboard-table-header,
    .leaderboard-row {
        grid-template-columns: 50px 1fr 90px;
    }

    .leaderboard-table-header span:nth-child(3),
    .leaderboard-row span:nth-child(3) {
        display: none;
    }
}
