@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.85);
    --glass-border: rgba(0, 240, 255, 0.25);
    --glass-card: rgba(255, 255, 255, 0.04);
}

* {
    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 15% 15%, rgba(176, 38, 255, 0.15), transparent 45%), radial-gradient(circle at 85% 85%, rgba(0, 240, 255, 0.15), transparent 45%);
    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;
}

/* NAVBAR RESPONSIVA */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(4, 7, 18, 0.95);
    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;
}

/* Buscador en Cabecera */
.header-search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 30px;
    padding: 2px 6px 2px 16px;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    padding: 8px 0;
    font-family: inherit;
}

    .search-input::placeholder {
        color: var(--text-muted);
    }

.search-btn {
    background: transparent;
    border: none;
    color: var(--neon-cyan);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.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.8);
    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.1);
        color: var(--neon-cyan);
    }

.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);
        }

.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;
}

    .btn-neon:hover {
        background: var(--neon-cyan);
        color: var(--space-dark);
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
    }

.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.5);
    }

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

/* HERO CARRUSEL */
.hero {
    margin-top: 68px;
    position: relative;
    height: 55vh;
    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.3) 100%);
    }

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 2rem;
}

    .slide-content h1 {
        font-size: 3.2rem;
        margin-bottom: 1rem;
        font-weight: 800;
    }

    .slide-content p {
        font-size: 1.1rem;
        color: #a0aec0;
        margin-bottom: 1.5rem;
    }

.carousel-btns {
    position: absolute;
    bottom: 20px;
    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;
    }

/* SECCIÓN DE CURSOS */
.section {
    padding: 4rem 4%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-size: 2.3rem;
    text-align: center;
    margin-bottom: 3rem;
}

    .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.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .course-card:hover {
        transform: translateY(-5px);
        border-color: var(--neon-cyan);
        box-shadow: 0 12px 25px 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;
    }

    .badge.paid {
        background: var(--neon-purple);
        color: #fff;
    }

.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;
    margin-bottom: 6px;
}

.course-info h3 {
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.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 (PÚBLICO) */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
    margin-top: 68px;
    padding: 3rem 4%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.detail-main h1 {
    font-size: 2.6rem;
    margin-bottom: 1rem;
}

.detail-banner-img {
    width: 100%;
    height: 300px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}

.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.5rem;
        margin-bottom: 1.2rem;
        color: var(--neon-cyan);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .detail-section p {
        line-height: 1.6;
        color: #cbd5e1;
        font-size: 0.95rem;
    }

/* Previsualización de Clases */
.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.6);
    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.04);
    }

.preview-thumbnail {
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .preview-thumbnail i {
        color: var(--neon-cyan);
        font-size: 1.6rem;
        text-shadow: 0 0 10px 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 {
    background: rgba(8,12,28,0.9);
    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);
        }

/* ENTORNO CLASSROOM DE REPRODUCCIÓN (ABIERTO PARA GRATIS) */
.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);
    overflow: hidden;
}

    .video-container-box iframe {
        width: 100%;
        height: 100%;
        border: none;
    }

.video-info {
    margin-top: 1.5rem;
}

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

.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;
    }

.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;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding-bottom: 6px;
}

.material-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.material-item {
    background: rgba(4,7,18,0.5);
    border: 1px solid rgba(255,255,255,0.04);
    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);
}

.btn-download-link {
    background: rgba(0,240,255,0.08);
    border: 1px solid rgba(0,240,255,0.3);
    color: var(--neon-cyan);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
}

    .btn-download-link: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;
    border: 1px solid transparent;
}

    .lesson:hover {
        background: rgba(255,255,255,0.03);
        border-color: rgba(255,255,255,0.05);
    }

    .lesson.active {
        background: rgba(0,240,255,0.08);
        border-color: rgba(0,240,255,0.25);
        color: var(--neon-cyan);
        font-weight: 600;
    }

/* ACCESO LOGIN */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-box {
    background: rgba(4, 7, 18, 0.9);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    text-align: center;
}

    .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;
    }

        .input-group input:focus {
            outline: none;
            border-color: var(--neon-cyan);
        }

/* DASHBOARD PRIVADO (SÓLO PREMIUM) */
.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);
}

.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;
        color: var(--text-muted);
        font-weight: 600;
    }

        .sidebar-nav a.active {
            background: rgba(0,240,255,0.06);
            color: var(--neon-cyan);
        }

.dash-content {
    padding: 3rem;
}

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 */
@media (max-width: 1100px) {
    .navbar {
        grid-template-columns: 180px 1fr auto;
    }

    .detail-layout, .classroom {
        grid-template-columns: 1fr;
        height: auto;
    }

    .course-modules {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--glass-border);
        height: 320px;
    }
}

@media (max-width: 850px) {
    .navbar {
        display: flex;
        justify-content: space-between;
    }

    .header-search-container {
        display: none;
    }

    .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);
    }

        .nav-links.show {
            display: flex;
        }

    .menu-toggle {
        display: block;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }
}
