/* ══════════════════════════════════════════════════════════════════════════ */
/* ECUACIONES.IO — INTERFAZ ESTILO NETFLIX / TEMA OSCURO PREMIUM              */
/* Inspirado en el catálogo visual de Netflix                                  */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens (8pt Grid + Netflix Color Palette) ──────────────────── */
:root {
    /* 8pt Spacing Grid */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;

    /* Netflix Color Palette */
    --color-bg-main: #141414;          /* Negro Netflix profundo */
    --color-bg-card: #1f1f1f;          /* Fondo de tarjetas */
    --color-bg-overlay: #000000cc;     /* Overlay semitransparente */
    --color-accent: #e50914;           /* Rojo Netflix */
    --color-accent-hover: #f40612;     /* Rojo hover */
    --color-accent-dim: rgba(229, 9, 20, 0.15);
    --color-accent-glow: rgba(229, 9, 20, 0.4);
    --color-text-primary: #ffffff;
    --color-text-secondary: #e5e5e5;
    --color-text-muted: #b3b3b3;
    --color-text-faint: #6d6d6e;
    --color-border: rgba(255, 255, 255, 0.08);

    /* Font */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Lato', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Slide dims for presenter mode */
    --slide-width: 1280px;
    --slide-height: 720px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--color-bg-main);
    font-family: var(--font-body);
    color: var(--color-text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 1. PANTALLA DE SELECCIÓN DE PERFILES                                       */
/* ══════════════════════════════════════════════════════════════════════════ */

#profile-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--color-bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#profile-screen.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.netflix-logo-top {
    position: absolute;
    top: var(--space-8);
    left: var(--space-12);
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-accent);
    letter-spacing: -1px;
}

.profile-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 400;
    color: var(--color-text-primary);
    margin-bottom: var(--space-12);
    letter-spacing: 0.5px;
}

.profiles-grid {
    display: flex;
    gap: var(--space-8);
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-4);
    border-radius: 4px;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 4px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-icon {
    width: 140px;
    height: 140px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    border: 3px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-card:hover .profile-avatar,
.profile-card:hover .profile-avatar-icon {
    border-color: var(--color-text-primary);
    transform: scale(1.08);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

.profile-name {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.profile-card:hover .profile-name {
    color: var(--color-text-primary);
}

.profile-manage {
    margin-top: var(--space-12);
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--color-text-muted);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: var(--font-body);
    transition: border-color 0.2s, color 0.2s;
}

.profile-manage:hover {
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 2. HEADER NETFLIX                                                           */
/* ══════════════════════════════════════════════════════════════════════════ */

#main-app {
    opacity: 0;
    transition: opacity 0.8s ease;
    min-height: 100vh;
}

#main-app.visible { opacity: 1; }

#netflix-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-12);
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
    transition: background 0.4s ease;
}

#netflix-header.scrolled {
    background: rgba(20, 20, 20, 0.96);
    backdrop-filter: blur(8px);
}

.header-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-accent);
    letter-spacing: -1px;
    cursor: pointer;
    text-decoration: none;
}

.header-logo span { color: #fff; }

.header-nav {
    display: flex;
    gap: var(--space-6);
    align-items: center;
}

.header-nav a {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 400;
}

.header-nav a:hover { color: var(--color-text-primary); }
.header-nav a.active { color: var(--color-text-primary); font-weight: 600; }

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.header-profile-mini {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.header-profile-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-profile-mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 3. HERO BANNER (BILLBOARD)                                                  */
/* ══════════════════════════════════════════════════════════════════════════ */

#hero-banner {
    position: relative;
    height: 85vh;
    min-height: 540px;
    display: flex;
    align-items: flex-end;
    padding-bottom: var(--space-16);
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
    opacity: 0.65;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(20,20,20,0.95) 35%, transparent 80%),
        linear-gradient(to top, rgba(20,20,20,1) 0%, rgba(20,20,20,0.2) 40%),
        linear-gradient(135deg, rgba(13,2,33,0.5) 0%, rgba(26,0,48,0.5) 30%, rgba(26,5,5,0.5) 70%, rgba(13,13,13,0.5) 100%);
    overflow: hidden;
    z-index: 1;
}

/* Animated math symbols floating in the background */
.hero-bg::before {
    content: 'x²  ∑  ∫  =  π  √  ≠  ∞  ±  ≤  ≥  Δ  λ';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(229, 9, 20, 0.04);
    font-family: var(--font-mono);
    letter-spacing: 2.5rem;
    white-space: nowrap;
    overflow: hidden;
    animation: bgDrift 30s linear infinite;
}

@keyframes bgDrift {
    0% { transform: translateX(0) scale(1); }
    50% { transform: translateX(-5%) scale(1.02); }
    100% { transform: translateX(0) scale(1); }
}

/* Floating slide thumbnails (subtle 3D) */
.hero-floating-slides {
    position: absolute;
    right: 0;
    top: 0;
    width: 60%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-16);
    perspective: 800px;
    pointer-events: none;
}

.floating-card {
    position: absolute;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    background: var(--color-bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.15);
    font-family: var(--font-mono);
    font-size: 2.5rem;
}

.floating-card:nth-child(1) {
    width: 340px; height: 200px;
    right: 80px; top: 15%;
    transform: rotateY(-12deg) rotateX(4deg) translateZ(0px);
    animation: float1 8s ease-in-out infinite;
    z-index: 3;
}
.floating-card:nth-child(2) {
    width: 280px; height: 165px;
    right: 60px; top: 42%;
    transform: rotateY(-8deg) rotateX(2deg) translateZ(-60px);
    animation: float2 10s ease-in-out infinite;
    z-index: 2;
    opacity: 0.7;
}
.floating-card:nth-child(3) {
    width: 220px; height: 130px;
    right: 380px; top: 18%;
    transform: rotateY(-15deg) rotateX(6deg) translateZ(-120px);
    animation: float3 12s ease-in-out infinite;
    z-index: 1;
    opacity: 0.4;
}

@keyframes float1 {
    0%, 100% { transform: rotateY(-12deg) rotateX(4deg) translateY(0px); }
    50% { transform: rotateY(-10deg) rotateX(3deg) translateY(-14px); }
}
@keyframes float2 {
    0%, 100% { transform: rotateY(-8deg) rotateX(2deg) translateY(0px); }
    50% { transform: rotateY(-6deg) rotateX(1deg) translateY(-10px); }
}
@keyframes float3 {
    0%, 100% { transform: rotateY(-15deg) rotateX(6deg) translateY(0px); }
    50% { transform: rotateY(-13deg) rotateX(5deg) translateY(-18px); }
}

.hero-content {
    position: relative;
    z-index: 10;
    padding-left: var(--space-12);
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-4);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: var(--space-4);
    text-shadow: 2px 4px 20px rgba(0,0,0,0.5);
}

.hero-title .red { color: var(--color-accent); }

.hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    font-size: 0.85rem;
}

.hero-meta .match { color: #46d369; font-weight: 700; }
.hero-meta .year, .hero-meta .rating, .hero-meta .duration {
    color: var(--color-text-muted);
}
.hero-meta .rating {
    border: 1px solid var(--color-text-muted);
    padding: 1px 6px;
    border-radius: 2px;
}

.hero-description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin-bottom: var(--space-8);
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 12px 28px;
    background: var(--color-text-primary);
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: var(--font-body);
}

.btn-play:hover {
    background: rgba(255,255,255,0.85);
    transform: scale(1.02);
}

.btn-more-info {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 12px 24px;
    background: rgba(109, 109, 110, 0.7);
    color: var(--color-text-primary);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body);
    text-decoration: none;
}

.btn-more-info:hover { background: rgba(109, 109, 110, 0.5); }

/* Bottom vignette */
#hero-banner::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 180px;
    background: linear-gradient(to bottom, transparent 0%, var(--color-bg-main) 100%);
    z-index: 5;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 4. CONTENIDO PRINCIPAL — FILAS DE CARRUSEL                                 */
/* ══════════════════════════════════════════════════════════════════════════ */

#browse-content {
    padding: 0 0 var(--space-16);
    position: relative;
    z-index: 10;
}

.netflix-row {
    margin-bottom: var(--space-12);
    position: relative;
}

.netflix-row-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-4);
    padding: 0 var(--space-12);
    margin-bottom: var(--space-4);
}

.netflix-row-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    font-family: var(--font-heading);
}

.netflix-row-see-all {
    font-size: 0.8rem;
    color: #54b3d6;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    font-weight: 500;
}

.netflix-row:hover .netflix-row-see-all { opacity: 1; }

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding: var(--space-4) 0;
}

.carousel-track {
    display: flex;
    gap: var(--space-2);
    padding: 0 var(--space-12);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Carousel scroll buttons */
.carousel-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--space-12);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 20, 0.5);
    border: none;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.carousel-btn:hover { background: rgba(20, 20, 20, 0.8); }
.carousel-btn.prev { left: 0; border-radius: 0 4px 4px 0; }
.carousel-btn.next { right: 0; border-radius: 4px 0 0 4px; }

.carousel-wrapper:hover .carousel-btn { opacity: 1; }

/* ── Tarjeta de Diapositiva (Netflix Card) ─────────────────────────────── */
.slide-card {
    flex: 0 0 auto;
    width: 280px;
    border-radius: 6px;
    overflow: visible;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, z-index 0s;
    z-index: 1;
}

.slide-card:hover {
    transform: scale(1.18);
    z-index: 50;
}

/* Edge cards shouldn't overflow the edge */
.slide-card:first-child:hover { transform-origin: left center; }
.slide-card:last-child:hover  { transform-origin: right center; }

.slide-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--color-bg-card);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.06);
}

.slide-card-thumb-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    gap: var(--space-2);
    text-align: center;
}

.slide-card-icon {
    font-size: 2rem;
    margin-bottom: var(--space-2);
}

.slide-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.7);
    line-height: 1.3;
}

.slide-card-math {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    margin-top: var(--space-1);
}

/* Hover info panel */
.slide-card-info {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: #181818;
    border-radius: 0 0 6px 6px;
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 51;
}

.slide-card:hover .slide-card-info { opacity: 1; }

.slide-card-actions {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.card-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.5);
    background: transparent;
    color: var(--color-text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.card-btn.play {
    background: var(--color-text-primary);
    color: #000;
    border-color: var(--color-text-primary);
}

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

.slide-card-info-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.slide-card-info-tags {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.65rem;
    color: var(--color-text-muted);
}

.card-tag.green { color: #46d369; font-weight: 700; }

/* Color themes per row */
.row-theme-red    .slide-card-thumb-inner { background: linear-gradient(135deg, #2d0000 0%, #1a0000 100%); }
.row-theme-blue   .slide-card-thumb-inner { background: linear-gradient(135deg, #00102d 0%, #001a45 100%); }
.row-theme-purple .slide-card-thumb-inner { background: linear-gradient(135deg, #1a0030 0%, #0d0020 100%); }
.row-theme-green  .slide-card-thumb-inner { background: linear-gradient(135deg, #002014 0%, #001a10 100%); }
.row-theme-amber  .slide-card-thumb-inner { background: linear-gradient(135deg, #2d1a00 0%, #1a1000 100%); }

/* ── Netflix-style Video Preview Overlay ─────────────────────────────────── */
.card-video-container {
    position: absolute;
    inset: 0;
    border-radius: 6px;
    overflow: hidden;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.5s ease-in;
    background: #000;
}
.card-video-container.visible { opacity: 1; }
.card-video-container iframe {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%) scale(1.35);
    border: none;
    pointer-events: none;
}
.card-video-container video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Channel badge shown during preview */
.card-video-badge {
    position: absolute;
    bottom: 8px; left: 8px;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.4s ease 0.8s;
}
.card-video-badge.visible { opacity: 1; }
.card-video-badge::before { content: '▶ '; color: var(--color-accent); font-size: 0.55rem; }


/* ══════════════════════════════════════════════════════════════════════════ */
/* 5. PANEL DE CONTENIDO (Diapositiva expandida)                              */
/* ══════════════════════════════════════════════════════════════════════════ */

#slide-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: var(--space-8);
}

#slide-modal.open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: #181818;
    border-radius: 8px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 80px rgba(0,0,0,0.9);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#slide-modal.open .modal-box { transform: scale(1); }

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 36px;
    height: 36px;
    background: #181818;
    border: none;
    border-radius: 50%;
    color: var(--color-text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover { background: #2a2a2a; }

.modal-hero {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a0000 0%, #0d0d1a 100%);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: var(--space-8);
    background-size: cover !important;
    background-position: center !important;
}

.modal-hero-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    opacity: 0.08;
    font-family: var(--font-mono);
    pointer-events: none;
}

.modal-hero-content {
    position: relative;
    z-index: 2;
}

.modal-hero-title {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-heading);
    margin-bottom: var(--space-4);
    text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

.modal-hero-actions {
    display: flex;
    gap: var(--space-3);
}

.modal-bottom {
    padding: var(--space-6) var(--space-8);
}

.modal-bottom-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-8);
    align-items: start;
    margin-bottom: var(--space-6);
}

.modal-description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
}

.modal-meta { font-size: 0.875rem; }
.modal-meta-label { color: var(--color-text-faint); }
.modal-meta-value { color: var(--color-text-secondary); }

.modal-content-area {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: var(--space-6);
}

/* Math styling inside modal */
.modal-math-box {
    background: rgba(229, 9, 20, 0.04);
    border-left: 4px solid var(--color-accent);
    padding: var(--space-4) var(--space-6);
    border-radius: 0 8px 8px 0;
    margin: var(--space-4) 0;
    font-size: 0.95rem;
    line-height: 1.8;
}

.modal-step-pill {
    display: inline-block;
    background: var(--color-accent);
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 700;
    margin-right: var(--space-2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-solution-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1rem;
    font-weight: 700;
    color: #46d369;
    margin-top: var(--space-4);
}

/* Modal table */
.modal-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-4) 0;
    font-size: 0.875rem;
}

.modal-table thead { background: rgba(255,255,255,0.04); }
.modal-table th { padding: var(--space-3) var(--space-4); text-align: left; color: #54b3d6; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.modal-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--color-text-secondary); }
.modal-table td.mono { font-family: var(--font-mono); color: #54b3d6; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* 6. MODO PRESENTADOR (Fullscreen slide mode)                                 */
/* ══════════════════════════════════════════════════════════════════════════ */

#presenter-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--color-bg-main);
    display: none;
    flex-direction: column;
}

#presenter-overlay.active { display: flex; }

.presenter-slide-view {
    flex: 1;
    display: flex;
    padding: var(--space-16) var(--space-12);
    overflow-y: auto; /* Permite scroll si el contenido es mas grande que la pantalla */
}

.presenter-slide-inner {
    margin: auto; /* Centrado inteligente que evita cortes superiores */
    width: 100%;
    max-width: 1100px; /* Ancho balanceado para presentaciones */
    background: #181818;
    border-radius: 12px;
    border: 1px solid rgba(229, 9, 20, 0.15);
    padding: 60px 80px; /* Mas espacio de respiro interior */
    min-height: 400px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(229,9,20,0.1);
}

.presenter-bar {
    height: 80px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: 0 var(--space-8);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.presenter-bar .btn {
    font-size: 1.2rem;
    padding: 12px 24px;
}
#pbar-indicator {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 20px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* OPTIMIZACIÓN DE PROYECTOR MULTIMEDIA (10+ METROS) PARA MODO PRESENTADOR   */
/* ══════════════════════════════════════════════════════════════════════════ */

#presenter-overlay h2 { font-size: 2.5rem !important; }
#presenter-overlay h2 span { font-size: 3rem !important; }
#presenter-overlay p { font-size: 1.3rem !important; line-height: 1.5 !important; }
#presenter-overlay .modal-math-box { font-size: 1.4rem !important; padding: 24px !important; margin: 20px 0 !important; }
#presenter-overlay .modal-math-box .modal-step-pill { font-size: 1.1rem !important; padding: 6px 12px !important; }
#presenter-overlay .modal-solution-tag { font-size: 1.6rem !important; margin-top: 24px !important; }
#presenter-overlay .modal-table th, #presenter-overlay .modal-table td { font-size: 1.2rem !important; padding: 16px !important; }

/* Escalar de forma inteligente pero equilibrada los estilos inline */
#presenter-overlay [style*="font-size:0.7rem"],
#presenter-overlay [style*="font-size: 0.7rem"] { font-size: 1.1rem !important; }
#presenter-overlay [style*="font-size:0.8rem"],
#presenter-overlay [style*="font-size: 0.8rem"] { font-size: 1.2rem !important; }
#presenter-overlay [style*="font-size:0.85rem"],
#presenter-overlay [style*="font-size: 0.85rem"] { font-size: 1.3rem !important; }
#presenter-overlay [style*="font-size:0.9rem"],
#presenter-overlay [style*="font-size: 0.9rem"] { font-size: 1.4rem !important; }
#presenter-overlay [style*="font-size:1rem"],
#presenter-overlay [style*="font-size: 1rem"] { font-size: 1.5rem !important; }
#presenter-overlay [style*="font-size:1.05rem"],
#presenter-overlay [style*="font-size: 1.05rem"] { font-size: 1.6rem !important; }
#presenter-overlay [style*="font-size:1.1rem"],
#presenter-overlay [style*="font-size: 1.1rem"] { font-size: 1.7rem !important; }
#presenter-overlay [style*="font-size:1.2rem"],
#presenter-overlay [style*="font-size: 1.2rem"] { font-size: 1.8rem !important; }
#presenter-overlay [style*="font-size:1.4rem"],
#presenter-overlay [style*="font-size: 1.4rem"] { font-size: 2rem !important; }
#presenter-overlay [style*="font-size:1.5rem"],
#presenter-overlay [style*="font-size: 1.5rem"] { font-size: 2.2rem !important; }
#presenter-overlay [style*="font-size:2rem"],
#presenter-overlay [style*="font-size: 2rem"] { font-size: 2.8rem !important; }
#presenter-overlay [style*="font-size:2.5rem"],
#presenter-overlay [style*="font-size: 2.5rem"] { font-size: 3.5rem !important; }
#presenter-overlay [style*="font-size:3rem"],
#presenter-overlay [style*="font-size: 3rem"] { font-size: 4rem !important; }
#presenter-overlay [style*="font-size:5rem"],
#presenter-overlay [style*="font-size: 5rem"] { font-size: 6rem !important; }

/* Separaciones mayores para proyectores */
#presenter-overlay [style*="margin-bottom:12px"] { margin-bottom: 24px !important; }
#presenter-overlay [style*="margin-bottom:16px"] { margin-bottom: 32px !important; }
#presenter-overlay [style*="margin-bottom:20px"] { margin-bottom: 40px !important; }
#presenter-overlay [style*="padding:20px"] { padding: 40px !important; }
#presenter-overlay [style*="padding:24px"] { padding: 48px !important; }

.pbar-btn {
    padding: var(--space-2) var(--space-6);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--color-text-primary);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body);
}

.pbar-btn:hover { background: rgba(255,255,255,0.15); }
.pbar-btn.exit { background: var(--color-accent); border-color: var(--color-accent); }
.pbar-btn.exit:hover { background: var(--color-accent-hover); }

.pbar-indicator {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 7. AI WORKSHOP SECTION                                                      */
/* ══════════════════════════════════════════════════════════════════════════ */

#ai-section {
    padding: var(--space-8) var(--space-12);
    margin: var(--space-8) 0;
}

.ai-section-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
}

.ai-panels {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: var(--space-6);
}

.ai-panel {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: var(--space-6);
}

.ai-panel-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.ai-output-box {
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: var(--space-3);
    min-height: 160px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    overflow-y: auto;
    margin: var(--space-3) 0;
}

.ai-select {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--color-text-primary);
    padding: var(--space-2) var(--space-3);
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: var(--font-body);
    margin-bottom: var(--space-3);
    appearance: none;
    cursor: pointer;
}

.ai-textarea {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--color-text-primary);
    padding: var(--space-3);
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: var(--font-body);
    resize: none;
    min-height: 80px;
}

.ai-textarea:focus, .ai-select:focus { outline: 1px solid var(--color-accent); }

.btn-netflix-red {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-6);
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: var(--font-body);
}

.btn-netflix-red:hover { background: var(--color-accent-hover); transform: scale(1.02); }
.btn-netflix-red:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

.btn-netflix-grey {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(109, 109, 110, 0.5);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body);
}

.btn-netflix-grey:hover { background: rgba(109, 109, 110, 0.7); }
.btn-netflix-grey:disabled { opacity: 0.4; cursor: not-allowed; }

.step-pill {
    display: inline-block;
    background: var(--color-accent);
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 700;
    margin-right: var(--space-2);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 8. FOOTER                                                                   */
/* ══════════════════════════════════════════════════════════════════════════ */

#browse-footer {
    padding: var(--space-8) var(--space-12);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-accent);
    margin-bottom: var(--space-4);
}

.footer-text {
    font-size: 0.75rem;
    color: var(--color-text-faint);
    line-height: 1.7;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 9. TOAST NOTIFICATIONS                                                      */
/* ══════════════════════════════════════════════════════════════════════════ */

#toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}

#toast-container > * { pointer-events: auto; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* 10. ACCESSIBILITY & UTILITIES                                               */
/* ══════════════════════════════════════════════════════════════════════════ */

button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-accent) !important;
    outline-offset: 3px !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Virtual Laser Pointer */
#virtual-laser {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--color-accent);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 9998;
    transition: opacity 0.3s;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 25px 10px rgba(229, 9, 20, 0.6);
}

/* Scroll Reveal — staggered entry per row */
.reveal {
    opacity: 0;
    transform: translateY(48px);
    transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
/* Staggered delay for child elements inside a revealed section */
.reveal.visible .slide-card:nth-child(1) { transition-delay: 0.04s; }
.reveal.visible .slide-card:nth-child(2) { transition-delay: 0.10s; }
.reveal.visible .slide-card:nth-child(3) { transition-delay: 0.16s; }
.reveal.visible .slide-card:nth-child(4) { transition-delay: 0.22s; }
.reveal.visible .slide-card:nth-child(5) { transition-delay: 0.28s; }
.slide-card {
    /* ensure child cards start invisible until parent reveals */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s cubic-bezier(0.16,1,0.3,1),
                transform 0.55s cubic-bezier(0.16,1,0.3,1),
                scale 0.3s ease, z-index 0s;
}
.reveal.visible .slide-card { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════════════════════════════════════ */
/* REMOTE CONTROL BUTTON & QR MODAL                                           */
/* ══════════════════════════════════════════════════════════════════════════ */

.btn-remote {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(229,9,20,0.15);
    border: 1px solid rgba(229,9,20,0.4);
    color: var(--color-accent);
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    position: relative;
}
.btn-remote:hover {
    background: rgba(229,9,20,0.3);
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(229,9,20,0.35);
}
.btn-remote .pulse-dot {
    position: absolute;
    top: -3px; right: -3px;
    width: 9px; height: 9px;
    background: #46d369;
    border-radius: 50%;
    border: 2px solid var(--color-bg-main);
    animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(1.35); }
}

/* QR Modal */
#qr-modal {
    position: fixed; inset: 0;
    z-index: 800;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
#qr-modal.open { opacity: 1; pointer-events: all; }

.qr-box {
    background: #1c1c1c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 36px;
    max-width: 380px; width: 90%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    transform: scale(0.88);
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
    position: relative;
}
#qr-modal.open .qr-box { transform: scale(1); }

.qr-close {
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.08);
    border: none; border-radius: 50%;
    color: #fff; font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.qr-close:hover { background: rgba(255,255,255,0.16); }

.qr-title {
    font-family: var(--font-heading);
    font-size: 1.15rem; font-weight: 800;
    color: #fff; margin-bottom: 6px;
}
.qr-subtitle {
    font-size: 0.82rem; color: var(--color-text-muted);
    margin-bottom: 24px; line-height: 1.5;
}
.qr-img-wrapper {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 0 0 4px rgba(229,9,20,0.2);
}
.qr-img-wrapper img { display: block; width: 200px; height: 200px; }
.qr-url {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-accent);
    word-break: break-all;
    background: rgba(229,9,20,0.07);
    padding: 8px 12px; border-radius: 6px;
    margin-bottom: 18px;
    border: 1px solid rgba(229,9,20,0.15);
}
.qr-steps {
    list-style: none;
    text-align: left;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    display: flex; flex-direction: column; gap: 6px;
}
.qr-steps li { display: flex; align-items: center; gap: 8px; }
.qr-steps li span { color: var(--color-accent); font-weight: 700; font-size: 0.7rem; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE DESIGNS (MOBILE)                                                */
/* ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Perfiles */
    .profiles-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .profile-avatar { width: 90px; height: 90px; }
    
    /* Cabecera */
    #netflix-header { padding: 12px 16px; }
    .nav-links { display: none; }
    .brand-logo { font-size: 1.3rem; }
    .user-actions { gap: 12px; }

    /* Hero Banner */
    #hero-banner { 
        height: auto; min-height: 70vh; 
        padding-top: 100px; padding-bottom: 40px; 
        align-items: center; text-align: center;
    }
    .hero-content { margin: 0 auto; padding: 0 20px; }
    .hero-title { font-size: 2.2rem; }
    .hero-desc { font-size: 1rem; max-width: 100%; margin: 16px auto 24px; }
    .hero-floating-slides { display: none; }
    .hero-actions { flex-direction: column; width: 100%; }
    .btn-hero { width: 100%; justify-content: center; }

    /* Carruseles */
    .carousel-track { 
        overflow-x: auto; padding: 16px; 
        scroll-snap-type: x mandatory; 
        -webkit-overflow-scrolling: touch; 
        scrollbar-width: none; 
    }
    .carousel-track::-webkit-scrollbar { display: none; }
    .carousel-btn { display: none !important; }
    .slide-card { scroll-snap-align: start; min-width: 220px; }
    .slide-card:hover { transform: none; box-shadow: none; z-index: 1; }
    
    /* Taller IA */
    .ai-panels { grid-template-columns: 1fr; gap: 16px; }
    #ai-section { padding: 0 16px; }
    
    /* Modal de Diapositiva */
    .modal-box { width: 95%; margin: 20px auto; max-height: 90vh; }
    .modal-hero { padding: 20px; aspect-ratio: 16/10; }
    .modal-hero-bg { font-size: 4rem; }
    .modal-hero-title { font-size: 1.5rem; }
    
    /* Forzar apilamiento de grillas en contenido inline */
    .modal-body [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    .modal-body table.modal-table th, .modal-body table.modal-table td {
        font-size: 0.8rem; padding: 6px;
    }
    
    /* Presentador */
    #presenter-slide-title { font-size: 1.4rem; }
    #presenter-controls { flex-wrap: wrap; justify-content: center; gap: 10px; }
    #presenter-controls button { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 11. PRINT / PDF EXPORT                                                      */
/* ══════════════════════════════════════════════════════════════════════════ */

@media print {
    @page { size: A4 portrait; margin: 1.5cm; }

    #profile-screen,
    #netflix-header,
    #hero-banner,
    #slide-modal,
    #presenter-overlay,
    #virtual-laser,
    .carousel-btn,
    #toast-container { display: none !important; }

    body { background: white !important; color: #0f172a !important; }

    #main-app { opacity: 1 !important; }
    #browse-content { padding: 0 !important; }

    .netflix-row { margin-bottom: 20px !important; page-break-inside: avoid; }
    .netflix-row-header { padding: 0 !important; }
    .netflix-row-title { color: #0f172a !important; border-bottom: 2px solid #e50914; padding-bottom: 4px; }

    .carousel-track { flex-wrap: wrap !important; transform: none !important; padding: 0 !important; gap: 12px !important; }
    .slide-card { width: 200px !important; transform: none !important; }
    .slide-card-thumb-inner { background: #f8fafc !important; border: 1px solid #e2e8f0 !important; }
    .slide-card-label { color: #0f172a !important; }
    .slide-card-icon { color: #e50914 !important; }
    .slide-card-info { display: none !important; }

    .modal-math-box { background: #fef2f2 !important; border-color: #e50914 !important; color: #0f172a !important; }
    .modal-step-pill { background: #e50914 !important; }

    #ai-section { display: none !important; }
}
