@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Space+Grotesk:wght@400;700&display=swap');

:root {
    --space-dark: #040712;
    --space-light: #0a0f24;
    --neon-cyan: #00f0ff;
    --neon-purple: #b026ff;
    --neon-pink: #ff2a85;
    --text-main: #e2e8f0;
    --text-muted: #74839a;
    --glass-bg: rgba(10, 15, 36, 0.75);
    --glass-border: rgba(0, 240, 255, 0.2);
    --glass-card: rgba(255, 255, 255, 0.03);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--space-dark);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(176, 38, 255, 0.15), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.15), transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo { font-family: 'Space Grotesk', sans-serif; }
a { text-decoration: none; color: inherit; }

/* --- NUEVA BARRA DE NAVEGACIÓN CON BUSCADOR INTEGRADO --- */
.navbar {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: rgba(4, 7, 18, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 4%;
    display: grid;
    grid-template-columns: 220px 1fr auto;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.6rem; font-weight: 700;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    display: flex; align-items: center; gap: 10px;
    letter-spacing: 0.5px;
}

/* Buscador en la cabecera */
.header-search-container {
    position: relative;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}
.search-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 30px;
    padding: 2px 6px 2px 16px;
    transition: all 0.3s ease;
}
.search-wrapper:focus-within {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    background: rgba(4, 7, 18, 0.95);
}
.search-input {
    width: 100%; background: transparent; border: none; outline: none;
    color: white; font-family: inherit; font-size: 0.95rem; padding: 8px 0;
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
    background: transparent; border: none; color: var(--neon-cyan);
    width: 36px; height: 36px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}

.autocomplete-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; width: 100%;
    background: rgba(6, 10, 26, 0.98); backdrop-filter: blur(16px);
    border: 1px solid var(--neon-cyan); border-radius: 14px;
    overflow: hidden; box-shadow: 0 15px 40px rgba(0,0,0,0.7);
    display: none; flex-direction: column; z-index: 1100;
}
.autocomplete-item {
    padding: 12px 18px; cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.autocomplete-item:hover { background: rgba(0, 240, 255, 0.08); color: var(--neon-cyan); }
.autocomplete-item .item-type { font-size: 0.7rem; padding: 3px 8px; border-radius: 20px; font-weight: bold; text-transform: uppercase; }

.right-menu { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-weight: 600; transition: 0.3s; color: var(--text-main); font-size: 0.95rem; }
.nav-links a:hover { color: var(--neon-cyan); text-shadow: 0 0 8px rgba(0, 240, 255, 0.4); }

.btn-neon {
    padding: 0.6rem 1.5rem; border-radius: 30px; background: transparent;
    border: 1px solid var(--neon-cyan); color: var(--neon-cyan);
    font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif; font-size: 0.85rem; letter-spacing: 0.5px;
}
.btn-neon:hover { background: var(--neon-cyan); color: var(--space-dark); box-shadow: 0 0 20px rgba(0, 240, 255, 0.6); }
.btn-purple { border-color: var(--neon-purple); color: var(--neon-purple); }
.btn-purple:hover { background: var(--neon-purple); color: white; box-shadow: 0 0 20px rgba(176, 38, 255, 0.6); }

.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; color: var(--neon-cyan); }

/* --- HERO BANNER SIN BUSCADOR --- */
.hero { margin-top: 68px; position: relative; height: 60vh; overflow: hidden; }
.carousel-track { display: flex; height: 100%; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.slide {
    min-width: 100%; height: 100%; background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center; position: relative;
}
.slide::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(4,7,18,1) 0%, rgba(4,7,18,0.4) 100%);
}
.slide-content { position: relative; z-index: 2; text-align: center; max-width: 850px; padding: 2rem; }
.slide-content h1 { font-size: 3.5rem; margin-bottom: 1rem; line-height: 1.15; font-weight: 800; text-shadow: 0 0 30px rgba(0,240,255,0.2); }
.slide-content p { font-size: 1.2rem; color: #a0aec0; margin-bottom: 2rem; }

.carousel-btns { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 3; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; transition: 0.3s; }
.dot.active { background: var(--neon-cyan); box-shadow: 0 0 12px var(--neon-cyan); width: 26px; border-radius: 8px; }

/* --- SECCIONES Y TARJETAS DE CURSOS --- */
.section { padding: 4rem 4%; max-width: 1400px; margin: 0 auto; width: 100%; }
.section-title { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; font-weight: 700; }
.section-title span { background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 2.5rem; }
.course-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 18px; overflow: hidden; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column; height: 100%;
}
.course-card:hover { transform: translateY(-6px); border-color: var(--neon-cyan); box-shadow: 0 15px 30px rgba(0,240,255,0.15); }
.course-img { height: 180px; background-size: cover; background-position: center; position: relative; }
.badge { position: absolute; top: 12px; right: 12px; padding: 5px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px; }
.badge.free { background: #00ff88; color: #000; box-shadow: 0 0 10px rgba(0,255,136,0.3); }
.badge.paid { background: var(--neon-purple); color: #fff; box-shadow: 0 0 10px rgba(176,38,255,0.3); }
.course-info { padding: 1.8rem; flex-grow: 1; display: flex; flex-direction: column; }
.course-category { color: var(--neon-cyan); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.course-info h3 { font-size: 1.35rem; margin-bottom: 10px; font-weight: 700; }
.course-info p { color: #a0aec0; font-size: 0.9rem; margin-bottom: 1.5rem; flex-grow: 1; line-height: 1.5; }
.course-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 1rem; }
.price { font-size: 1.3rem; font-weight: 700; }

/* --- DETALLE DE CURSO GRATIS CON MUESTRA DE 3 VIDEOS --- */
.detail-layout { display: grid; grid-template-columns: 1fr 380px; gap: 3rem; margin-top: 90px; padding: 3rem 4%; max-width: 1400px; margin-left: auto; margin-right: auto; }
.detail-main h1 { font-size: 2.8rem; margin-bottom: 1rem; }
.detail-meta { display: flex; gap: 1.5rem; margin-bottom: 2rem; color: #a0aec0; font-size: 0.9rem; }
.detail-meta span i { color: var(--neon-cyan); margin-right: 5px; }
.detail-banner-img { width: 100%; height: 320px; border-radius: 16px; background-size: cover; background-position: center; border: 1px solid var(--glass-border); margin-bottom: 2.5rem; }
.detail-section { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); padding: 2rem; border-radius: 14px; margin-bottom: 2rem; }
.detail-section h2 { font-size: 1.6rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: 10px; color: var(--neon-cyan); }
.detail-section p { line-height: 1.6; color: #cbd5e1; }

/* Organización de las 3 Clases/Videos de Ejemplo Gratis */
.free-lessons-preview { display: flex; flex-direction: column; gap: 1rem; }
.preview-lesson-card {
    display: grid; grid-template-columns: 140px 1fr; gap: 1.2rem;
    background: rgba(4, 7, 18, 0.5); border: 1px solid rgba(255,255,255,0.05);
    padding: 12px; border-radius: 12px; transition: 0.3s; align-items: center;
}
.preview-lesson-card:hover { border-color: var(--neon-cyan); background: rgba(0,240,255,0.03); }
.preview-thumbnail {
    height: 80px; background-size: cover; background-position: center;
    border-radius: 8px; display: flex; align-items: center; justify-content: center; position: relative;
}
.preview-thumbnail::after { content: ''; position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.4); border-radius: 8px; }
.preview-thumbnail i { position: relative; z-index: 2; color: var(--neon-cyan); font-size: 1.4rem; text-shadow: 0 0 8px var(--neon-cyan); }
.preview-text h4 { font-size: 1.05rem; margin-bottom: 4px; color: white; }
.preview-text p { font-size: 0.85rem; color: var(--text-muted); }

.detail-sidebar { position: sticky; top: 100px; background: rgba(8,12,28,0.9); backdrop-filter: blur(12px); border: 1px solid var(--neon-cyan); border-radius: 20px; padding: 2rem; height: fit-content; text-align: center; }
.sidebar-price { font-size: 2.3rem; font-weight: 800; color: #00ff88; margin-bottom: 1rem; }
.sidebar-features { text-align: left; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; list-style: none; }
.sidebar-features li { display: flex; align-items: center; gap: 10px; }
.sidebar-features li i { color: var(--neon-cyan); }

/* --- AULA VIRTUAL COMPLETA CON SECCIÓN DE RECURSOS --- */
.classroom { display: grid; grid-template-columns: 1fr 380px; height: calc(100vh - 68px); margin-top: 68px; }
.video-section { padding: 2rem; display: flex; flex-direction: column; overflow-y: auto; }
.video-container-box { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 16px; border: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 15px 35px rgba(0,0,0,0.8); }
.video-container-box iframe, .video-container-box video { width: 100%; height: 100%; border-radius: 16px; }
.video-placeholder-ui { position: absolute; text-align: center; color: white; cursor: pointer; z-index: 5; }
.video-placeholder-ui i { font-size: 4.5rem; color: var(--neon-cyan); text-shadow: 0 0 15px var(--neon-cyan); transition: 0.3s; }
.video-placeholder-ui i:hover { transform: scale(1.1); }

.video-info { margin-top: 1.5rem; }
.video-info h2 { font-size: 1.8rem; margin-bottom: 10px; }

/* Sistema Avanzado de Recursos Organizados */
.classroom-tabs { display: flex; gap: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); margin-top: 1.5rem; margin-bottom: 1.5rem; }
.tab-btn { background: transparent; border: none; padding: 10px 16px; color: var(--text-muted); cursor: pointer; font-size: 0.95rem; font-weight: 600; font-family: inherit; position: relative; transition: 0.3s; }
.tab-btn.active { color: var(--neon-cyan); }
.tab-btn.active::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--neon-cyan); box-shadow: 0 0 8px var(--neon-cyan); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Organización limpia de Recursos por Carpetas / Bloques */
.resource-folder { background: rgba(255,255,255,0.01); border: 1px solid rgba(255,255,255,0.04); border-radius: 12px; padding: 1.2rem; margin-bottom: 1rem; }
.folder-header { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.95rem; color: var(--neon-purple); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); padding-bottom: 6px; }
.folder-header i { font-size: 1.1rem; }

.material-list { display: flex; flex-direction: column; gap: 8px; }
.material-item { background: rgba(4,7,18,0.4); border: 1px solid rgba(255,255,255,0.03); padding: 12px 16px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.material-meta { display: flex; align-items: center; gap: 12px; }
.material-icon { font-size: 1.3rem; color: var(--neon-pink); }
.material-title { font-weight: 600; font-size: 0.9rem; }
.material-size { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.btn-download { background: rgba(0,240,255,0.08); border: 1px solid rgba(0,240,255,0.3); color: var(--neon-cyan); padding: 6px 12px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; transition: 0.3s; }
.btn-download:hover { background: var(--neon-cyan); color: var(--space-dark); border-color: var(--neon-cyan); box-shadow: 0 0 10px rgba(0,240,255,0.4); }

.course-modules { background: #060a1a; border-left: 1px solid var(--glass-border); display: flex; flex-direction: column; height: 100%; }
.modules-header { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.module-list { overflow-y: auto; flex-grow: 1; padding: 1.2rem; }
.module-item { margin-bottom: 1.2rem; }
.module-title { font-weight: 700; color: var(--neon-purple); margin-bottom: 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.lesson { padding: 12px 14px; border-radius: 10px; cursor: pointer; transition: 0.3s; display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; margin-bottom: 4px; }
.lesson:hover { background: rgba(255,255,255,0.03); }
.lesson.active { background: rgba(0,240,255,0.07); border: 1px solid rgba(0,240,255,0.2); color: var(--neon-cyan); font-weight: 600; }

/* --- LOGIN PORTAL --- */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: radial-gradient(circle at center, #0b112c 0%, #03050f 100%); }
.login-box { background: rgba(4, 7, 18, 0.9); backdrop-filter: blur(20px); border: 1px solid var(--glass-border); padding: 3rem; border-radius: 20px; width: 100%; max-width: 440px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.login-box h2 { margin-bottom: 1rem; font-size: 2rem; }
.input-group { margin-bottom: 1.2rem; text-align: left; }
.input-group label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }
.input-group input { width: 100%; padding: 12px 16px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; color: white; font-family: inherit; font-size: 0.95rem; transition: 0.3s; }
.input-group input:focus { outline: none; border-color: var(--neon-cyan); background: rgba(0,240,255,0.02); box-shadow: 0 0 10px rgba(0,240,255,0.2); }

/* --- STUDENT DASHBOARD --- */
.dashboard { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; padding-top: 68px; }
.sidebar { background: rgba(5, 8, 22, 0.9); border-right: 1px solid var(--glass-border); padding: 2.5rem 1.5rem; }
.user-profile { text-align: center; margin-bottom: 2.5rem; }
.avatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--neon-purple); margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; background: rgba(176,38,255,0.1); color: var(--neon-cyan); box-shadow: 0 0 15px rgba(176,38,255,0.2); }
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 8px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; transition: 0.3s; color: var(--text-muted); font-weight: 600; font-size: 0.95rem; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(0,240,255,0.06); color: var(--neon-cyan); }
.dash-content { padding: 3rem; }
.progress-container { margin-top: 1.2rem; }
.progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple)); }

/* --- PIE DE PÁGINA --- */
footer { background: #02040a; padding: 2rem 4%; text-align: center; border-top: 1px solid rgba(255,255,255,0.04); margin-top: auto; font-size: 0.9rem; color: var(--text-muted); }

/* --- RESPONSIVE ADAPTATIVO COMPLETO --- */
@media (max-width: 1100px) {
    .navbar { grid-template-columns: 180px 1fr auto; gap: 1rem; }
    .detail-layout, .classroom { grid-template-columns: 1fr; height: auto; }
    .course-modules { width: 100%; border-left: none; border-top: 1px solid var(--glass-border); height: 400px; }
    .detail-sidebar { position: static; margin-top: 2rem; width: 100%; }
}

@media (max-width: 850px) {
    .navbar { display: flex; justify-content: space-between; padding: 1rem 5%; }
    .header-search-container { display: none; } /* Ocultar buscador complejo en pantallas móviles pequeñas */
    .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #040712; flex-direction: column; padding: 2rem; border-bottom: 1px solid var(--glass-border); gap: 1.2rem; }
    .nav-links.show { display: flex; }
    .menu-toggle { display: block; }
    .slide-content h1 { font-size: 2.2rem; }
    .dashboard { grid-template-columns: 1fr; }
    .sidebar { border-right: none; border-bottom: 1px solid var(--glass-border); }
    .dash-content { padding: 1.5rem; }
}
