/* ============================================================
   WebAcademy | JC Marketing — Estilos Portal Estudiante y Player
   ============================================================ */

/* ─── Layout Estudiante ─────────────────────────────────────────────────── */
.student-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Header del Portal ─────────────────────────────────────────────────── */
.student-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0; z-index: 50;
}
.student-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.header-logo img { height: 38px; width: auto; }
.header-logo-text {
  display: flex; flex-direction: column; line-height: 1;
}
.header-logo-text .name {
  font-family: var(--font-heading);
  font-size: 17px; font-weight: 700;
  color: var(--black); letter-spacing: -.3px;
}
.header-logo-text .sub {
  font-size: 10px; color: var(--red-primary); font-weight: 600;
  letter-spacing: .8px; text-transform: uppercase;
}

.header-nav { display: flex; align-items: center; gap: var(--space-2); }
.header-nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
  text-decoration: none;
}
.header-nav-link:hover, .header-nav-link.active {
  background: var(--red-bg); color: var(--red-primary);
}

.header-user {
  display: flex; align-items: center; gap: var(--space-3);
  position: relative;
}
.header-user-btn {
  display: flex; align-items: center; gap: var(--space-2);
  background: none; border: none; cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.header-user-btn:hover { background: var(--gray-100); }
.header-user-btn .user-name { font-size: 14px; font-weight: 600; color: var(--black); }

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  min-width: 200px;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transform: translateY(-8px);
  transition: var(--transition);
}
.user-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 14px; color: var(--gray-700);
  transition: var(--transition);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-100);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--gray-50); color: var(--black); }
.dropdown-item i { width: 18px; text-align: center; color: var(--gray-400); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger i { color: var(--danger); }

/* ─── Dashboard ──────────────────────────────────────────────────────────── */
.student-content {
  flex: 1;
  padding: var(--space-8) var(--space-6);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.welcome-banner {
  background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-10);
  color: var(--white);
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 60px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.welcome-banner h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.welcome-banner p { font-size: 16px; color: rgba(255,255,255,.85); }

/* ─── Course Cards Grid ──────────────────────────────────────────────────── */
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-5);
  display: flex; align-items: center; gap: var(--space-3);
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--gray-200);
  border-radius: 1px;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

.course-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-slow);
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--red-border);
}

.course-cover {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray-100);
}
.course-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.course-card:hover .course-cover img { transform: scale(1.04); }
.course-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--red-bg) 0%, #ffe4e5 100%);
  font-size: 48px; color: var(--red-primary);
}
.course-progress-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  padding: var(--space-3) var(--space-4) var(--space-2);
}
.course-progress-bar-mini {
  height: 4px; background: rgba(255,255,255,.3);
  border-radius: 2px; overflow: hidden;
}
.course-progress-bar-mini span {
  display: block; height: 100%;
  background: var(--red-light);
  border-radius: 2px;
}
.course-progress-text {
  font-size: 11px; color: rgba(255,255,255,.9);
  font-weight: 600; margin-top: 4px;
}

.course-card-body { padding: var(--space-5); }
.course-card-title {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 700;
  color: var(--black);
  margin-bottom: var(--space-2);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card-meta {
  display: flex; align-items: center; gap: var(--space-4);
  font-size: 13px; color: var(--gray-500);
  margin-top: var(--space-3);
}
.course-card-meta span { display: flex; align-items: center; gap: 5px; }
.course-card-meta i   { font-size: 13px; color: var(--gray-400); }

/* ─── Video Player Layout ────────────────────────────────────────────────── */
.lesson-layout {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

.lesson-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Video área */
.video-area {
  background: #000;
  position: relative;
  width: 100%;
}
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* Info de la clase */
.lesson-info {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
}
.lesson-info-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.lesson-title {
  font-size: 22px; font-weight: 700;
  font-family: var(--font-heading);
}
.lesson-chapter { font-size: 13px; color: var(--red-primary); font-weight: 600; margin-bottom: 6px; }
.lesson-actions { display: flex; gap: var(--space-3); flex-shrink: 0; }

/* Descripción */
.lesson-description {
  padding: var(--space-6) var(--space-8);
  background: var(--white);
  flex: 1;
}
.lesson-description-content {
  font-size: 15px; line-height: 1.7; color: var(--gray-700);
  max-width: 800px;
}
.lesson-description-content h1,
.lesson-description-content h2,
.lesson-description-content h3 {
  font-family: var(--font-heading);
  margin: 16px 0 8px;
}
.lesson-description-content p  { margin-bottom: 12px; }
.lesson-description-content ul,
.lesson-description-content ol { margin: 12px 0 12px 20px; }
.lesson-description-content li { margin-bottom: 4px; }
.lesson-description-content ul { list-style: disc; }
.lesson-description-content ol { list-style: decimal; }
.lesson-description-content a  { color: var(--red-primary); }
.lesson-description-content strong { font-weight: 700; }
.lesson-description-content em { font-style: italic; }
.lesson-description-content blockquote {
  border-left: 4px solid var(--red-primary);
  background: var(--red-bg);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
}

/* Archivos adjuntos */
.attachments-section {
  padding: var(--space-5) var(--space-8);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}
.attachments-title {
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--gray-500); margin-bottom: var(--space-3);
}
.attachments-list { display: flex; flex-direction: column; gap: var(--space-2); }
.attachment-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--black);
  transition: var(--transition);
}
.attachment-item:hover {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--black);
}
.attachment-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--red-bg);
  color: var(--red-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.attachment-info { flex: 1; }
.attachment-name { font-size: 14px; font-weight: 500; }
.attachment-meta { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.attachment-download { color: var(--gray-400); font-size: 16px; }
.attachment-item:hover .attachment-download { color: var(--red-primary); }

/* ─── Sidebar de clases ──────────────────────────────────────────────────── */
.lesson-sidebar {
  width: 340px;
  min-width: 340px;
  background: var(--white);
  border-left: 1px solid var(--gray-200);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.lesson-sidebar-header {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0;
  background: var(--white); z-index: 10;
}
.lesson-sidebar-title { font-size: 15px; font-weight: 700; }
.lesson-sidebar-subtitle { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* Capítulos en sidebar */
.chapter-group { border-bottom: 1px solid var(--gray-100); }
.chapter-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--space-5);
  cursor: pointer;
  background: var(--gray-50);
  font-size: 13px; font-weight: 700;
  color: var(--black);
  user-select: none;
  transition: var(--transition);
}
.chapter-header:hover { background: var(--gray-100); }
.chapter-header i { color: var(--gray-400); font-size: 12px; transition: var(--transition); }
.chapter-header.open i { transform: rotate(180deg); }

.chapter-lessons { display: none; }
.chapter-lessons.open { display: block; }

.lesson-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 12px var(--space-5) 12px 24px;
  text-decoration: none;
  color: var(--gray-700);
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.lesson-item:hover { background: var(--gray-50); color: var(--black); }
.lesson-item.active {
  background: var(--red-bg);
  color: var(--red-primary);
  border-left-color: var(--red-primary);
  font-weight: 600;
}
.lesson-item.completed { color: var(--success); }

.lesson-check {
  width: 22px; height: 22px; min-width: 22px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent;
  transition: var(--transition);
}
.lesson-item.completed .lesson-check {
  background: var(--success); border-color: var(--success); color: var(--white);
}
.lesson-item.active .lesson-check {
  border-color: var(--red-primary); color: var(--red-primary);
}
.lesson-item-title { flex: 1; line-height: 1.3; }

/* ─── Footer del portal ──────────────────────────────────────────────────── */
.student-footer {
  background: var(--black);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: var(--space-5);
  font-size: 13px;
}
.student-footer a { color: var(--red-light); }
.student-footer a:hover { color: var(--white); }

/* ─── Login page ─────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--gray-50);
}
.login-left {
  flex: 1;
  background: linear-gradient(135deg, var(--red-primary) 0%, var(--red-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  padding: var(--space-12);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -50px;
  width: 250px; height: 250px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.login-left-content { position: relative; z-index: 1; text-align: center; }
.login-brand-logo { height: 60px; margin: 0 auto var(--space-6); filter: brightness(0) invert(1); }
.login-tagline { font-size: 28px; font-weight: 700; font-family: var(--font-heading); margin-bottom: var(--space-4); }
.login-desc { font-size: 16px; color: rgba(255,255,255,.8); max-width: 320px; }
.login-features { margin-top: var(--space-10); display: flex; flex-direction: column; gap: var(--space-3); }
.login-feature { display: flex; align-items: center; gap: var(--space-3); font-size: 14px; }
.login-feature i { font-size: 16px; }

.login-right {
  width: 480px; min-width: 480px;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-12);
}
.login-form-card {
  width: 100%;
  max-width: 380px;
}
.login-form-title { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.login-form-sub   { font-size: 15px; color: var(--gray-500); margin-bottom: var(--space-8); }

/* ─── Responsive: lesson layout ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .lesson-layout { flex-direction: column; height: auto; }
  .lesson-sidebar { width: 100%; min-width: auto; border-left: none; border-top: 1px solid var(--gray-200); }
  .lesson-info, .lesson-description { padding: var(--space-5); }
  .attachments-section { padding: var(--space-4) var(--space-5); }
  .login-left { display: none; }
  .login-right { width: 100%; min-width: auto; padding: var(--space-8); }
}

@media (max-width: 640px) {
  .student-content { padding: var(--space-5) var(--space-4); }
  .courses-grid { grid-template-columns: 1fr; }
  .welcome-banner { padding: var(--space-6); }
  .welcome-banner h1 { font-size: 22px; }
}
