/* ============================================================
   FERPAUL ACADEMY - Premium Styles
   Tema: Claro, elegante, moderno, inspirado en plataformas de comunidad
   ============================================================ */

/* ---- VARIABLES ---- */
:root {
  --blue: #4285F4;
  --red: #EA4335;
  --yellow: #FBBC05;
  --green: #34A853;
  --dark: #1a1a2e;
  --dark2: #16213e;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface2: #f8faff;
  --border: #e8edf5;
  --shadow-sm: 0 1px 3px rgba(66,133,244,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(66,133,244,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(66,133,244,0.14), 0 4px 16px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(66,133,244,0.18), 0 8px 24px rgba(0,0,0,0.10);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 240px;
  --header-height: 64px;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ---- LOGO FERPAUL ACADEMY ---- */
.logo {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  cursor: pointer;
  user-select: none;
}
.logo-text { display: flex; gap: 0; }
.logo span:nth-child(1) { color: var(--blue); }
.logo span:nth-child(2) { color: var(--red); }
.logo span:nth-child(3) { color: var(--yellow); }
.logo span:nth-child(4) { color: var(--blue); }
.logo span:nth-child(5) { color: var(--green); }
.logo span:nth-child(6) { color: var(--red); }
.logo span:nth-child(7) { color: var(--yellow); }
.logo-suffix {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-left: 6px;
  margin-top: 4px;
}

/* ---- PUBLIC HEADER ---- */
#public-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
}
#public-header .header-logo { flex: 0 0 auto; }
#public-header .header-search {
  flex: 1;
  max-width: 440px;
  position: relative;
}
#public-header .header-search input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--gray-50);
  font-size: 0.88rem;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
}
#public-header .header-search input:focus {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(66,133,244,0.12);
}
#public-header .header-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 1rem;
  pointer-events: none;
}
#public-header .header-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---- APP HEADER (logged in) ---- */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 900;
  display: flex;
  align-items: center;
  padding: 0 20px 0 0;
  gap: 16px;
}
#app-header .app-header-logo {
  width: var(--sidebar-width);
  padding: 0 20px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
}
#app-header .app-header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
#app-header .app-header-search input {
  width: 100%;
  padding: 8px 16px 8px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--gray-50);
  font-size: 0.86rem;
  color: var(--gray-800);
  transition: var(--transition);
  outline: none;
}
#app-header .app-header-search input:focus {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(66,133,244,0.12);
}
#app-header .app-header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.95rem;
  pointer-events: none;
}
#app-header .app-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.user-avatar:hover { transform: scale(1.08); }
.user-info { text-align: right; }
.user-info .user-name { font-size: 0.82rem; font-weight: 600; color: var(--gray-800); }
.user-info .user-role {
  font-size: 0.72rem;
  color: var(--blue);
  font-weight: 500;
  text-transform: capitalize;
}

/* ---- SIDEBAR ---- */
#sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 800;
  padding: 16px 0;
  transition: transform var(--transition);
}
.sidebar-section { margin-bottom: 8px; }
.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 4px 20px 8px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}
.sidebar-item:hover {
  background: var(--gray-50);
  color: var(--blue);
}
.sidebar-item.active {
  background: rgba(66,133,244,0.08);
  color: var(--blue);
  border-left-color: var(--blue);
}
.sidebar-item .sidebar-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-item .sidebar-badge {
  margin-left: auto;
  background: var(--blue);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* ---- MAIN CONTENT LAYOUT ---- */
#app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height);
}
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 28px 28px 60px;
  min-width: 0;
}

/* ---- SECTIONS ---- */
.section { display: none; }
.section.active { display: block; }

/* ---- PAGE TITLE ---- */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 12px rgba(66,133,244,0.35);
}
.btn-primary:hover:not(:disabled) {
  background: #3367d6;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(66,133,244,0.45);
}
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }
.btn-success {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 12px rgba(52,168,83,0.35);
}
.btn-success:hover:not(:disabled) {
  background: #2d9248;
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: #c62828;
  transform: translateY(-1px);
}
.btn-warning {
  background: var(--yellow);
  color: var(--gray-900);
}
.btn-warning:hover:not(:disabled) { background: #f0a500; }
.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--blue);
  color: var(--blue);
}
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }
.btn-icon { padding: 9px; width: 38px; height: 38px; }
.btn-whatsapp {
  background: #25D366;
  color: white;
  box-shadow: 0 2px 12px rgba(37,211,102,0.4);
}
.btn-whatsapp:hover:not(:disabled) {
  background: #1fba57;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(37,211,102,0.5);
}

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
}

/* ---- COURSE CARDS (PUBLIC & PRIVATE) ---- */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}
.course-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(66,133,244,0.3);
}
.course-card.locked { opacity: 0.85; }
.course-card.locked:hover { border-color: rgba(234,67,53,0.3); }
.course-thumb {
  position: relative;
  height: 168px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue), var(--dark));
}
.course-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.course-card:hover .course-thumb img { transform: scale(1.06); }
.course-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.course-badge-level {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0,0,0,0.65);
  color: white;
  backdrop-filter: blur(4px);
}
.course-badge-locked {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(234,67,53,0.9);
  color: white;
  display: flex; align-items: center; gap: 4px;
}
.course-badge-free {
  position: absolute;
  top: 10px; right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(52,168,83,0.9);
  color: white;
}
.course-card-body { padding: 16px; }
.course-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  margin-bottom: 6px;
}
.course-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-desc {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-meta {
  display: flex;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--gray-500);
  margin-bottom: 12px;
}
.course-meta span { display: flex; align-items: center; gap: 4px; }
.course-progress-bar {
  height: 5px;
  background: var(--gray-200);
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}
.course-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 3px;
  transition: width 0.8s ease;
}
.course-progress-text {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 12px;
}
.course-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-50);
}
.course-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gray-900);
}
.course-price .currency { font-size: 0.8rem; font-weight: 600; color: var(--gray-500); }

/* ---- STATS CARDS (DASHBOARD) ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  font-size: 1.6rem;
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.stat-icon.blue { background: rgba(66,133,244,0.12); }
.stat-icon.red { background: rgba(234,67,53,0.12); }
.stat-icon.yellow { background: rgba(251,188,5,0.12); }
.stat-icon.green { background: rgba(52,168,83,0.12); }
.stat-icon.purple { background: rgba(124,77,255,0.12); }
.stat-icon.orange { background: rgba(255,109,0,0.12); }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .required { color: var(--red); margin-left: 3px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--gray-800);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(66,133,244,0.12);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--gray-400); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint {
  font-size: 0.76rem;
  color: var(--gray-500);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-select { appearance: none; cursor: pointer; }

/* Checkboxes múltiples */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.checkbox-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
  background: var(--surface);
  color: var(--gray-600);
}
.checkbox-chip input { display: none; }
.checkbox-chip.checked {
  background: rgba(66,133,244,0.1);
  border-color: var(--blue);
  color: var(--blue);
}
.checkbox-chip:hover { border-color: var(--blue); }

/* ---- TABLES ---- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--gray-700);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--gray-50); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-blue { background: rgba(66,133,244,0.12); color: var(--blue); }
.badge-green { background: rgba(52,168,83,0.12); color: var(--green); }
.badge-red { background: rgba(234,67,53,0.12); color: var(--red); }
.badge-yellow { background: rgba(251,188,5,0.15); color: #b7860b; }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }
.badge-purple { background: rgba(124,77,255,0.12); color: #7C4DFF; }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.22s ease;
}
.modal-box.modal-lg { max-width: 680px; }
.modal-box.modal-xl { max-width: 860px; }
.modal-header {
  padding: 22px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); }
.modal-close {
  background: var(--gray-100);
  border: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray-600);
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--red); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---- TOASTS ---- */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  border-left: 4px solid var(--blue);
  animation: slideInRight 0.25s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.toast-success { border-left-color: var(--green); }
.toast.toast-error { border-left-color: var(--red); }
.toast.toast-warning { border-left-color: var(--yellow); }
.toast.toast-info { border-left-color: var(--blue); }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.toast-content { flex: 1; }
.toast-title { font-size: 0.85rem; font-weight: 700; color: var(--gray-900); margin-bottom: 2px; }
.toast-message { font-size: 0.8rem; color: var(--gray-600); line-height: 1.4; }
.toast-close {
  background: none; border: none;
  color: var(--gray-400); font-size: 1rem;
  cursor: pointer; padding: 0; line-height: 1;
  flex-shrink: 0; margin-top: 1px;
}
.toast-close:hover { color: var(--gray-700); }
.toast.hiding { opacity: 0; transform: translateX(20px); }

/* ---- PUBLIC LANDING PAGE ---- */
#public-page {
  padding-top: var(--header-height);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  padding: 90px 40px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(66,133,244,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(52,168,83,0.15) 0%, transparent 60%);
}
.hero-content { position: relative; max-width: 720px; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(66,133,244,0.2);
  border: 1px solid rgba(66,133,244,0.4);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero h1 .highlight {
  background: linear-gradient(90deg, #4285F4, #34A853, #FBBC05);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-search {
  margin-top: 36px;
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.hero-search input {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.hero-search input::placeholder { color: rgba(255,255,255,0.5); }
.hero-search input:focus {
  border-color: var(--blue);
  background: rgba(255,255,255,0.15);
}
.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-top: 44px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 1.6rem; font-weight: 800; color: white; }
.hero-stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.55); margin-top: 3px; }

/* Public Section */
.public-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}
.section-header {
  text-align: center;
  margin-bottom: 40px;
}
.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(66,133,244,0.1);
  color: var(--blue);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 10px;
}
.section-subtitle {
  font-size: 0.95rem;
  color: var(--gray-500);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.benefit-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.benefit-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(66,133,244,0.25);
}
.benefit-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}
.benefit-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}
.benefit-desc { font-size: 0.83rem; color: var(--gray-500); line-height: 1.55; }

/* Categories Filter */
.categories-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.category-chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
  color: var(--gray-600);
}
.category-chip:hover { border-color: var(--blue); color: var(--blue); }
.category-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

/* ---- FOOTER ---- */
footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 50px 40px 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto 40px;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand .logo span { opacity: 1; }
.footer-brand p { font-size: 0.84rem; line-height: 1.6; color: rgba(255,255,255,0.5); }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; color: white; margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.5);
  transition: var(--transition);
}
.footer-col ul li a:hover { color: var(--blue); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  max-width: 1200px;
  margin: 0 auto;
}

/* ---- LOGIN MODAL ---- */
#login-modal .modal-box { max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo .logo { justify-content: center; font-size: 1.6rem; }
.login-logo .logo-suffix { display: block; text-align: center; margin-top: 4px; }
.login-form-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.login-form-subtitle {
  text-align: center;
  font-size: 0.84rem;
  color: var(--gray-500);
  margin-bottom: 24px;
}
.login-error {
  background: rgba(234,67,53,0.08);
  border: 1px solid rgba(234,67,53,0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--red);
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: flex; align-items: center; gap: 7px; }
.forgot-link {
  font-size: 0.82rem;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  display: inline-block;
  margin-top: 4px;
}
.forgot-link:hover { color: #3367d6; }
.security-note {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: var(--radius);
  font-size: 0.76rem;
  color: var(--gray-500);
  margin-top: 16px;
}

/* ---- LOCKED MODAL ---- */
.locked-modal-icon { text-align: center; font-size: 3rem; margin-bottom: 16px; }
.locked-modal-discount {
  background: linear-gradient(135deg, rgba(66,133,244,0.08), rgba(52,168,83,0.08));
  border: 1px solid rgba(66,133,244,0.2);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.55;
  margin-bottom: 20px;
}
.locked-modal-discount strong { color: var(--blue); }
.discount-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, var(--yellow), #f0a500);
  color: var(--gray-900);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 12px;
}

/* ---- VIDEO PLAYER MODAL ---- */
.video-modal-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: black;
  margin-bottom: 16px;
}
.video-modal-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ---- LESSON LIST ---- */
.module-section { margin-bottom: 20px; }
.module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}
.module-header:hover { background: rgba(66,133,244,0.06); }
.module-header .module-icon { font-size: 1rem; }
.module-header .module-title { font-size: 0.9rem; font-weight: 700; color: var(--gray-800); flex: 1; }
.module-header .module-count { font-size: 0.76rem; color: var(--gray-500); }
.module-lessons { display: none; padding: 0 4px; }
.module-lessons.open { display: block; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  background: var(--surface);
  transition: var(--transition);
  cursor: pointer;
}
.lesson-item:hover {
  border-color: rgba(66,133,244,0.4);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}
.lesson-item.watched { opacity: 0.6; }
.lesson-thumb {
  width: 88px; height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gray-200);
  position: relative;
}
.lesson-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lesson-thumb .play-icon {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35);
  color: white;
  font-size: 1.3rem;
}
.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); margin-bottom: 3px; }
.lesson-desc { font-size: 0.77rem; color: var(--gray-500); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.lesson-watched-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green);
  display: flex; align-items: center; gap: 3px;
  flex-shrink: 0;
}

/* ---- QUIZ ---- */
.quiz-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.quiz-question {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  line-height: 1.4;
}
.quiz-options { display: flex; flex-direction: column; gap: 9px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  color: var(--gray-700);
}
.quiz-option:hover { border-color: var(--blue); background: rgba(66,133,244,0.05); }
.quiz-option.selected { border-color: var(--blue); background: rgba(66,133,244,0.1); color: var(--blue); font-weight: 600; }
.quiz-option.correct { border-color: var(--green); background: rgba(52,168,83,0.1); color: var(--green); font-weight: 600; }
.quiz-option.wrong { border-color: var(--red); background: rgba(234,67,53,0.1); color: var(--red); }
.quiz-option .option-marker {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.quiz-result-banner {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
}
.quiz-result-banner.show { display: flex; align-items: center; gap: 8px; }
.quiz-result-banner.correct-result { background: rgba(52,168,83,0.12); color: var(--green); }
.quiz-result-banner.wrong-result { background: rgba(234,67,53,0.12); color: var(--red); }
.quiz-explanation { font-size: 0.8rem; font-weight: 400; color: var(--gray-600); margin-top: 4px; }

/* ---- MEMBERS LIST ---- */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.member-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px;
  text-align: center;
  transition: var(--transition);
}
.member-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.member-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}
.member-alias { font-size: 0.85rem; font-weight: 600; color: var(--gray-800); }
.member-joined { font-size: 0.73rem; color: var(--gray-400); margin-top: 3px; }

/* ---- MATERIALS ---- */
.material-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  transition: var(--transition);
}
.material-item:hover { border-color: rgba(66,133,244,0.3); box-shadow: var(--shadow-sm); }
.material-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.material-info { flex: 1; }
.material-title { font-size: 0.875rem; font-weight: 600; color: var(--gray-800); margin-bottom: 3px; }
.material-desc { font-size: 0.78rem; color: var(--gray-500); }

/* ---- PROGRESS BAR ---- */
.progress-ring-wrapper { text-align: center; }
.progress-circular {
  transform: rotate(-90deg);
}
.progress-circular circle { transition: stroke-dashoffset 1s ease; }

/* ---- ADMIN SECTIONS ---- */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.admin-toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- EMPTY STATES ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; }
.empty-state-text { font-size: 0.85rem; line-height: 1.55; }

/* ---- LOADING ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
.loading-text { font-size: 0.9rem; color: var(--gray-500); font-weight: 500; }

/* ---- PROGRESS VIEW ---- */
.progress-course-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.progress-course-thumb {
  width: 70px; height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-200);
}
.progress-course-info { flex: 1; min-width: 0; }
.progress-course-title { font-size: 0.9rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.progress-bar-wrap { flex: 1; }
.progress-bar-bg {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 4px;
  transition: width 1s ease;
}
.progress-percent { font-size: 0.8rem; color: var(--gray-500); }

/* ---- COURSE VIEWER ---- */
#course-viewer-section { display: none; }
#course-viewer-section.active { display: block; }
.course-viewer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.back-btn {
  background: var(--gray-100);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  color: var(--gray-700);
}
.back-btn:hover { background: var(--gray-200); }

/* ---- ANIMATIONS ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---- UTILITIES ---- */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--gray-500); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Password eye toggle */
.input-wrapper { position: relative; }
.input-wrapper input { padding-right: 42px; }
.eye-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 1rem;
  display: flex; align-items: center;
  padding: 0;
  transition: var(--transition);
}
.eye-toggle:hover { color: var(--gray-700); }

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  gap: 4px;
  overflow-x: auto;
}
.tab-item {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-item:hover { color: var(--blue); }
.tab-item.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Role badge */
.role-admin { background: rgba(124,77,255,0.12); color: #7C4DFF; }
.role-student { background: rgba(66,133,244,0.12); color: var(--blue); }

/* Search highlight */
mark {
  background: rgba(251,188,5,0.35);
  color: inherit;
  border-radius: 2px;
}

/* Mini spinner for buttons */
.btn-loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 4px;
}

/* Alert info box */
.info-box {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.83rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.info-box.info { background: rgba(66,133,244,0.08); border: 1px solid rgba(66,133,244,0.2); color: #1d4ed8; }
.info-box.warning { background: rgba(251,188,5,0.1); border: 1px solid rgba(251,188,5,0.3); color: #92400e; }
.info-box.success { background: rgba(52,168,83,0.08); border: 1px solid rgba(52,168,83,0.2); color: #166534; }
.info-box.danger { background: rgba(234,67,53,0.08); border: 1px solid rgba(234,67,53,0.2); color: #991b1b; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  #sidebar {
    transform: translateX(-240px);
    width: 240px;
  }
  #sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  #main-content { margin-left: 0; padding: 20px 16px 60px; }

  #app-header .app-header-logo { display: none; }
  #app-header { padding: 0 16px; }
  #app-header .app-header-search { display: none; }

  .hero { padding: 60px 20px 60px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-stats { gap: 20px; }

  .public-section { padding: 40px 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  .courses-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  #public-header .header-search { display: none; }

  .admin-toolbar { flex-direction: column; align-items: flex-start; }

  .modal-box { margin: 10px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }

  .hero-actions { flex-direction: column; align-items: center; }
  .hero-search { flex-direction: column; }

  .progress-course-item { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .benefits-grid { grid-template-columns: 1fr; }
  .members-grid { grid-template-columns: repeat(2, 1fr); }
  .tabs { gap: 0; }
  .tab-item { padding: 10px 12px; font-size: 0.8rem; }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 799;
}
.sidebar-overlay.show { display: block; }

/* Hamburger button */
.hamburger-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  color: var(--gray-700);
  display: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.hamburger-btn:hover { background: var(--gray-100); }
@media (max-width: 768px) { .hamburger-btn { display: flex; align-items: center; } }

/* Notification dot */
.notif-dot {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid white;
  position: absolute;
  top: -1px; right: -1px;
}

/* Input with copy button */
.input-copy-wrap { display: flex; gap: 8px; }
.input-copy-wrap input { flex: 1; }

/* ============================================================
   FERPAUL ACADEMY — MENÚ HORIZONTAL TIPO COMUNIDAD
   Convierte el sidebar izquierdo en navegación superior
   sin tocar la lógica de app.js
   ============================================================ */

:root {
  --top-nav-height: 72px;
}

/* Header superior más parecido a plataforma/comunidad */
#app-header {
  padding: 0 28px !important;
  gap: 22px !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

#app-header .app-header-logo {
  width: auto !important;
  min-width: 230px;
  border-right: none !important;
  padding: 0 !important;
}

#app-header .app-header-search {
  max-width: 620px !important;
}

#app-header .app-header-search input {
  height: 42px;
  background: #f3f4f6 !important;
  border-radius: 14px !important;
}

/* El antiguo sidebar ahora es barra horizontal */
#sidebar {
  position: fixed !important;
  top: var(--header-height) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: var(--top-nav-height) !important;
  background: #ffffff !important;
  border-right: none !important;
  border-bottom: 1px solid var(--border) !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  z-index: 850 !important;
  padding: 0 28px !important;
  display: flex !important;
  align-items: center !important;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.04);
}

/* Solo muestra el menú correspondiente al rol */
#student-sidebar:not(.hidden),
#admin-sidebar:not(.hidden) {
  display: flex !important;
  align-items: center !important;
  gap: 28px !important;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

/* Las secciones del sidebar se vuelven grupos horizontales */
.sidebar-section {
  display: flex !important;
  align-items: center !important;
  gap: 22px !important;
  margin-bottom: 0 !important;
  flex-shrink: 0;
}

/* Oculta títulos como Principal, Comunidad, Contenido, Cuenta */
.sidebar-section-label {
  display: none !important;
}

/* Botones estilo tabs horizontales */
.sidebar-item {
  height: var(--top-nav-height) !important;
  padding: 0 0 !important;
  border-left: none !important;
  border-bottom: 4px solid transparent !important;
  background: transparent !important;
  color: #6b7280 !important;
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  border-radius: 0 !important;
}

.sidebar-item:hover {
  background: transparent !important;
  color: #111827 !important;
}

.sidebar-item.active {
  background: transparent !important;
  color: #111827 !important;
  border-bottom-color: #111827 !important;
}

/* Iconos más pequeños, como tabs */
.sidebar-item .sidebar-icon {
  width: auto !important;
  font-size: 1rem !important;
}

/* El contenido ya no debe dejar espacio a la izquierda */
#app-layout {
  padding-top: calc(var(--header-height) + var(--top-nav-height)) !important;
}

#main-content {
  margin-left: 0 !important;
  padding: 34px 7vw 70px !important;
  background: #ffffff;
}

/* Fondo general más parecido a la referencia */
body {
  background: #ffffff !important;
}

/* Tarjetas de cursos más grandes tipo classroom */
#student-classroom-grid,
#student-my-courses-grid,
#student-catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
  gap: 28px !important;
}

.course-card {
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.10) !important;
}

.course-thumb {
  height: 210px !important;
}

.course-title {
  font-size: 1.12rem !important;
}

.course-desc {
  font-size: 0.95rem !important;
}

/* Ya no necesitamos overlay de sidebar móvil */
.sidebar-overlay {
  display: none !important;
}

/* Botón hamburguesa oculto en desktop */
.hamburger-btn {
  display: none !important;
}

/* Responsive: la barra horizontal se puede deslizar */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --top-nav-height: 64px;
  }

  #app-header {
    padding: 0 14px !important;
  }

  #app-header .app-header-logo {
    min-width: auto;
  }

  #app-header .app-header-search {
    display: none !important;
  }

  #sidebar {
    transform: none !important;
    width: 100% !important;
    height: var(--top-nav-height) !important;
    padding: 0 16px !important;
  }

  #student-sidebar:not(.hidden),
  #admin-sidebar:not(.hidden) {
    gap: 22px !important;
    margin: 0;
    max-width: none;
  }

  .sidebar-section {
    gap: 20px !important;
  }

  .sidebar-item {
    height: var(--top-nav-height) !important;
    font-size: 0.9rem !important;
  }

  #app-layout {
    padding-top: calc(var(--header-height) + var(--top-nav-height)) !important;
  }

  #main-content {
    margin-left: 0 !important;
    padding: 24px 16px 60px !important;
  }

  #student-classroom-grid,
  #student-my-courses-grid,
  #student-catalog-grid {
    grid-template-columns: 1fr !important;
  }
}
/* ============================================================
   ADMIN BANNERS
   ============================================================ */

.admin-banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
}

.admin-banner-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.admin-banner-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.admin-banner-img {
  height: 145px;
  background: linear-gradient(135deg, var(--blue), var(--dark));
  position: relative;
  overflow: hidden;
}

.admin-banner-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-banner-status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: white;
  backdrop-filter: blur(8px);
}

.admin-banner-status.active {
  background: rgba(52, 168, 83, 0.92);
}

.admin-banner-status.inactive {
  background: rgba(107, 114, 128, 0.92);
}

.admin-banner-body {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.admin-banner-body strong {
  display: block;
  color: var(--gray-900);
  font-size: 0.92rem;
  line-height: 1.35;
}

.admin-banner-body p {
  color: var(--gray-500);
  font-size: 0.78rem;
  margin-top: 4px;
}

.admin-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* ============================================================
   GALLERY STYLE PARA CURSOS — TIPO COMUNIDAD / MARKETPLACE
   ============================================================ */

#public-catalog-section {
  background: #ffffff !important;
}

#public-courses-grid,
#student-catalog-grid,
#student-classroom-grid,
#student-my-courses-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
  gap: 30px !important;
}

.gallery-course-card {
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease !important;
}

.gallery-course-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14) !important;
  border-color: rgba(66, 133, 244, 0.28) !important;
}

.gallery-course-thumb {
  height: 230px !important;
  background: #111827 !important;
  position: relative !important;
}

.gallery-course-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 0.45s ease, filter 0.45s ease !important;
}

.gallery-course-card:hover .gallery-course-thumb img {
  transform: scale(1.06) !important;
  filter: saturate(1.08) contrast(1.04) !important;
}

.gallery-course-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.38));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.gallery-course-card:hover .gallery-course-overlay {
  opacity: 1;
}

.gallery-play-btn {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.20);
  color: #ffffff;
  font-size: 1.5rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  transition: transform 0.22s ease, background 0.22s ease;
}

.gallery-play-btn:hover {
  transform: scale(1.08);
  background: rgba(66, 133, 244, 0.85);
}

.gallery-course-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.gallery-course-body {
  padding: 22px !important;
}

.gallery-course-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.gallery-course-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex: 0 0 46px;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

.gallery-course-title {
  font-size: 1.18rem !important;
  line-height: 1.25 !important;
  font-weight: 900 !important;
  margin-bottom: 4px !important;
  color: #111827 !important;
  -webkit-line-clamp: 2 !important;
}

.gallery-course-category {
  font-size: 0.72rem !important;
  font-weight: 900 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: #4285F4 !important;
  margin: 0 !important;
}

.gallery-course-desc {
  font-size: 0.96rem !important;
  line-height: 1.65 !important;
  color: #374151 !important;
  min-height: 74px;
  margin-bottom: 22px !important;
  -webkit-line-clamp: 3 !important;
}

.gallery-course-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #111827;
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.gallery-course-meta strong {
  font-weight: 900;
}

.gallery-course-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-course-actions .btn {
  border-radius: 999px !important;
}

.gallery-course-actions .btn-secondary {
  background: #f3f4f6 !important;
  color: #374151 !important;
}

@media (max-width: 768px) {
  #public-courses-grid,
  #student-catalog-grid,
  #student-classroom-grid,
  #student-my-courses-grid {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }

  .gallery-course-thumb {
    height: 210px !important;
  }

  .gallery-course-body {
    padding: 18px !important;
  }

  .gallery-course-desc {
    min-height: auto;
  }
}
/* ============================================================
   MIS CURSOS — GALERÍA DE VIDEOS TIPO CARDS
   ============================================================ */

#student-my-courses-grid.student-video-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
  gap: 28px !important;
}

.student-video-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.student-video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
  border-color: rgba(66, 133, 244, 0.38);
}

.student-video-thumb {
  position: relative;
  height: 220px;
  background: #111827;
  overflow: hidden;
}

.student-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.student-video-card:hover .student-video-thumb img {
  transform: scale(1.06);
  filter: saturate(1.08) contrast(1.05);
}

.student-video-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #4285F4, #111827);
}

.student-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.45));
  opacity: 0;
  transition: opacity 0.22s ease;
}

.student-video-card:hover .student-video-play {
  opacity: 1;
}

.student-video-play span {
  width: 66px;
  height: 66px;
  border-radius: 999px;
  background: rgba(66, 133, 244, 0.92);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  font-size: 1.55rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.30);
  border: 2px solid rgba(255,255,255,0.85);
}

.student-video-course-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: calc(100% - 28px);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-video-body {
  padding: 20px;
}

.student-video-module {
  color: #4285F4;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.student-video-title {
  color: #111827;
  font-size: 1.15rem;
  line-height: 1.28;
  font-weight: 900;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.student-video-desc {
  color: #4b5563;
  font-size: 0.92rem;
  line-height: 1.55;
  min-height: 48px;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.student-video-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.student-video-footer .btn {
  border-radius: 999px !important;
}

@media (max-width: 768px) {
  #student-my-courses-grid.student-video-gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }

  .student-video-thumb {
    height: 205px;
  }
}