﻿/* ==========================================================================
   WORD KIDS & CYBERLAB: SUITE INTERACTIVA DE COMPUTACIÓN
   1º PRIMARIA & 3º BÁSICO (CSS CORE SYSTEM)
   ========================================================================== */

:root {
    --primary-word: #2b579a;
    --primary-dark: #1b365d;
    --primary-g3: #4f46e5; /* Indigo para 3º Básico */
    --primary-g3-dark: #3730a3;
    
    --accent-gold: #ffb703;
    --accent-orange: #fb8500;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    
    --shadow-soft: 0 10px 25px rgba(43, 87, 154, 0.12);
    --shadow-hover: 0 15px 35px rgba(43, 87, 154, 0.22);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --font-ui: 'Nunito', 'Inter', 'Segoe UI', sans-serif;
    --font-heading: 'Fredoka', cursive, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-main);
    background-image: radial-gradient(#cbd5e0 1.5px, transparent 1.5px), radial-gradient(#cbd5e0 1.5px, #f0f4f8 1.5px);
    background-size: 60px 60px;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-x: hidden;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

.app-container {
    width: 100%;
    max-width: 1150px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 4px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   HEADER PRINCIPAL & SELECTOR DE GRADO
   -------------------------------------------------------------------------- */
.main-header {
    background: linear-gradient(135deg, var(--primary-word) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 18px 24px;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 18px;
    border-bottom: 5px solid var(--accent-gold);
    transition: background 0.4s ease;
    position: relative;
    z-index: 100;
}

.main-header.header-g3-mode {
    background: linear-gradient(135deg, var(--primary-g3) 0%, var(--primary-g3-dark) 100%);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.word-icon {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    background: #ffffff;
    color: var(--primary-word);
    width: 55px;
    height: 55px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.logo-area h1 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    line-height: 1.1;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* SELECTOR DE GRADO */
.grade-selector-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: var(--radius-md);
}

.selector-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    color: #e2e8f0;
}

.grade-toggle {
    display: flex;
    gap: 6px;
}

.btn-grade {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-grade:hover {
    background: rgba(255,255,255,0.35);
}

.btn-grade.active {
    background: var(--accent-gold);
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* MODAL DE EXPLICACIÓN Y LECCIÓN TEÓRICA PREVIA */
.theory-modal-card {
    max-width: 680px !important;
    padding: 25px 30px !important;
    text-align: left !important;
    border-radius: var(--radius-lg) !important;
    border: 3px solid var(--primary-word);
}

.theory-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.theory-icon-badge {
    font-size: 2.8rem;
    background: #ebf8ff;
    padding: 10px 14px;
    border-radius: 16px;
    border: 2px solid #90cdf4;
}

.theory-level-tag {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-word);
    background: #e0e7ff;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 4px;
}

.theory-title-box h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-dark);
    margin: 0;
}

.theory-body {
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1.5px solid #cbd5e1;
    margin-bottom: 20px;
}

.theory-concept-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-word);
    margin-bottom: 8px;
}

.theory-text {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 12px;
}

.theory-analogy-box {
    background: #fffbeb;
    border: 1.5px dashed #f59e0b;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #92400e;
}

.theory-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.btn-voice-theory {
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
    border-radius: 12px !important;
}

/* 5º PRIMARIA: CANVA STUDIO & DISEÑO DIGITAL */
.g5-nav {
    background: linear-gradient(135deg, #7d2ae8 0%, #00c4cc 100%) !important;
}

.hero-g0 {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%) !important;
    color: white !important;
}

.header-g0-mode {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%) !important;
}

.hero-g5 {
    background: linear-gradient(135deg, #7d2ae8 0%, #00c4cc 100%) !important;
    color: white !important;
}

.header-g5-mode {
    background: linear-gradient(135deg, #7d2ae8 0%, #00c4cc 100%) !important;
}

.canva-template-selector-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.template-option-card {
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-option-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(125, 42, 232, 0.2);
}

.template-option-card.active-tmpl {
    border: 3px solid #7d2ae8 !important;
    box-shadow: 0 0 15px rgba(125, 42, 232, 0.4);
}

.format-card-option.active-format {
    border: 3px solid #00c4cc !important;
    background: #ecfeff !important;
}

/* MASCOTA */
.mascot-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mascot-avatar {
    font-size: 2.2rem;
    animation: mascotFloat 3s infinite ease-in-out;
}

@keyframes mascotFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(4deg); }
}

.mascot-speech {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-voice {
    align-self: flex-start;
    background: var(--accent-gold);
    color: var(--primary-dark);
    border: none;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.header-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    position: relative;
    z-index: 101;
}

.score-pill {
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1rem;
    color: #ffe066;
    border: 2px solid #ffe066;
}

.student-pill {
    background: rgba(16, 185, 129, 0.25) !important;
    border: 2px solid #10b981 !important;
    color: #a7f3d0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease;
    user-select: none;
}

.student-pill:hover {
    background: rgba(16, 185, 129, 0.55) !important;
    transform: scale(1.05);
}

.btn-icon {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer !important;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.05);
}

.btn-logout {
    background: #ef4444 !important;
    color: white !important;
    border: 1.5px solid #fca5a5 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-logout:hover {
    background: #dc2626 !important;
    transform: scale(1.06);
}

.btn-reset {
    background: rgba(109, 40, 217, 0.45);
    border: 1.5px solid rgba(167, 139, 250, 0.6);
}

.btn-reset:hover {
    background: rgba(109, 40, 217, 0.85);
    transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   SECCIONES Y NAVEGACIÓN
   -------------------------------------------------------------------------- */
.grade-section {
    display: none;
}

.grade-section.active {
    display: block;
}

.game-nav {
    display: flex;
    background: #edf2f7;
    padding: 10px;
    gap: 8px;
    border-bottom: 2px solid #cbd5e0;
    overflow-x: auto;
}

.nav-btn, .nav-btn-g3 {
    flex: 1;
    min-width: 130px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 2px solid #cbd5e0;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.nav-btn:hover, .nav-btn-g3:hover {
    border-color: var(--primary-word);
    background: #ebf8ff;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--primary-word);
    color: white;
    border-color: var(--primary-dark);
}

.nav-btn-g3.active {
    background: var(--primary-g3);
    color: white;
    border-color: var(--primary-g3-dark);
}

.nav-btn-free, .nav-btn-cert {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: white;
    border: none;
}

.main-content {
    padding: 25px;
    background: #ffffff;
    min-height: 520px;
}

.view-screen {
    display: none;
    animation: fadeIn 0.35s ease-out forwards;
}

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

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

.hero-welcome {
    text-align: center;
    margin-bottom: 25px;
}

.hero-welcome h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-word);
    margin-bottom: 6px;
}

.hero-g3 h2 {
    color: var(--primary-g3);
}

.hero-welcome p {
    font-size: 1.05rem;
    color: var(--text-muted);
}

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

.level-card {
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.25s ease;
}

.level-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-word);
    box-shadow: var(--shadow-hover);
}

.g3-card:hover {
    border-color: var(--primary-g3);
}

.level-badge {
    position: absolute;
    top: -12px;
    background: var(--primary-word);
    color: white;
    padding: 3px 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.8rem;
}

.g3-badge {
    background: var(--primary-g3);
}

.card-icon {
    font-size: 2.8rem;
    margin: 12px 0 8px 0;
}

.level-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.level-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    flex-grow: 1;
}

.card-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px dashed #cbd5e0;
    padding-top: 10px;
}

.btn-play {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 7px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   3º BÁSICO: SIMULADOR DE RED SOCIAL (CYBERLAB)
   -------------------------------------------------------------------------- */
.social-simulator-frame {
    background: #ffffff;
    border: 3px solid #cbd5e1;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

/* Temas del Simulador */
.theme-dark-sim {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

.theme-contrast-sim {
    background: #000000 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

.sim-header {
    background: #f1f5f9;
    padding: 12px 20px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
}

.theme-dark-sim .sim-header {
    background: #1e293b;
    border-color: #334155;
    color: white;
}

.theme-contrast-sim .sim-header {
    background: #111111;
    border-color: #ffff00;
    color: #ffff00;
}

.sim-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

@media (max-width: 768px) {
    .sim-body { grid-template-columns: 1fr; }
}

.sim-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sim-settings-panel h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary-g3);
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f8fafc;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
}

.theme-dark-sim .setting-item {
    background: #1e293b;
    border-color: #334155;
}

.setting-item label {
    font-weight: 700;
    font-size: 0.9rem;
}

.toggle-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-sim-toggle {
    background: white;
    border: 2px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-sim-toggle.active {
    background: var(--primary-g3);
    color: white;
    border-color: var(--primary-g3-dark);
}

.sim-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Feed Previsualización */
.sim-preview-feed {
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.theme-dark-sim .sim-preview-feed {
    background: #1e293b;
}

.feed-post {
    background: white;
    padding: 14px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.theme-dark-sim .feed-post {
    background: #334155;
    color: white;
}

.post-user {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--primary-g3);
    margin-bottom: 6px;
}

.post-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Status Badges */
.badge-status-off {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.8rem;
}

.badge-status-on {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   WIZARD BORRADO Y CANCELACIÓN DE CUENTA
   -------------------------------------------------------------------------- */
.deletion-wizard-container {
    background: #f8fafc;
    border: 3px solid #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 20px;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 25px;
}

.step-pill {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: #e2e8f0;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.step-pill.active {
    background: var(--primary-g3);
    color: white;
}

.options-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.opt-card {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.opt-card:hover {
    border-color: var(--primary-g3);
    transform: translateY(-3px);
}

.opt-card.selected-opt {
    border-color: var(--accent-red);
    background: #fef2f2;
}

.opt-card h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.opt-card ul {
    margin-left: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.backup-sim-box {
    text-align: center;
    padding: 30px;
}

.progress-bar-container {
    width: 100%;
    height: 14px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent-green);
    width: 0%;
    transition: width 0.3s ease;
}

.grace-period-notice {
    background: #eff6ff;
    border-left: 4px solid var(--primary-g3);
    padding: 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    margin: 15px 0;
}

/* AUDITORÍA Y METER */
.audit-summary-card {
    background: #f0fdf4;
    border: 3px solid #86efac;
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
}

.audit-meter {
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px auto;
    max-width: 500px;
}

.meter-bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
    transition: width 0.6s ease;
}

.audit-checklist {
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 1.05rem;
}

.check-item {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
}

/* HERRAMIENTAS Y BARRA DE WORD (1º PRIMARIA) */
.word-ribbon-bar {
    background: #f1f5f9;
    border: 3px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.full-ribbon { flex-direction: column; align-items: stretch; gap: 12px; }
.ribbon-row { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.ribbon-label { font-weight: 800; font-size: 0.9rem; color: var(--primary-word); }
.ribbon-group { display: flex; align-items: center; gap: 8px; background: white; padding: 6px 12px; border-radius: var(--radius-sm); border: 2px solid #e2e8f0; }

.word-select {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 6px 10px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: white;
}

.btn-word-tool {
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-word-tool.active-tool {
    background: #bee3f8;
    border-color: var(--primary-word);
}

.color-palette { display: flex; gap: 6px; }
.color-btn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid white; cursor: pointer; }
.color-btn.active-color { transform: scale(1.2); outline: 2px solid var(--accent-gold); }

.btn-sticker { background: white; border: 2px solid #cbd5e1; border-radius: 15px; padding: 4px 10px; font-weight: 700; cursor: pointer; }
.action-tools-right { margin-left: auto; display: flex; gap: 10px; }

.level-header h2 { font-family: var(--font-heading); font-size: 1.7rem; color: var(--primary-word); margin-bottom: 5px; }
.instruction-text { font-size: 1rem; background: #f7fafc; padding: 10px 15px; border-left: 5px solid var(--primary-word); margin-bottom: 15px; }

.game-stage { display: flex; flex-direction: column; gap: 18px; }
.target-card { background: #fffbea; border: 2px solid #f6e05e; border-radius: var(--radius-md); padding: 15px 20px; }
.target-title { font-weight: 800; color: #b7791f; font-size: 0.85rem; }
.target-goal { font-family: var(--font-heading); font-size: 1.25rem; color: #744210; }

.character-card { display: flex; align-items: center; gap: 18px; background: #f0fdf4; border: 2px solid #86efac; border-radius: var(--radius-md); padding: 15px 20px; }
.char-avatar { font-size: 3.2rem; background: white; width: 65px; height: 65px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.canvas-preview-box {
    min-height: 200px;
    background: #ffffff;
    border: 4px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    position: relative;
}

.animal-indicator { position: absolute; top: 15px; right: 20px; font-size: 2.8rem; }

/* ESTILOS DE LISTAS INTERACTIVAS (VIÑETAS Y NUMERACIÓN) */
.list-sample-box {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.8;
    text-align: left;
}

.preview-list-style {
    margin-left: 30px;
    transition: all 0.3s ease;
}

.preview-list-style.list-bullets {
    list-style-type: disc !important;
}

.preview-list-style.list-numbers {
    list-style-type: decimal !important;
}

.preview-list-style.list-none {
    list-style-type: none !important;
    margin-left: 0;
}

.stage-actions { display: flex; justify-content: center; gap: 15px; }

.btn-action-check {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    cursor: pointer;
}

.btn-action-next {
    background: var(--primary-word);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    cursor: pointer;
}

.btn-action-secondary { background: #edf2f7; color: var(--text-dark); border: 2px solid #cbd5e0; padding: 8px 18px; border-radius: 18px; font-family: var(--font-heading); cursor: pointer; }

.btn-action-diploma {
    background: linear-gradient(135deg, #ecc94b 0%, #d69e2e 100%);
    color: #744210;
    border: none;
    padding: 10px 22px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.hidden { display: none !important; }

/* HOJA DE WORD SIMULADA */
.word-paper-container { background: white; border: 2px solid #cbd5e1; border-radius: var(--radius-md); overflow: hidden; }
.word-paper-header { background: #2b579a; color: white; padding: 8px 16px; font-size: 0.85rem; display: flex; justify-content: space-between; }
.word-paper-body { min-height: 320px; padding: 35px; outline: none; font-size: 1.4rem; line-height: 1.6; }

/* MODALES Y DIPLOMAS */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}

.modal-card {
    background: white; border-radius: var(--radius-lg); padding: 35px; max-width: 500px; width: 100%; text-align: center; position: relative;
}

.modal-icon { font-size: 3.5rem; margin-bottom: 10px; }
.stars-victory-box { font-size: 3.2rem; margin-bottom: 20px; display: flex; justify-content: center; gap: 12px; }

/* MODAL BIENVENIDA Y SELECCIÓN DE GRADO INICIAL COMPACTO */
.welcome-modal-card {
    max-width: 900px !important;
    max-height: 90vh !important;
    overflow-y: auto;
    padding: 20px 25px !important;
}

.welcome-header {
    text-align: center;
    margin-bottom: 8px;
}

.welcome-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-word);
    margin-top: 2px;
    margin-bottom: 2px;
}

.welcome-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.welcome-icon {
    font-size: 1.8rem;
}

.student-credentials-box {
    margin: 10px 0 14px 0;
    text-align: left;
    background: #f8fafc;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-field-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
}

.input-field-group.pin-group {
    flex-grow: 0;
    min-width: 190px;
}

.input-field-group label {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--primary-word);
    white-space: nowrap;
    margin-bottom: 0;
}

.name-input {
    flex-grow: 1;
    font-size: 0.95rem !important;
    padding: 6px 12px !important;
}

.pin-input {
    width: 85px !important;
    text-align: center;
    letter-spacing: 3px;
    font-weight: 800;
    font-size: 1rem !important;
    padding: 6px 8px !important;
    border-radius: 8px;
}

.grade-cards-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.welcome-grade-card {
    background: #f8fafc;
    border: 2.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 14px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: all 0.25s ease;
    justify-content: space-between;
}

.welcome-grade-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-word);
    box-shadow: var(--shadow-hover);
}

.card-g0-welcome:hover {
    border-color: #ff6b6b;
}

.card-g3-welcome:hover {
    border-color: var(--primary-g3);
}

.card-tag {
    position: absolute;
    top: -10px;
    background: var(--primary-word);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.72rem;
}

.tag-g3 {
    background: var(--primary-g3);
}

.welcome-card-icon {
    font-size: 1.8rem;
    margin: 4px 0;
}

.welcome-grade-card h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.welcome-grade-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.3;
    flex-grow: 1;
}

.btn-select-g1, .btn-select-g2, .btn-select-g4, .btn-select-g3 {
    width: 100%;
    font-size: 0.85rem !important;
    padding: 8px 6px !important;
    border-radius: 10px !important;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3º PRIMARIA: EXCEL EXPLORER CSS
   -------------------------------------------------------------------------- */
:root {
    --primary-g2: #107c41;
    --primary-g2-dark: #094e28;
}

.main-header.header-g2-mode {
    background: linear-gradient(135deg, var(--primary-g2) 0%, var(--primary-g2-dark) 100%);
}

.nav-btn-g2 {
    flex: 1;
    min-width: 130px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 2px solid #cbd5e0;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.nav-btn-g2:hover {
    border-color: var(--primary-g2);
    background: #f0fdf4;
    transform: translateY(-2px);
}

.nav-btn-g2.active {
    background: var(--primary-g2);
    color: white;
    border-color: var(--primary-g2-dark);
}

.hero-g2 h2 { color: var(--primary-g2); }
.g2-badge { background: var(--primary-g2); }
.g2-card:hover { border-color: var(--primary-g2); }
.btn-select-g2 { background: var(--primary-g2) !important; }
.tag-g2 { background: var(--primary-g2); }

/* ESTILOS DE 4º PRIMARIA (NETEXPLORER) */
:root {
    --primary-g4: #0284c7;
    --primary-g4-dark: #0369a1;
}

.g4-mode {
    border-color: var(--primary-g4) !important;
}

.nav-btn-g4 {
    flex: 1;
    min-width: 130px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: white;
    border: 2px solid #cbd5e1;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.nav-btn-g4:hover {
    border-color: var(--primary-g4);
    background: #f0f9ff;
    transform: translateY(-2px);
}

.nav-btn-g4.active {
    background: var(--primary-g4);
    color: white;
    border-color: var(--primary-g4-dark);
}

.hero-g4 h2 { color: var(--primary-g4); }
.g4-badge { background: var(--primary-g4); }
.g4-card:hover { border-color: var(--primary-g4); }
.btn-select-g4 { background: var(--primary-g4) !important; }
.tag-g4 { background: var(--primary-g4); }

.grade-cards-4 {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 10px !important;
}

@media (max-width: 900px) {
    .grade-cards-4 { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 600px) {
    .grade-cards-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* NET EXPLORER COMPONENT STYLES */
.net-journey-container {
    background: #f0f9ff;
    border: 3px solid #0284c7;
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.journey-nodes {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.net-node {
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.net-node:hover, .net-node.active-node {
    border-color: #0284c7;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.2);
}

.node-icon { font-size: 2rem; }
.node-title { font-weight: 800; font-size: 0.95rem; color: #0369a1; }
.node-sub { font-size: 0.75rem; color: #64748b; }
.node-arrow { font-size: 1.5rem; font-weight: 800; color: #0284c7; }

.journey-demo-box {
    text-align: center;
}

.travel-status-msg {
    margin-top: 10px;
    font-weight: 700;
    color: #0369a1;
}

.browser-vs-search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.concept-card {
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.concept-browser { border-color: #0284c7; }
.concept-search { border-color: #eab308; }
.concept-icon { font-size: 2.5rem; }

.quiz-browser-box {
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.quiz-options-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.btn-quiz-opt {
    background: white;
    border: 2px solid #cbd5e1;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.btn-quiz-opt:hover, .btn-quiz-opt.selected-opt {
    border-color: #0284c7;
    background: #e0f2fe;
}

.url-builder-box {
    background: white;
    border: 3px solid #0284c7;
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
}

.url-preview-bar {
    background: #f1f5f9;
    border: 2px solid #94a3b8;
    border-radius: 30px;
    padding: 10px 20px;
    display: inline-flex;
    gap: 4px;
    font-family: monospace;
    font-size: 1.3rem;
    font-weight: 800;
}

.url-part-badge {
    padding: 4px 8px;
    border-radius: 6px;
}

.p-proto { background: #dcfce7; color: #166534; }
.p-www { background: #e0f2fe; color: #0369a1; }
.p-domain { background: #fef9c3; color: #854d0e; }
.p-ext { background: #fce7f3; color: #9d174d; }

.url-parts-info {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 0.9rem;
}

.btn-url-opt {
    background: white;
    border: 2px solid #cbd5e1;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.btn-url-opt:hover, .btn-url-opt.selected-url {
    border-color: #0284c7;
    background: #e0f2fe;
}

.security-inspector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.inspector-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
}

.safe-card { border: 3px solid #16a34a; background: #f0fdf4; }
.danger-card { border: 3px solid #dc2626; background: #fef2f2; }
.insp-status { font-weight: 800; font-size: 1.1rem; }
.insp-url { font-family: monospace; font-size: 1rem; margin: 8px 0; }

.sim-browser-window {
    background: white;
    border: 3px solid #0284c7;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.sim-browser-bar {
    background: #e2e8f0;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.browser-controls { display: flex; gap: 6px; }
.b-btn { background: white; border: 1px solid #cbd5e1; border-radius: 4px; padding: 4px 8px; cursor: pointer; }

.sim-url-input-box {
    flex-grow: 1;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 12px;
}

.sim-url-input {
    border: none;
    outline: none;
    width: 100%;
    font-family: monospace;
    font-size: 0.95rem;
    padding-left: 8px;
}

.btn-sim-go {
    background: #0284c7;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
}

.sim-browser-content {
    padding: 30px;
    background: #f8fafc;
    min-height: 200px;
}

.mock-web-page h1 { color: #0284c7; }
.page-highlights { display: flex; gap: 10px; margin-top: 15px; }
.feat-box { background: #e0f2fe; color: #0369a1; padding: 8px 14px; border-radius: 6px; font-weight: 700; font-size: 0.85rem; }

.grade-cards-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 800px) {
    .grade-cards-3 { grid-template-columns: 1fr !important; }
}

/* EXCEL DIAGRAM MOCKUP & EXPLORER */
.excel-window-explorer-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 850px) {
    .excel-window-explorer-layout { grid-template-columns: 1fr; }
}

.part-badge {
    background: var(--accent-orange);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.excel-part-info-card {
    background: #ffffff;
    border: 3px solid #107c41;
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(16, 124, 65, 0.12);
    justify-content: center;
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.info-card-icon { font-size: 2.2rem; }

.info-card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #107c41;
}

.info-card-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
}

.info-card-analogy {
    background: #f0fdf4;
    border-left: 4px solid #107c41;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #166534;
}

.excel-diagram-interactive-box {
    background: #f8fafc;
    border: 3px solid #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 20px;
}

.excel-window-mockup {
    background: white;
    border: 2px solid #a1a1aa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mock-top-bar { background: #107c41; color: white; padding: 8px 16px; font-weight: 800; font-size: 0.9rem; }
.mock-ribbon-bar { background: #f4f4f5; border-bottom: 2px solid #e4e4e7; padding: 8px 16px; font-size: 0.85rem; font-weight: 700; color: #3f3f46; }
.mock-formula-bar { display: flex; background: white; border-bottom: 2px solid #e4e4e7; }
.mock-name-box { width: 80px; padding: 6px 12px; border-right: 2px solid #e4e4e7; font-weight: 800; color: #107c41; text-align: center; }
.mock-fx { flex-grow: 1; padding: 6px 12px; font-family: monospace; color: #27272a; }
.mock-grid-area { padding: 10px; }

.mock-grid-area table, .excel-mini-interactive-grid table, .excel-treasure-grid table, #g2-worksheet-table {
    width: 100%; border-collapse: collapse; text-align: center;
}

.mock-grid-area th, .excel-mini-interactive-grid th, .excel-treasure-grid th, #g2-worksheet-table th {
    background: #e4e4e7; border: 1px solid #d4d4d8; padding: 8px; font-size: 0.9rem;
}

.mock-grid-area td, .excel-mini-interactive-grid td, .excel-treasure-grid td, #g2-worksheet-table td {
    border: 1px solid #d4d4d8; padding: 10px; font-size: 1rem; cursor: pointer;
}

.mock-sheet-bar { background: #f4f4f5; border-top: 2px solid #e4e4e7; padding: 6px 16px; display: flex; gap: 10px; font-size: 0.85rem; }
.tab-sheet { padding: 3px 10px; border-radius: 4px; background: #e4e4e7; }
.tab-sheet.active { background: white; font-weight: 800; color: #107c41; border-top: 2px solid #107c41; }

.clickable-part { transition: all 0.2s ease; cursor: pointer; }
.clickable-part:hover { outline: 3px solid #f59e0b; }
.clickable-part.part-selected { outline: 4px solid #10b981; background-color: #ecfdf5 !important; }

/* EXCEL INTERACTIVE GRIDS */
.excel-mini-interactive-grid td.highlighted-cell, .excel-treasure-grid td.highlighted-cell {
    background-color: #dcfce7 !important;
    border-color: #107c41 !important;
    font-weight: 800;
}

/* EXCEL CELL FOCUS & SELECTION STYLES */
#g2-worksheet-table td.excel-cell-active {
    outline: 3px solid #107c41 !important;
    outline-offset: -3px;
    position: relative;
    z-index: 5;
}

.cell-indicator-group {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}

.active-cell-badge {
    background: #107c41;
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: monospace;
}

.preset-colors {
    display: flex;
    gap: 4px;
    margin-left: 6px;
}

.btn-preset-color {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.btn-preset-color:hover {
    transform: scale(1.2);
}

.excel-autosum-demo-box {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.formula-bar-sim {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
}

.fx-icon {
    font-family: serif;
    font-weight: bold;
    font-style: italic;
    color: #107c41;
}

.autosum-result-cell {
    font-weight: 800;
    color: #107c41;
    background: #dcfce7;
    font-size: 1.3rem;
}

.excel-paper-container { background: white; border: 3px solid #107c41; border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.excel-paper-header { background: #107c41; color: white; padding: 10px 18px; font-size: 0.9rem; display: flex; justify-content: space-between; font-weight: 700; }
.excel-worksheet-interactive { padding: 20px; }
.total-row { background: #f4f4f5; font-weight: 800; }

.diploma-signatures { display: flex; justify-content: space-around; margin-top: 25px; }

/* ESTILOS DE NIVELES BLOQUEADOS */
.locked-card {
    opacity: 0.65;
    filter: grayscale(0.5);
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
}

.locked-card:hover {
    transform: none !important;
    box-shadow: none !important;
}

.locked-card .btn-play {
    background: #94a3b8 !important;
    cursor: not-allowed !important;
}

.locked-card .level-badge {
    background: #64748b !important;
}

.locked-nav {
    opacity: 0.55;
    filter: grayscale(0.6);
    cursor: not-allowed !important;
}

.locked-nav:hover {
    transform: none !important;
    background: var(--bg-card) !important;
    border-color: #cbd5e0 !important;
}

.btn-logout {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: white !important;
    font-weight: bold;
    border-radius: 12px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.btn-clear-profile {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-clear-profile:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

@media print {
    body * { visibility: hidden; }
    #printable-diploma, #printable-diploma * { visibility: visible; }
    #printable-diploma { position: absolute; left: 0; top: 0; width: 100%; border: 10px double #b7791f; background: white; }
    .no-print { display: none !important; }
}

/* ANIMACIONES PEDAGÓGICAS Y DE CONTROL DE ACCESO */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px) scale(1.02); }
}

.bounce-effect {
    animation: bounce 0.5s ease-in-out 2;
    box-shadow: 0 10px 25px rgba(22, 163, 74, 0.4) !important;
    border-color: #16a34a !important;
}
