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

:root {
    --primary: #202230;          /* Modern Dark Blue */
    --secondary: #a435f0;        /* Udemy-like purple */
    --accent: #00d1ff;           /* Modern Blue accent */
    --text-main: #202230;
    --text-muted: #6a6f73;
    --bg-white: #ffffff;
    --bg-gray: #f7f9fa;
    --border: #d1d7dc;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-white);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navigation --- */
nav {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-weight: 800;
    font-size: 24px;
    color: var(--primary);
    margin-right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--secondary);
}

/* User Menu & Avatar */
.user-menu { 
    position: relative; 
    display: flex !important; 
    align-items: center !important; 
    gap: 15px; 
    flex-wrap: nowrap;
}
.user-avatar-wrapper {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.user-avatar-wrapper:hover {
    transform: scale(1.05);
}
.user-avatar-img { 
    width: 100%; height: 100%; object-fit: cover;
}
.user-avatar-initial { 
    width: 100%; height: 100%; background: var(--primary); color: white; 
    display: flex; align-items: center; justify-content: center; 
    font-weight: 700; font-size: 14px;
}
.user-dropdown {
    position: absolute; top: 100%; right: 0; background: white; 
    border: 1px solid var(--border); box-shadow: var(--shadow); 
    width: 220px; padding: 10px 0; border-radius: 4px; 
    display: none; z-index: 9999; margin-top: 10px;
    text-align: left;
}
.user-dropdown.active { display: block; }
.user-dropdown a { 
    display: block; padding: 10px 20px; color: var(--text-main); 
    text-decoration: none !important; font-size: 14px;
}
.user-dropdown a:hover { background: var(--bg-gray); color: var(--secondary); }

/* Welcome Banner */
.welcome-banner { 
    display: flex; align-items: center; gap: 20px; 
    padding: 40px 0; border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.welcome-avatar {
    width: 80px; height: 80px; background: #202230; color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; flex-shrink: 0;
}
.welcome-text h2 { font-size: 32px; font-weight: 800; color: #202230; }
.welcome-text p { color: var(--secondary); font-weight: 700; font-size: 14px; margin-top: 5px; cursor: pointer; }
.welcome-text p:hover { text-decoration: underline; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 500;
    font-size: 14px;
}

.nav-links li:hover {
    color: var(--secondary);
}

.search-bar {
    flex: 1;
    margin: 0 24px;
    position: relative;
    max-width: 600px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px 12px 48px;
    border-radius: 50px;
    border: 1px solid var(--primary);
    background: var(--bg-gray);
    font-size: 14px;
}

.search-bar i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-outline {
    border: 1px solid var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.04);
}

.btn-solid {
    background: var(--primary);
    color: white;
}

.btn-solid:hover {
    background: #000;
}

/* --- Hero Section --- */
.hero {
    background-color: var(--bg-gray);
    padding: 60px 0;
}

.hero-box {
    display: flex;
    align-items: center;
    gap: 40px;
}

.hero-content {
    flex: 1;
    background: white;
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 500px;
}

.hero-content h1 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 24px;
}

.hero-image {
    flex: 1.5;
    position: relative;
}

.hero-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

/* --- Features --- */
.features {
    padding: 40px 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    text-align: center;
    padding: 24px;
}

.feature-card h3 {
    margin: 12px 0;
    font-size: 16px;
}

/* --- Courses --- */
.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.course-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #eee;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.course-author {
    font-size: 12px;
    color: var(--text-muted);
}

.course-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #b4690e;
}

.course-price {
    font-weight: 700;
    font-size: 16px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    background: #eceb98;
    color: #3d3b0a;
    font-size: 12px;
    font-weight: 700;
    width: fit-content;
    border-radius: 50px;
}

/* --- Footer --- */
footer {
    background: #202230 !important;
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 40px;
    border-bottom: 1px solid #3e4143;
    padding-bottom: 40px;
}

.footer-col h4 {
    margin-bottom: 16px;
    font-size: 14px;
}

.footer-col ul li {
    font-size: 13px;
    margin-bottom: 8px;
    color: #d1d7dc;
}

.footer-col ul li:hover {
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 40px;
}

.footer-logo {
    font-weight: 800;
    font-size: 20px;
}

.copyright {
    font-size: 12px;
    color: #d1d7dc;
}

/* --- Login Form --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    background: var(--bg-gray);
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    margin-bottom: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--primary);
    border-radius: 4px;
}

.btn-block {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
}


/* --- Premium Course Detail --- */
.course-header {
    background-color: #202230;
    color: white;
    padding: 30px 0 60px;
}

.course-header .breadcrumb {
    color: #cecfd0;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 25px;
}

.course-header .breadcrumb span {
    margin: 0 8px;
    opacity: 0.5;
}

.course-header h1 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    max-width: 800px;
}

.course-header p.subtitle {
    font-size: 19px;
    margin-top: 15px;
    line-height: 1.4;
    max-width: 800px;
}

.course-header .meta-info {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    font-size: 14px;
    align-items: center;
}

.course-header .meta-info span i {
    color: #f4c150;
    margin-right: 5px;
}

.course-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    padding: 40px 0;
}

/* Floating Sidebar Card */
.sticky-sidebar {
    position: sticky;
    top: 100px;
    margin-top: -300px;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    z-index: 100;
}

.preview-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
}

.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

.play-btn {
    font-size: 60px;
    margin-bottom: 10px;
}

.sidebar-content {
    padding: 24px;
}

.price-box {
    margin-bottom: 20px;
}

.current-price {
    font-size: 32px;
    font-weight: 800;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    margin-left: 10px;
}

/* Sticky Header Bar */
.sticky-header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #202230;
    color: white;
    padding: 10px 0;
    z-index: 2000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.sticky-header-bar.visible {
    transform: translateY(0);
}

.sticky-header-bar .container {
    display: flex;
    flex-direction: column;
}

.sticky-header-bar h4 {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 800px;
}

/* Content Sections */
.info-section {
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 40px;
}

.info-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.learning-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.learning-list li {
    font-size: 14px;
    display: flex;
    gap: 10px;
}

.learning-list i {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Curriculum Accordion */
.accordion-item {
    border: 1px solid var(--border);
    margin-bottom: -1px;
}

.accordion-header {
    background: var(--bg-gray);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
}

.accordion-content {
    padding: 10px 0;
    background: white;
}

.lesson-row {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.lesson-row i {
    margin-right: 10px;
    color: var(--text-muted);
}

@media (max-width: 991px) {
    .course-layout {
        grid-template-columns: 1fr;
    }
    .sticky-sidebar {
        position: relative;
        top: 0;
        margin-top: 20px;
    }
    .course-header h1 { font-size: 28px; }
}

/* --- Manual Payment Modal --- */
.btn-transfer {
    background: #25d366;
    color: white;
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-transfer:hover {
    background: #128c7e;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.bank-card {
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    background: var(--bg-gray);
}

.bank-card h4 {
    color: var(--secondary);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

.bank-card p {
    font-size: 13px;
    line-height: 1.6;
}

.whatsapp-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed var(--border);
    text-align: center;
}

/* --- Student Dashboard Improvements --- */
.dashboard-header {
    background: var(--primary);
    color: white;
    padding: 40px 0 0;
}

.dashboard-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 24px;
}

.tabs-nav {
    display: flex;
    gap: 30px;
}

.tab-link {
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    font-size: 15px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.tab-link:hover {
    color: white;
}

.tab-link.active {
    color: white;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: white;
}

.course-card-premium {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.course-card-premium:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.course-card-premium .course-thumb {
    aspect-ratio: 16/9;
}

.course-card-premium .card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card-premium .course-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card-premium .course-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.course-progress-container {
    margin-top: auto;
}

.course-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 8px;
}

.course-progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 4px;
}

.course-progress-text {
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    margin-bottom: 15px;
}

/* --- Course Viewer UI --- */
.interactive-player-box {
    background: #000;
    color: white;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative; /* Para que la nav sea absoluta */
}

.speed-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 110;
}

.speed-btn {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.speed-btn:hover, .speed-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.video-display {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.ex-video {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.ex-video.active {
    display: block;
}

.example-nav {
    position: absolute;
    top: 50%;
    left: 15px;
    right: 15px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(100% - 30px);
    pointer-events: none;
    z-index: 100;
}

.example-nav button {
    pointer-events: auto;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
}

.example-nav button:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

#example-counter {
    position: absolute;
    top: 25px; /* Alineado con los controles de velocidad */
    right: 20px;
    background: rgba(0,0,0,0.6);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 11px;
    pointer-events: none;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 120;
    backdrop-filter: blur(5px);
}

.ex-video.active {
    display: block;
}

.example-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.example-nav button {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 15px;
    border-radius: 4px;
}

.example-nav button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Tabs UI */
.tab-btn {
    padding: 15px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--text-main);
    border-bottom: 2px solid var(--text-main);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Slides Viewer UI --- */
.slides-viewer {
    background: #f4f7f6; /* Fondo claro para resaltar la "hoja" blanca */
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 30px;
}

.slides-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.slide-item {
    display: none;
    background: white;
    width: 90%;
    max-width: 800px;
    height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); /* Sombra más suave para fondo claro */
    padding: 40px;
    overflow-y: auto;
    border: 1px solid #eee; /* Borde sutil para definir la hoja */
}

.slide-item.active {
    display: block;
    animation: slideIn 0.4s ease-out;
}

.slide-body {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.slide-col-left {
    flex: 0 0 40%;
}

.slide-col-right {
    flex: 1;
}

.slide-img img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 8px;
    background: #f9f9f9;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.slide-content h4 {
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 15px;
}

.slide-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
}

.slide-nav {
    position: absolute;
    top: 50%;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 100;
}

.slide-nav button {
    pointer-events: auto;
    background: white;
    color: var(--primary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
}

.slide-nav button:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Ocultar texto dejando solo el icono */
.slide-nav button i { margin: 0; }
.slide-nav .nav-prev i { margin-right: 0; }
.slide-nav .nav-next i { margin-left: 0; }
.slide-nav button { text-indent: -9999px; overflow: hidden; white-space: nowrap; }
.slide-nav button i { float: left; text-indent: 0; width: 100%; }

#slide-counter {
    position: absolute;
    top: 25px;
    right: 20px;
    background: rgba(255,255,255,0.9);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid #eee;
    z-index: 120;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Slide Header Internal */
.slide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.slide-course-info {
    font-size: 10px;
    color: #999;
    font-style: italic;
    font-weight: 500;
}

.slide-brand {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.slide-brand span {
    color: var(--primary);
}


@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Q&A Styles */
.qa-item {
    padding: 24px 0;
    border-bottom: 1px solid #eee;
}

.qa-user {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.qa-user .avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.qa-content {
    font-size: 15px;
    color: #444;
    padding-left: 52px;
    line-height: 1.6;
}


