@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================================================
   CAMPUS — Azul Nocturno
   Paleta: navy profundo + azul eléctrico + ámbar cálido
   Font:   Plus Jakarta Sans
   ============================================================ */

:root {
    /* Acento principal */
    --azul:          #3b82f6;
    --azul-claro:    #60a5fa;
    --azul-bright:   #5590f8;

    /* Ámbar como acento secundario (reemplaza naranja) */
    --naranja:       #f59e0b;
    --naranja-claro: #fbbf24;

    /* Texto — light sobre dark */
    --azul-oscuro:   #dceeff;   /* headings principales */
    --azul-profundo: #8ab0cc;   /* texto body */

    /* Superficies dark */
    --neutro:        #0c1826;   /* superficie sutil / fondos de inputs */
    --blanco:        #0b1a31;   /* cards, modales */

    /* Semánticos */
    --success:       #34d399;
    --error:         #f87171;
    --gray:          #4a6a8a;

    /* Sombras */
    --sombra:         0 4px 20px rgba(0,0,0,.4);
    --sombra-intensa: 0 10px 32px rgba(0,0,0,.55);

    /* Bordes */
    --border:        rgba(59,130,246,.14);
    --border-hover:  rgba(59,130,246,.28);

    --radio: 14px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow-x: hidden; }

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    background: #060d1a;
    background-image:
        radial-gradient(ellipse 1400px 900px at 80% 5%,  rgba(59,130,246,.07) 0%, transparent 60%),
        radial-gradient(ellipse 900px 700px  at 5%  85%, rgba(59,130,246,.05) 0%, transparent 55%);
    min-height: 100vh;
    color: var(--azul-profundo);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 15px 20px 5px; min-height: calc(100vh - 10px); }

/* ── Card base ── */
.card {
    background: var(--blanco);
    border: 1px solid var(--border);
    border-radius: var(--radio);
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--sombra);
    margin-bottom: 20px;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-intensa);
    border-color: var(--border-hover);
}

/* ── Botones ── */
.btn {
    border: none; padding: 8px 16px; border-radius: 20px; font-weight: 700;
    cursor: pointer; transition: all 0.3s ease; display: inline-flex;
    align-items: center; gap: 6px; text-decoration: none; font-size: 13px;
    white-space: nowrap; font-family: inherit;
}
.btn:hover { transform: scale(1.05); }
.btn-primary  { background: linear-gradient(135deg, #3b7cf4, #2860c4); color: white;
                box-shadow: 0 4px 16px rgba(59,130,246,.3); }
.btn-secondary{ background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.28);
                color: var(--azul-claro); }
.btn-success  { background: linear-gradient(to right, #25D366, #128C7E); color: white; }
.btn-error    { background: rgba(248,113,113,.15); border: 1px solid rgba(248,113,113,.25);
                color: var(--error); }
.btn-small    { padding: 6px 12px; font-size: 11px; }

/* ── Header del dashboard ── */
.header-container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; }
.school-brand { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 250px; }
.school-logo {
    width: 50px; height: 50px; object-fit: contain; border-radius: 12px;
    background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(245,158,11,.14));
    padding: 6px; border: 1px solid rgba(59,130,246,.2);
}
.school-name { color: var(--azul-oscuro); font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.user-welcome { text-align: right; flex: 1; min-width: 180px; }
.user-welcome h2 { color: var(--azul-oscuro); margin-bottom: 5px; font-size: 16px; font-weight: 700; }
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; background: rgba(52,211,153,.12);
    border: 1px solid rgba(52,211,153,.22); color: var(--success);
    border-radius: 20px; font-size: 10px; font-weight: 700;
    letter-spacing: .3px; margin-bottom: 8px;
}
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--success); }

/* ── Dashboard layout ── */
.dashboard { max-height: calc(100vh - 30px); overflow-y: auto; margin-bottom: 5px; }
.back-btn { margin-bottom: 15px; }
.grid { display: grid; gap: 20px; margin-bottom: 30px; }
.grid-cursos  { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-modulos { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── Tarjetas de curso ── */
.curso-card, .module-card {
    cursor: pointer;
    border: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; height: 100%; position: relative;
    transition: all .3s ease;
}
.curso-card:hover, .module-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(59,130,246,.15);
    transform: translateY(-2px);
}
.curso-notification-bell {
    position: absolute; top: 10px; right: 10px;
    background: var(--naranja); color: white;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; box-shadow: 0 2px 10px rgba(245,158,11,.5);
    animation: bellRing 2s infinite; z-index: 10;
}
@keyframes bellRing {
    0%,100% { transform: rotate(0); }
    10%,30%  { transform: rotate(10deg); }
    20%,40%  { transform: rotate(-10deg); }
    50%      { transform: rotate(0); }
}
.curso-disponible-card {
    cursor: pointer;
    border: 1px solid rgba(52,211,153,.18);
    border-left: 1px solid rgba(52,211,153,.18);
    border-right: 1px solid rgba(52,211,153,.18);
    display: flex; flex-direction: column; height: 100%;
    transition: all .3s ease;
}
.curso-disponible-card:hover {
    border-color: rgba(52,211,153,.35);
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    transform: translateY(-2px);
}
.curso-imagen, .module-imagen {
    width: 100%; height: 160px;
    background: linear-gradient(135deg, #071a3a 0%, #0d2e6a 55%, #1040a0 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 50px; overflow: hidden; position: relative;
    border-radius: 10px; margin-bottom: 15px;
}
.curso-imagen img, .module-imagen img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; border-radius: 10px;
}
.curso-card:hover .curso-imagen img,
.module-card:hover .module-imagen img,
.curso-disponible-card:hover .curso-imagen img { transform: scale(1.05); }

.curso-titulo, .module-titulo {
    font-size: 16px; font-weight: 700; color: var(--azul-oscuro);
    margin-bottom: 8px; text-align: center;
    border-bottom: 2px solid rgba(59,130,246,.25);
    padding-bottom: 8px; word-wrap: break-word;
}
.curso-disponible-titulo {
    font-size: 16px; font-weight: 700; color: var(--success);
    margin-bottom: 8px; text-align: center;
    border-bottom: 2px solid rgba(52,211,153,.25);
    padding-bottom: 8px; word-wrap: break-word;
}
.curso-content { padding: 0; flex: 1; display: flex; flex-direction: column; }
.curso-grupo { color: var(--gray); font-size: 13px; margin-bottom: 8px; text-align: center; font-weight: 500; }
.btn-acceder { width: 100%; margin-top: auto; }
.btn-inscribirme {
    width: 100%; margin-top: auto;
    background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.28);
    color: var(--success); border-radius: 20px;
}
.btn-inscribirme:hover { background: rgba(52,211,153,.22); }

/* ── Títulos de sección ── */
.section-title {
    color: var(--azul-oscuro); font-size: 22px; font-weight: 800;
    margin: 30px 0 6px 0; padding-bottom: 0;
    border-bottom: none;
    letter-spacing: -.4px;
    display: flex; align-items: center; gap: 14px;
}
.section-title::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(59,130,246,.4), transparent);
}
.section-subtitle {
    color: var(--gray); font-size: 13px; font-weight: 500;
    margin-bottom: 20px; text-align: center;
}

/* ── Modal de preview de curso disponible ── */
.curso-preview-container {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.85); z-index: 10000;
    justify-content: center; align-items: center; padding: 20px;
}
.curso-preview-content {
    background: var(--blanco); border: 1px solid var(--border);
    border-radius: 16px; padding: 25px; width: 100%; max-width: 600px;
    max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.preview-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.preview-title { color: var(--azul-oscuro); font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.close-preview { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: 18px; cursor: pointer; color: var(--gray); padding: 6px 10px; border-radius: 8px; }
.close-preview:hover { color: var(--azul-oscuro); background: rgba(255,255,255,.1); }
.preview-image { width: 100%; height: 200px; object-fit: cover; border-radius: 10px; margin-bottom: 15px; }
.preview-description { color: var(--azul-profundo); line-height: 1.6; margin-bottom: 20px; }
.preview-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Barras de progreso ── */
.progress-container { margin: 12px 0; padding: 8px; background: var(--neutro); border-radius: 8px; }
.progress-bar-container {
    background: rgba(255,255,255,.06); border-radius: 8px; height: 6px;
    overflow: hidden; margin-bottom: 4px; position: relative;
}
.progress-bar {
    background: linear-gradient(90deg, var(--azul), var(--azul-claro));
    height: 100%; transition: width 0.5s ease; border-radius: 8px;
    position: absolute; left: 0; top: 0;
    box-shadow: 0 0 8px rgba(59,130,246,.5);
}
.progress-text  { text-align: center; font-size: 11px; color: var(--gray); font-weight: 700; }
.progress-label { font-size: 11px; color: var(--gray); margin-bottom: 4px; text-align: center; font-weight: 600; }

/* ── Acordeón de lecciones ── */
.lesson-accordion {
    background: var(--blanco); border-radius: 12px; margin-bottom: 12px;
    overflow: hidden; box-shadow: var(--sombra); border: 1px solid var(--border);
}
.lesson-accordion.active {
    border-color: rgba(59,130,246,.28);
    box-shadow: 0 4px 20px rgba(59,130,246,.12);
}
.lesson-header {
    display: flex; align-items: flex-start; padding: 16px; cursor: pointer;
    background: var(--blanco); transition: background 0.3s ease; position: relative;
}
.lesson-header:hover { background: rgba(59,130,246,.05); }
.lesson-accordion.active .lesson-header { background: rgba(59,130,246,.07); }
.lesson-number-container { display: flex; align-items: flex-start; gap: 12px; margin-right: 12px; flex-shrink: 0; }
.lesson-number {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--azul); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.lesson-accordion.completed .lesson-number { background: var(--success); }
.lesson-arrow {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease; color: var(--gray);
}
.lesson-accordion.active .lesson-arrow { transform: rotate(180deg); color: var(--azul); }

.lesson-thumbnail {
    width: 120px; height: 70px; border-radius: 8px; overflow: hidden;
    flex-shrink: 0; background: rgba(255,255,255,.06); display: flex;
    align-items: center; justify-content: center; position: relative;
    cursor: pointer; margin-right: 12px; border: 1px solid var(--border);
}
.lesson-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.lesson-thumbnail .play-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    background: rgba(0,0,0,.75); border-radius: 50%; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center; color: white;
    font-size: 12px; opacity: 0; transition: opacity 0.3s;
}
.lesson-thumbnail:hover .play-icon { opacity: 1; }

.lesson-main-content { flex: 1; display: flex; flex-direction: column; align-items: center; }
.lesson-title { font-weight: 600; color: var(--azul-oscuro); font-size: 15px; text-align: center; margin-bottom: 8px; width: 100%; }
.lesson-accordion.completed .lesson-title { text-decoration: line-through; color: var(--gray); }
.lesson-description {
    color: var(--azul-profundo); font-size: 14px; line-height: 1.5;
    text-align: center; margin-bottom: 12px; width: 100%;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Calificaciones / estrellas ── */
.calificacion-container { display: flex; flex-direction: column; align-items: center; margin: 8px 0; width: 100%; }
.calificacion-estrellas { display: flex; gap: 4px; margin-bottom: 4px; }
.estrella { font-size: 18px; color: rgba(255,255,255,.15); transition: color 0.3s ease; }
.estrella.activa { color: var(--naranja); }
.calificacion-texto { font-size: 12px; font-weight: 600; color: var(--azul-oscuro); text-align: center; }
.calificacion-valor { color: var(--naranja); font-weight: 700; }
.certificado-estrellas { display: flex; gap: 4px; justify-content: center; }
.certificado-texto { font-size: 11px; font-weight: 600; color: var(--success); text-align: center; margin-top: 4px; }

/* ── Botones rápidos de lección ── */
.lesson-quick-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: center; flex-wrap: wrap; }
.quick-action-btn {
    background: rgba(59,130,246,.14); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.25); padding: 6px 10px;
    border-radius: 10px; font-size: 15px; cursor: pointer;
    transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 4px;
}
.quick-action-btn:hover { transform: scale(1.08); background: rgba(59,130,246,.24); border-color: rgba(59,130,246,.4); }
.quick-action-btn.certificado { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.25); }
.quick-action-btn.certificado:hover { background: rgba(52,211,153,.22); }
.quick-action-btn.encuesta { background: rgba(245,158,11,.12); color: var(--naranja); border-color: rgba(245,158,11,.25); }
.quick-action-btn.encuesta:hover { background: rgba(245,158,11,.22); }
.quick-action-btn .btn-text { font-size: 12px; font-weight: 600; }

.vista-button-container { display: flex; justify-content: center; width: 100%; margin-top: 8px; }
.btn-vista {
    background: rgba(59,130,246,.14); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.25); padding: 6px 14px;
    border-radius: 20px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease; white-space: nowrap; font-family: inherit;
}
.btn-vista:hover { background: rgba(59,130,246,.24); transform: scale(1.05); }
.btn-vista.completed { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.25); }

/* ── Contenido expandido de lección ── */
.lesson-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: rgba(59,130,246,.04);
}
.lesson-accordion.active .lesson-content { max-height: 1000px; padding: 0 16px 16px; }
.lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; margin-top: 16px; }
.lesson-actions .btn { margin: 0; }

/* ── Video player ── */
.player-container {
    width: 100%; max-width: 800px;
    background: var(--blanco); border-radius: 15px; padding: 15px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5); position: relative;
    margin: 12px 0; display: none;
    border: 1px solid var(--border);
}
.video-container {
    position: relative; width: 100%;
    background: #000; border-radius: 10px 10px 0 0;
    overflow: hidden; display: flex; justify-content: center; align-items: center;
    border: 1px solid rgba(59,130,246,.2);
}
.video-container div[id^="player-"] { width: 100% !important; aspect-ratio: 16/9; height: auto !important; max-height: 450px; }
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; cursor: pointer; }
.corner-box {
    position: absolute; bottom: 10px; right: 10px; width: 100px; height: 40px;
    background: rgba(11,26,49,.92); border-radius: 8px;
    display: flex; justify-content: center; align-items: center;
    font-size: 24px; z-index: 20; pointer-events: none; color: var(--azul-claro);
    backdrop-filter: blur(8px); padding: 5px;
    border: 1px solid rgba(59,130,246,.25);
}
.corner-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.exit-fullscreen {
    position: absolute; top: 10px; right: 10px; width: 50px; height: 50px;
    background: var(--blanco); border-radius: 8px; display: none;
    justify-content: center; align-items: center; font-size: 20px; z-index: 30;
    cursor: pointer; color: var(--azul-claro); font-weight: bold;
    border: 1px solid var(--border);
}

.controls-panel {
    background: var(--blanco); padding: 15px; border-radius: 0 0 10px 10px;
    margin-top: 0; transition: opacity 0.3s ease; opacity: 1; z-index: 20;
    border-top: 1px solid var(--border);
}
:-webkit-full-screen .controls-panel,
:-moz-full-screen .controls-panel,
:fullscreen .controls-panel {
    position: absolute !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
    width: 100% !important; background: rgba(0,0,0,.88) !important; backdrop-filter: blur(8px);
    opacity: 0; visibility: hidden; transform: translateY(100%);
    transition: all 0.3s ease; z-index: 40; padding: 20px !important; border-radius: 0 !important;
}
:fullscreen .controls-panel.show-controls { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; }
:fullscreen .video-container { border-radius: 0 !important; border: none !important; flex: 1 !important; }
:fullscreen .video-container div[id^="player-"] { max-height: 100% !important; }
:fullscreen .player-container { display: flex !important; flex-direction: column !important; height: 100% !important; max-width: 100% !important; padding: 0 !important; border-radius: 0 !important; border: none !important; }

.progress-row { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.progress-container-player {
    flex: 1; height: 20px; background: rgba(255,255,255,.06);
    border-radius: 10px; position: relative; cursor: pointer; z-index: 15;
}
.progress-player {
    height: 100%; background: var(--azul); border-radius: 10px;
    width: 0%; position: absolute; left: 0; top: 0;
    box-shadow: 0 0 8px rgba(59,130,246,.5);
}
.thumb {
    position: absolute; top: 50%; transform: translate(-50%,-50%);
    width: 20px; height: 20px; background: var(--azul-oscuro);
    border-radius: 50%; cursor: pointer; z-index: 25;
    box-shadow: 0 2px 6px rgba(0,0,0,.5); left: 0;
    border: 2px solid var(--azul);
}
.time-display { color: var(--azul-claro); font-size: 14px; font-weight: 700; min-width: 100px; text-align: center; font-family: monospace; }
:fullscreen .time-display { color: white; }
.video-controls { display: flex; justify-content: center; gap: 15px; z-index: 30; position: relative; }
.video-controls button {
    background: rgba(59,130,246,.12); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.28); padding: 10px 20px;
    border-radius: 10px; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.3s; flex: 1; max-width: 200px; font-family: inherit;
}
.video-controls button:hover { background: rgba(59,130,246,.22); color: var(--azul-oscuro); }

/* ── Botones de cabecera de curso ── */
.course-buttons, .module-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 15px; }
.course-buttons .btn, .module-buttons .btn { margin: 0; }
.course-header-buttons { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.course-header-btn {
    display: flex; align-items: center; gap: 8px; padding: 8px 16px;
    background: rgba(59,130,246,.1); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.28); border-radius: 20px;
    font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    text-decoration: none; font-size: 13px; font-family: inherit;
}
.course-header-btn:hover {
    background: rgba(59,130,246,.22); color: var(--azul-oscuro);
    transform: scale(1.03); border-color: rgba(59,130,246,.45);
}
.course-header-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ── Info de curso ── */
.course-info-text {
    margin-top: 15px; padding: 14px; background: var(--neutro);
    border-radius: 10px; border-left: 3px solid var(--azul);
}
.course-info-item { margin-bottom: 10px; display: flex; align-items: flex-start; gap: 10px; }
.course-info-item:last-child { margin-bottom: 0; }
.course-info-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.course-info-content { flex: 1; }
.course-info-label { font-weight: 700; color: var(--azul-oscuro); font-size: 13px; margin-bottom: 4px; }
.course-info-value { color: var(--azul-profundo); font-size: 14px; line-height: 1.4; }
.course-info-value a { color: var(--azul-claro); text-decoration: none; }
.course-info-value a:hover { text-decoration: underline; }

/* ── Cabecera expandida de curso/módulo ── */
.course-header, .module-header-expanded { display: none; }
.course-title-section, .module-title-section { text-align: center; margin-bottom: 15px; }
.course-title-section h1 { color: var(--azul-oscuro); font-size: 24px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.5px; }
.module-title-section h2  { color: var(--azul-oscuro); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.course-content, .module-content { display: flex; gap: 20px; align-items: flex-start; }
.course-image-container, .module-image-container { flex: 0 0 150px; }
.course-header-image, .module-header-image { width: 100%; max-height: 120px; object-fit: cover; border-radius: 12px; }
.course-info, .module-info { flex: 1; }
.course-description, .module-description { color: var(--azul-profundo); line-height: 1.5; margin-bottom: 12px; font-size: 14px; }

/* ── Notificaciones toast ── */
.notification {
    position: fixed; top: 15px; right: 15px; padding: 12px 18px;
    border-radius: 10px; background: rgba(52,211,153,.15);
    border: 1px solid rgba(52,211,153,.3); color: var(--success);
    font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.3);
    opacity: 0; transform: translateX(320px);
    transition: all 0.3s ease; z-index: 1000; font-size: 13px;
}
.notification.show { opacity: 1; transform: translateX(0); }
.notification.error {
    background: rgba(248,113,113,.15);
    border-color: rgba(248,113,113,.3); color: var(--error);
}

/* ── Modal de manual/PDF ── */
#universalManualModal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.88); z-index: 10000; display: none;
    justify-content: center; align-items: center;
}
#universalManualModal .modal-content {
    position: relative; width: 90%; height: 90%;
    max-width: 900px; background: var(--blanco);
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border);
}
#universalManualModal .modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; background: #0d1f38; color: white;
}
#universalManualModal .modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
#universalManualModal .close-modal { background: none; border: none; color: rgba(255,255,255,.7); font-size: 20px; cursor: pointer; }
#universalManualModal .close-modal:hover { color: white; }
#universalManualModal iframe { width: 100%; height: calc(100% - 50px); border: none; }

/* ── Login ── */
.login-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px; position: relative; overflow: hidden;
}
.login-container::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 800px 600px at 30% 55%, rgba(59,130,246,.13) 0%, transparent 65%),
        radial-gradient(ellipse 500px 400px at 75% 30%, rgba(245,158,11,.08) 0%, transparent 55%);
}
.login-container::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 32px 32px;
}

.form-container {
    width: 340px; padding: 36px 32px; text-align: center;
    position: relative; z-index: 1;
    background: rgba(10,20,40,.85);
    border: 1px solid rgba(59,130,246,.22);
    border-radius: 22px;
    backdrop-filter: blur(24px);
    box-shadow: 0 28px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(59,130,246,.08),
                inset 0 1px 0 rgba(255,255,255,.06);
}
.school-header { text-align: center; margin-bottom: 24px; }
.login-school-logo {
    max-width: 72px; max-height: 56px; object-fit: contain;
    margin: 0 auto 14px; display: block; border-radius: 14px;
    background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(245,158,11,.18));
    padding: 10px; border: 1px solid rgba(59,130,246,.2);
}
.login-title {
    text-align: center; color: var(--azul-oscuro);
    margin-bottom: 6px; font-weight: 800; font-size: 21px; letter-spacing: -.4px;
}

/* ── Inputs ── */
input[type=text], input[type=password], input[type=email], input[type=tel] {
    width: 100%; padding: 12px 14px; margin: 6px 0;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    outline: none; text-align: center; font-size: 14px; font-weight: 600;
    color: var(--azul-oscuro); border-radius: 12px;
    transition: all 0.3s; font-family: inherit;
}
input[type=text]:focus, input[type=password]:focus,
input[type=email]:focus, input[type=tel]:focus {
    border-color: rgba(59,130,246,.5);
    background: rgba(59,130,246,.07);
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
input[type=text]::placeholder, input[type=password]::placeholder,
input[type=email]::placeholder, input[type=tel]::placeholder { color: var(--gray); }
input[type=submit], input[type=button] { width: 100%; margin: 5px 0; }

.error-message { color: var(--error); font-size: 11px; text-align: center; margin: 8px 0; min-height: 18px; }
.google-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 0 12px; color: var(--gray); font-size: 12px;
}
.google-divider::before, .google-divider::after {
    content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08);
}
.login-links { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.login-link {
    background: transparent; border: none; color: var(--azul-claro);
    text-decoration: none; font-size: 12px; cursor: pointer;
    padding: 5px; font-weight: 600; font-family: inherit; opacity: .85;
}
.login-link:hover { color: var(--azul-oscuro); opacity: 1; }

/* ── Modales genéricos ── */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.8); z-index: 10000; display: none;
    justify-content: center; align-items: center; padding: 20px;
}
.modal-content {
    background: var(--blanco); border-radius: 18px; padding: 26px;
    width: 100%; max-width: 420px;
    border: 1px solid rgba(59,130,246,.2);
    box-shadow: 0 28px 64px rgba(0,0,0,.6);
    position: relative;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px;
    padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.modal-title { color: var(--azul-oscuro); font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.close-modal {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    font-size: 15px; cursor: pointer; color: var(--gray);
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.close-modal:hover { color: var(--azul-oscuro); background: rgba(255,255,255,.1); }
.form-group { margin-bottom: 14px; text-align: left; }
.form-label { display: block; margin-bottom: 5px; font-weight: 700; color: var(--azul-claro); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

/* ── Modal de encuesta ── */
.survey-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.92); z-index: 10000; display: none;
    justify-content: center; align-items: center; padding: 20px;
}
.survey-modal-content {
    background: var(--blanco); border-radius: 16px; width: 100%; max-width: 900px;
    max-height: 90vh; border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0,0,0,.6); position: relative;
    overflow: hidden; display: flex; flex-direction: column;
}
.survey-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px; background: #0d1f38; color: white; flex-shrink: 0;
    border-bottom: 1px solid rgba(59,130,246,.2);
}
.survey-modal-title { font-size: 17px; font-weight: 700; margin: 0; }
.close-survey-modal {
    background: none; border: none; color: rgba(255,255,255,.6); font-size: 22px;
    cursor: pointer; width: 38px; height: 38px; display: flex;
    align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s;
}
.close-survey-modal:hover { background: rgba(255,255,255,.1); color: white; }
.survey-body { padding: 25px; overflow-y: auto; flex: 1; }
.survey-info {
    background: rgba(59,130,246,.08); padding: 14px; border-radius: 10px;
    margin-bottom: 20px; border-left: 3px solid var(--azul);
    color: var(--azul-profundo);
}
.survey-question {
    background: var(--neutro); padding: 20px; border-radius: 12px;
    margin-bottom: 20px; border-left: 3px solid var(--azul);
}
.question-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.question-number {
    background: var(--azul); color: white; width: 32px; height: 32px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0;
}
.question-type-badge {
    background: rgba(245,158,11,.15); color: var(--naranja);
    border: 1px solid rgba(245,158,11,.28);
    padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: 700;
}
.question-text { color: var(--azul-oscuro); font-size: 16px; font-weight: 700; margin: 10px 0 15px 0; line-height: 1.5; }
.question-options { display: flex; flex-direction: column; gap: 10px; }
.option-label {
    display: flex; align-items: center; padding: 12px 16px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px; cursor: pointer; transition: all 0.2s ease;
}
.option-label:hover { border-color: var(--azul); background: rgba(59,130,246,.07); }
.option-label input[type="radio"] { margin-right: 12px; cursor: pointer; width: 18px; height: 18px; accent-color: var(--azul); }
.option-text { flex: 1; color: var(--azul-profundo); font-size: 14px; }
.question-textarea {
    width: 100%; min-height: 120px; padding: 12px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
    font-family: inherit; font-size: 14px; resize: vertical;
    background: rgba(255,255,255,.05); color: var(--azul-oscuro);
    transition: border-color 0.3s;
}
.question-textarea:focus { outline: none; border-color: rgba(59,130,246,.4); background: rgba(59,130,246,.05); }
.question-file-input { display: none; }
.file-upload-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px;
    background: rgba(59,130,246,.14); color: var(--azul-claro);
    border: 1px solid rgba(59,130,246,.28); border-radius: 10px;
    cursor: pointer; font-weight: 700; transition: all 0.3s; font-family: inherit;
}
.file-upload-btn:hover { background: rgba(59,130,246,.24); }
.file-info {
    margin-top: 10px; padding: 10px; background: rgba(52,211,153,.1);
    border-radius: 8px; color: var(--success); font-size: 14px; display: none;
    border: 1px solid rgba(52,211,153,.2);
}
.survey-actions {
    padding: 14px 24px; border-top: 1px solid rgba(255,255,255,.06);
    display: flex; justify-content: space-between; gap: 10px; flex-shrink: 0;
}
.survey-resultado { padding: 25px; text-align: center; }
.resultado-header {
    background: linear-gradient(135deg, #0d2e6a, #1a4a9c);
    border: 1px solid rgba(59,130,246,.25);
    color: white; padding: 30px; border-radius: 15px; margin-bottom: 25px;
}
.resultado-score { font-size: 48px; font-weight: 800; margin: 15px 0; color: var(--naranja-claro); }
.resultado-mensaje { font-size: 18px; margin: 10px 0; }

/* ── Revisión de encuesta ── */
.revision-question {
    background: var(--neutro); padding: 20px; margin: 15px 0;
    border-radius: 12px; border: 1px solid rgba(255,255,255,.06);
}
.revision-question.correcta  { border-left: 4px solid var(--success); background: rgba(52,211,153,.07); }
.revision-question.incorrecta{ border-left: 4px solid var(--error);   background: rgba(248,113,113,.07); }
.revision-question.pendiente { border-left: 4px solid var(--naranja); background: rgba(245,158,11,.07); }
.revision-status { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.revision-status.correcta  { background: rgba(52,211,153,.15);  color: var(--success); border: 1px solid rgba(52,211,153,.3); }
.revision-status.incorrecta{ background: rgba(248,113,113,.15); color: var(--error);   border: 1px solid rgba(248,113,113,.3); }
.revision-status.pendiente { background: rgba(245,158,11,.15);  color: var(--naranja); border: 1px solid rgba(245,158,11,.3); }
.respuesta-alumno   { background: rgba(255,255,255,.04); padding: 12px; border-radius: 8px; margin: 10px 0; color: var(--azul-profundo); }
.respuesta-correcta { background: rgba(52,211,153,.08); padding: 12px; border-radius: 8px; margin: 10px 0; border: 1px solid rgba(52,211,153,.2); color: var(--azul-profundo); }
.puntaje-badge {
    display: inline-block; padding: 4px 12px;
    background: rgba(59,130,246,.15); border: 1px solid rgba(59,130,246,.28);
    color: var(--azul-claro); border-radius: 12px; font-size: 13px; font-weight: 700; margin-left: 10px;
}

/* ── Notas y manual ── */
.notes-area { display: none; margin-top: 8px; }
.notes-textarea {
    width: 100%; height: 100px; padding: 10px;
    border: 1px solid rgba(255,255,255,.1); border-radius: 8px; resize: vertical;
    font-family: inherit; background: rgba(255,255,255,.04); color: var(--azul-oscuro);
}
.notes-textarea:focus { outline: none; border-color: rgba(59,130,246,.35); }
.save-notes-btn { margin-top: 8px; }
.manual-container { display: none; margin-top: 8px; }

/* ── Utilidades ── */
.image-fallback { font-size: 50px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.loading    { text-align: center; padding: 20px; color: var(--gray); font-weight: 500; }
.no-content { text-align: center; padding: 20px; color: var(--gray); font-weight: 500; }

/* ── Portada promo ── */
.portada-promo-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.92); z-index: 10000; display: none;
    justify-content: center; align-items: center; padding: 20px; overflow-y: auto;
}
.portada-promo-content {
    background: var(--blanco); border-radius: 16px; width: 100%;
    max-width: 900px; max-height: 90vh; overflow-y: auto; position: relative;
    border: 1px solid var(--border); box-shadow: 0 28px 60px rgba(0,0,0,.6);
}
.portada-header {
    position: sticky; top: 0;
    background: linear-gradient(135deg, #0d2e6a, #1a4a9c);
    color: white; padding: 20px 25px; border-radius: 16px 16px 0 0;
    z-index: 100; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(59,130,246,.25);
}
.portada-title { font-size: 22px; font-weight: 800; margin: 0; flex: 1; letter-spacing: -.3px; }
.close-portada {
    background: rgba(255,255,255,.12); border: none; color: white;
    font-size: 26px; cursor: pointer; width: 38px; height: 38px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.close-portada:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }
.portada-body { padding: 28px; }
.portada-section { margin-bottom: 28px; }
.portada-section-title {
    color: var(--azul-oscuro); font-size: 19px; font-weight: 800;
    margin-bottom: 15px; padding-bottom: 8px;
    border-bottom: 2px solid rgba(59,130,246,.25);
    display: flex; align-items: center; gap: 10px; letter-spacing: -.2px;
}
.portada-description {
    color: var(--azul-profundo); font-size: 15px; line-height: 1.8;
    margin-bottom: 20px; padding: 18px 20px;
    background: var(--neutro); border-radius: 12px;
    border-left: 3px solid var(--azul);
}
.portada-video-container {
    position: relative; width: 100%; background: #000;
    border-radius: 12px; overflow: hidden; margin-bottom: 20px;
    border: 1px solid rgba(59,130,246,.2);
}
.portada-video-container iframe { width: 100%; height: auto; aspect-ratio: 16/9; border: none; }
.portada-temario-card {
    background: var(--neutro); padding: 18px; border-radius: 12px;
    border-left: 3px solid var(--naranja); cursor: pointer;
    transition: all 0.3s; display: flex; align-items: center; gap: 15px;
}
.portada-temario-card:hover {
    background: rgba(59,130,246,.07); transform: translateX(4px);
    box-shadow: var(--sombra); border-color: var(--azul);
}
.portada-temario-icon { font-size: 38px; flex-shrink: 0; }
.portada-temario-info { flex: 1; }
.portada-temario-title { font-weight: 700; color: var(--azul-oscuro); font-size: 15px; margin-bottom: 5px; }
.portada-temario-subtitle { color: var(--gray); font-size: 13px; }
.portada-solicitud-section {
    background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(245,158,11,.06));
    padding: 24px; border-radius: 16px; text-align: center;
    border: 1px solid rgba(59,130,246,.2);
}
.portada-solicitud-title { color: var(--azul-oscuro); font-size: 20px; font-weight: 800; margin-bottom: 10px; letter-spacing: -.3px; }
.portada-solicitud-text { color: var(--gray); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.portada-btn-solicitud {
    background: linear-gradient(135deg, #3b7cf4, #2860c4); color: white;
    border: none; padding: 14px 40px; border-radius: 25px;
    font-size: 17px; font-weight: 700; cursor: pointer; transition: all 0.3s;
    display: inline-flex; align-items: center; gap: 10px;
    box-shadow: 0 6px 20px rgba(59,130,246,.35); font-family: inherit;
}
.portada-btn-solicitud:hover { transform: scale(1.04); box-shadow: 0 8px 28px rgba(59,130,246,.5); }
.portada-btn-solicitud:disabled { background: var(--gray); cursor: not-allowed; opacity: 0.5; }
.solicitud-pendiente-card {
    background: linear-gradient(135deg, rgba(52,211,153,.15), rgba(16,185,129,.1));
    border: 1px solid rgba(52,211,153,.25); color: var(--success);
    padding: 28px; border-radius: 16px; text-align: center;
}
.solicitud-pendiente-icon { font-size: 56px; margin-bottom: 15px; }
.solicitud-pendiente-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.solicitud-pendiente-text { font-size: 15px; line-height: 1.6; opacity: .9; }
.portada-whatsapp-btn {
    background: linear-gradient(to right, #25D366, #128C7E); color: white;
    border: none; padding: 12px 28px; border-radius: 25px;
    font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.3s;
    display: inline-flex; align-items: center; gap: 10px;
    margin-top: 15px; text-decoration: none; font-family: inherit;
}
.portada-whatsapp-btn:hover { transform: scale(1.04); box-shadow: 0 4px 16px rgba(37,211,102,.35); }

/* ── Módulo expandido ── */
.expanded-module { width: 100%; padding: 0; margin-bottom: 5px; }
.module-header { display: flex; align-items: center; margin-bottom: 15px; padding-bottom: 12px; }
.module-progress-expanded { margin: 15px 0; padding: 12px; text-align: center; }
.content-list-expanded { margin-top: 15px; margin-bottom: 5px; }

/* ── SVG icons ── */
.icon        { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.icon-play, .icon-pause, .icon-book, .icon-phone,
.icon-target, .icon-trophy, .icon-notes,
.icon-calendar, .icon-manual { width: 18px; height: 18px; }

/* ── Animaciones ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.modal-content > div[id^="forgotPasswordStep"] { animation: fadeIn 0.25s ease; }

#resetCode {
    font-family: 'Courier New', monospace; background: var(--neutro);
    border: 1px solid rgba(59,130,246,.3); letter-spacing: 6px;
    font-size: 24px; font-weight: 700; color: var(--azul-oscuro); text-align: center;
}
#resetCode:focus {
    border-color: rgba(59,130,246,.55); background: rgba(59,130,246,.07);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ════════════════════════════════
   MEDIA QUERIES
   ════════════════════════════════ */

@media (max-width: 926px) and (orientation: landscape) {
    :fullscreen .controls-panel { min-height: 80px !important; max-height: 80px !important; padding: 10px 15px !important; display: flex !important; align-items: center !important; justify-content: space-around !important; }
    :fullscreen .progress-row  { flex: 1; margin-right: 15px; }
    :fullscreen .video-controls { display: flex !important; gap: 10px !important; }
    :fullscreen .video-controls button { padding: 8px 12px !important; font-size: 12px !important; }

    .controls-panel { position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; background: rgba(0,0,0,.88) !important; backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transform: translateY(100%); transition: all 0.3s ease; z-index: 50; padding: 10px 15px !important; border-radius: 0 !important; }
    .controls-panel.show-controls-mobile { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; }
    .player-container { position: relative; }
    .video-container { width: 100% !important; height: 100vh !important; }
    .progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .video-controls { display: flex !important; gap: 8px !important; }
    .video-controls button { padding: 6px 10px !important; font-size: 11px !important; }
    .time-display { font-size: 12px !important; min-width: 80px !important; color: white !important; }
}

@media (max-width: 768px) {
    .container { padding: 10px 10px 5px; }
    .header-container { flex-direction: column; text-align: center; padding: 12px 15px; }
    .school-brand, .user-welcome { justify-content: center; text-align: center; min-width: auto; }
    .user-welcome { display: flex; flex-direction: column; align-items: center; }
    .course-content, .module-content { flex-direction: column; gap: 15px; }
    .course-image-container, .module-image-container { flex: 0 0 auto; width: 100%; max-width: 200px; margin: 0 auto; }
    .grid-cursos, .grid-modulos { grid-template-columns: 1fr; gap: 15px; }
    .player-container { padding: 10px; margin: 10px 0; }
    .modal-content, .survey-modal-content { padding: 18px; }
    .survey-body { padding: 15px; }
    .portada-promo-content { max-width: 100%; max-height: 100vh; border-radius: 0; }
    .portada-header { border-radius: 0; }
    .portada-title { font-size: 17px; }
    .portada-body { padding: 18px; }
    .portada-btn-solicitud { width: 100%; padding: 12px 20px; font-size: 15px; }
    .course-header-buttons { flex-direction: column; gap: 8px; }
    .course-header-btn { width: 100%; justify-content: center; }
    .lesson-quick-actions { display: flex; }
    .lesson-quick-actions .btn-text { display: none; }
    .lesson-accordion.active .lesson-quick-actions { display: none; }
    .lesson-accordion.active .lesson-actions { display: flex; }
    .section-title { font-size: 19px; }
}

@media (min-width: 769px) {
    .lesson-quick-actions { display: flex; }
    .lesson-quick-actions .btn-text { display: inline; }
    .lesson-accordion.active .lesson-actions { display: none; }
}

@media (max-width: 480px) {
    .form-container { width: 100%; max-width: 320px; padding: 24px 20px; }
    .btn { width: 100%; margin-right: 0; justify-content: center; }
    .modal-content { padding: 16px; }
    .lesson-actions { flex-direction: column; }
    .lesson-actions .btn { width: 100%; }
}
