:root {
    --bg-window: #13121A;      /* Fondo exterior más oscuro */
    --bg-main: #1C1A24;        /* Fondo del contenedor principal */
    --bg-card: #252233;        /* Fondo de tarjetas */
    --border-color: rgba(255, 255, 255, 0.04);
    
    /* Sapphire UI Accents */
    --accent-purple: #9D74FF;
    --accent-pink: #F87171;
    --accent-blue: #38BDF8;
    
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
}

/* =========================================
   SISTEMA DE AUTENTICACIÓN — ESTILOS BASE
   ========================================= */

/* Overlay con transición de opacidad (NO display toggle) */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,9,20,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    /* Invisible por defecto */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.auth-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* Animación de entrada de la card del modal */
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.auth-modal-card {
    animation: authCardIn 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

/* Spinner inline para botones de submit */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.btn-auth-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* Toast de notificación no bloqueante */
.auth-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: #1e1c2e;
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 14px 22px;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 99999;
    transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.3s;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    white-space: nowrap;
}

.auth-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.auth-toast.warning { border-color: rgba(251,191,36,0.4); }
.auth-toast.error   { border-color: rgba(248,113,113,0.4); }
.auth-toast.success { border-color: rgba(52,211,153,0.4); }

body {
    margin: 0; padding: 0; 
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-window); 
    color: var(--text-main); 
    height: 100vh; 
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Efectos de luz traseros estilo Sapphire UI */
body::before {
    content: ""; position: absolute; top: -100px; left: 20%; width: 400px; height: 400px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    filter: blur(120px); opacity: 0.15; z-index: -1; pointer-events: none;
}
body::after {
    content: ""; position: absolute; bottom: -100px; right: 20%; width: 500px; height: 500px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    filter: blur(150px); opacity: 0.1; z-index: -1; pointer-events: none;
}

.app-container { 
    display: flex; 
    width: 98vw; 
    height: 96vh; 
    background-color: transparent;
}

/* SIDEBAR Sapphire Style (Integrada pero visualmente separada) */
.sidebar { 
    width: 250px; padding: 30px 20px; 
    display: flex; flex-direction: column; z-index: 10;
}

.logo { 
    margin-bottom: 50px; padding-left: 10px; display: flex; align-items: center; gap: 12px;
}
.logo .dot { 
    width: 28px; height: 28px; 
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue)); 
    border-radius: 8px; box-shadow: 0 0 20px rgba(157, 116, 255, 0.4);
}
.logo h2 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px;}

.section-label { 
    font-size: 0.7rem; color: #475569; font-weight: 800; letter-spacing: 1px; 
    padding-left: 15px; margin-bottom: 15px; text-transform: uppercase;
}

.menu { margin-bottom: 30px; }
.menu a { 
    display: flex; align-items: center; padding: 12px 15px; color: var(--text-muted); 
    text-decoration: none; border-radius: 12px; margin-bottom: 4px; transition: all 0.2s ease; font-weight: 500; font-size: 0.95rem;
}
.menu a:hover { color: white; background: rgba(255,255,255,0.03); }
.menu a.active { 
    background: rgba(255,255,255,0.06); color: white; 
}
.menu a.active .icon { color: var(--accent-purple); }

.menu .icon { margin-right: 14px; font-size: 1.1rem; opacity: 0.9; }

/* CONTENIDO PRINCIPAL (La gran tarjeta flotante) */
.main-content { 
    flex: 1;
    padding: 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    border-radius: 30px; 
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    margin: 10px 10px 10px 0;
}

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-shrink: 0; }
.topbar .greeting { font-size: 1rem; color: var(--text-muted); margin: 0 0 5px 0;}
.topbar h1 { font-size: 2.2rem; font-weight: 700; margin: 0; letter-spacing: -0.5px; }


/* Search & Profile */
.topbar-right { display: flex; align-items: center; gap: 20px; }
.search-bar { background: var(--bg-card); padding: 10px 20px; border-radius: 20px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-color);}
.search-bar input { background: transparent; border: none; color: white; outline: none; font-family: 'Outfit';}

/* VISTAS — Llenan el espacio restante de main-content (flex column) */
.view-section {
    flex: 1;
    min-height: 0;
    overflow-y: auto; /* Permitir scroll interno si el contenido (grid) es muy alto */
    overflow-x: hidden;
    padding-right: 5px; /* Pequeño espacio para el scrollbar */
}

/* Estilo para el scrollbar dentro de las vistas */
.view-section::-webkit-scrollbar { width: 6px; }
.view-section::-webkit-scrollbar-track { background: transparent; }
.view-section::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 10px; }
.view-section::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.1); }


/* GRID Y TARJETAS */
.dashboard-grid { display: grid; grid-template-columns: 1.6fr 1.1fr; gap: 25px; }

.card { 
    background: var(--bg-card); border-radius: 24px; padding: 30px; 
    border: 1px solid rgba(255, 255, 255, 0.02);
    position: relative; overflow: hidden;
}

.card.ai-featured {
    padding: 0;
    background: linear-gradient(145deg, #241e3d, #14131d);
    border: 1px solid rgba(157, 116, 255, 0.2);
}
.ai-featured-content { padding: 40px; position:relative; z-index: 2; }
.ai-featured h2 { margin: 0 0 10px 0; font-size: 2rem; background: linear-gradient(90deg, #fff, var(--accent-blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.ai-featured-glow {
    position: absolute; right: -50px; bottom: -50px; width: 300px; height: 300px;
    background: radial-gradient(circle, var(--accent-pink) 0%, var(--accent-purple) 40%, transparent 70%);
    filter: blur(40px); opacity: 0.3; z-index: 1;
}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;}
.card-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; display:flex; align-items:center; gap:8px;}

/* Estilos de tabla / listas */
.status-row { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 18px 0; border-bottom: 1px solid var(--border-color); font-size: 0.95rem;
}
.status-row:last-child { border-bottom: none; }
.status-row .label { display: flex; align-items: center; gap: 15px; font-weight: 500;}
.status-row .icon-box { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,0.03); display: flex; justify-content: center; align-items: center;}

.pill { padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px;}
.pill.pending { background: rgba(245, 158, 11, 0.1); color: #FCD34D;}
.pill.ok { background: rgba(16, 185, 129, 0.1); color: #34D399;}

/* Dropzone Premium */
.drop-zone { 
    margin-top: 20px; border: 2px dashed rgba(157, 116, 255, 0.3); border-radius: 16px; 
    padding: 50px 20px; text-align: center; background: rgba(157, 116, 255, 0.02); 
    transition: all 0.3s ease; cursor: pointer;
}
.drop-zone:hover { background: rgba(157, 116, 255, 0.08); border-color: var(--accent-purple); }

.upload-icon { font-size: 3rem; margin-bottom: 15px; filter: hue-rotate(45deg); opacity: 0.8;}
.drop-zone h4 { margin: 0 0 5px 0; font-size: 1.2rem; font-weight: 600; color: white;}
.drop-zone p { margin: 0; color: var(--text-muted); font-size: 0.9rem;}

.btn-upload {
    background: rgba(255,255,255,0.05); color: white; border: 1px solid var(--border-color);
    padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: 'Outfit';
}
.btn-upload:hover { background: var(--accent-purple); border-color: var(--accent-purple); color: black;}

/* --- BIBLIOTECA DE AULAS (AULAS VIEW) --- */
.view-section h1 {
    font-size: 2.2rem;
    margin-bottom: 30px;
}

#aulas-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.curso-section {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 25px;
}

.curso-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trimestre-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 18px;
    margin-bottom: 15px;
    overflow: hidden;
}

.trimestre-header {
    padding: 18px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    transition: 0.3s;
}

.trimestre-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.trimestre-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--accent-purple);
}

.asignatura-group {
    padding: 10px 25px 25px 25px;
}

.asignatura-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 20px 0 15px 0;
    border-left: 2px solid var(--accent-blue);
    padding-left: 10px;
}

/* TARJETA DE CLASE PREMIUM */
.class-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.class-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 16px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.class-card:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(157, 116, 255, 0.2);
}

.class-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.class-badge {
    width: 32px;
    height: 32px;
    background: rgba(157, 116, 255, 0.1);
    color: var(--accent-purple);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
}

.class-card h4 {
    margin: 0;
    font-weight: 500;
    font-size: 1rem;
    color: #f1f5f9;
}

/* ACCIONES DE LA CLASE (MULTIMEDIA) */
.class-actions {
    display: flex;
    gap: 10px;
}

.media-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.1rem;
    position: relative;
}

.media-btn:hover {
    background: var(--accent-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(157, 116, 255, 0.3);
}

.media-btn.disabled {
    opacity: 0.15;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
}

/* Tooltips básicos */
.media-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.media-btn:hover::after {
    opacity: 1;
}

/* --- COLA DE SUBIDA MULTIPLE --- */
#upload-queue {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 28vh; /* Ajuste adaptativo para evitar recortes en laptops */
    overflow-y: auto;
    padding-right: 10px;
}

#upload-queue::-webkit-scrollbar { width: 4px; }
#upload-queue::-webkit-scrollbar-track { background: transparent; }
#upload-queue::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
#upload-queue::-webkit-scrollbar-thumb:hover { background: var(--accent-purple); }

.upload-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    text-align: left;
    flex-shrink: 0; /* EVITAR QUE SE ENCOJAN AL HABER MUCHOS */
}

.upload-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.upload-name {
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.upload-status {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.upload-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Identificadores de estado dinámicos */
.upload-item.en-cola .upload-progress-fill { background: rgba(255, 255, 255, 0.1); }
.upload-item.procesando .upload-progress-fill { background: linear-gradient(90deg, var(--accent-pink), var(--accent-purple)); }
.upload-item.conversion .upload-progress-fill { background: linear-gradient(90deg, var(--accent-blue), #10B981); }
.upload-item.completado { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.05); }
.upload-item.error .upload-progress-fill { background: #EF4444; }

/* DETALLES DE CONTROL Y PESO */
.upload-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-cancel {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.1);
    color: #F87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 900;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
    transform: scale(1.1);
}

.upload-item.completado .btn-cancel,
.upload-item.error .btn-cancel {
    display: none; /* Ocultar al terminar */
}

/* ========================================= */
/* NETFLIX UI - PORTADAS Y LISTADOS INMERSIVOS */
/* ========================================= */

.netflix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 20px;
    padding: 10px; /* Espacio interno para que el escalado no se corte */
}

.netflix-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    aspect-ratio: 2/3;
    background: #111119; /* Placeholder oscuro */
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.netflix-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    z-index: 10;
}

.netflix-card img.cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.netflix-card:hover img.cover {
    opacity: 0.4;
}

.netflix-card .card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    display: flex;
    flex-direction: column;
}

.netflix-card .card-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 5px;
}

.netflix-card .card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-edit-cover {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    z-index: 20;
}

.netflix-card:hover .btn-edit-cover {
    opacity: 1;
}

.btn-edit-cover:hover {
    background: var(--accent-pink);
    transform: scale(1.1);
}

/* Tipos Teórico / Práctico (Minimalista) */
.type-tabs {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.type-tab {
    padding: 15px 0;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.type-tab.active, .type-tab:hover {
    color: white;
    border-bottom-color: var(--accent-pink);
}

/* Lista de Clases (Netflix Style) */
.episode-list {
    display: flex;
    flex-direction: column;
}

.episode-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 16px;
    margin-bottom: 4px;
    background: transparent;
    border: 1px solid transparent;
}

.episode-row:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.01) 0%, rgba(255,255,255,0.03) 100%);
    border-color: rgba(255,255,255,0.05);
    transform: scale(1.01);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.episode-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255,255,255,0.15);
    background: transparent;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.episode-row:hover .episode-number {
    color: white;
    -webkit-text-stroke: 0px transparent;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.episode-title {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 400;
    color: #94A3B8;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.episode-row:hover .episode-title {
    color: #ffffff;
    font-weight: 600;
}

.episode-meta {
    display: flex;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.episode-icons {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: 20px;
}

.epi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: white;
    opacity: 0.2;
    transition: all 0.4s;
}

.episode-row:hover .epi-icon.video { background: var(--accent-purple); color: white; opacity: 1; box-shadow: 0 4px 15px rgba(157, 116, 255, 0.4); }
.episode-row:hover .epi-icon.pdf { background: #F87171; color: white; opacity: 1; box-shadow: 0 4px 15px rgba(248, 113, 113, 0.4); }
.episode-row:hover .epi-icon.audio { background: #34D399; color: white; opacity: 1; box-shadow: 0 4px 15px rgba(52, 211, 153, 0.4); }
.epi-icon.video { color: var(--text-muted); }
.epi-icon.pdf { color: var(--text-muted); }
.epi-icon.audio { color: var(--text-muted); }

/* Indicador de recurso ya visto/reproducido */
.epi-icon.visto {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.4) !important;
    opacity: 0.5;
}

/* Scroll Estético para las Listas */
.episode-list::-webkit-scrollbar {
    width: 6px;
}
.episode-list::-webkit-scrollbar-track {
    background: transparent;
}
.episode-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.episode-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-pink);
}

/* REPRODUCTOR SUPERPUESTO (TEATRO MODO) */
.player-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 10, 12, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.player-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.player-header {
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.btn-close-player {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-player:hover {
    background: #EF4444;
    transform: rotate(90deg);
}

.player-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 40px 40px 40px;
    display: flex;
    flex-direction: column;
}

.player-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.player-tab {
    padding: 12px 25px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.player-tab.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.2);
}

.player-frame-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: black;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.player-frame-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Carrusel de "Siguientes episodios" */
.up-next-section {
    margin-top: 40px;
}

.up-next-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
}

.up-next-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.up-next-item {
    min-width: 280px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.up-next-item:hover {
    background: rgba(255,255,255,0.08);
}

.up-next-num {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.up-next-name {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

/* ========================================= */
/* MODAL SELECTOR DE PORTADAS (GALLERY)      */
/* ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 9, 20, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    display: flex;
    opacity: 1;
}

.cover-selector-card {
    background: #1e1c2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.8);
    animation: authCardIn 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.modal-close:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #F87171;
}

.modal-body {
    padding: 20px 30px;
    overflow-y: auto;
    flex: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.gallery-item {
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    position: relative;
    background: #14131d;
}

.gallery-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-purple);
    z-index: 5;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: 0.2s;
}

.gallery-item:hover img {
    opacity: 1;
}

.gallery-item.selected {
    border-color: var(--accent-pink);
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.4);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
 
 