/* ============================================
   PCB RECURSOS EDUCATIVOS - ESTILOS PRINCIPALES
   Escuela Superior Vocacional Pablo Colón Berdecia
   ============================================ */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* === VARIABLES DE COLOR - MODO CLARO === */
:root {
  --primary: #1a5f7a;
  --primary-light: #2980b9;
  --primary-dark: #0d3d52;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --purple: #8e44ad;

  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --bg-nav: #1a5f7a;
  --bg-sidebar: #0d3d52;
  --bg-hover: #e8f4f8;
  --bg-input: #ffffff;
  --bg-modal: rgba(0,0,0,0.5);

  --text: #1a2332;
  --text-secondary: #5a6a7a;
  --text-light: #8a9ab0;
  --text-white: #ffffff;
  --text-nav: #e8f4f8;

  --border: #d0dde8;
  --border-light: #e8f0f8;
  --shadow: 0 4px 20px rgba(26,95,122,0.12);
  --shadow-hover: 0 8px 32px rgba(26,95,122,0.22);
  --shadow-card: 0 2px 12px rgba(26,95,122,0.08);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* === VARIABLES - MODO OSCURO === */
[data-theme="dark"] {
  --bg: #0d1b2a;
  --bg-card: #162535;
  --bg-nav: #0a1520;
  --bg-sidebar: #061018;
  --bg-hover: #1e3045;
  --bg-input: #1e3045;

  --text: #e8f4f8;
  --text-secondary: #8aacbf;
  --text-light: #5a7a8f;
  --text-nav: #c8e0ec;

  --border: #1e3045;
  --border-light: #2a4060;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
}

/* === RESET Y BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* === TIPOGRAFÍA === */
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p { line-height: 1.7; color: var(--text-secondary); }
a { text-decoration: none; color: inherit; }
code { font-family: 'JetBrains Mono', monospace; }

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--bg-nav);
  z-index: 1000;
  padding: 0 1.5rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
  border-bottom: 2px solid rgba(255,255,255,0.08);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  min-width: 0;
}

.nav-logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 12px rgba(230,126,34,0.4);
}

.nav-title { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
.nav-subtitle { font-size: 0.7rem; color: rgba(255,255,255,0.6); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-nav);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 0.4rem;
}

.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Botón Regresar al PCB System */
.btn-pcb {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  box-shadow: 0 2px 12px rgba(230,126,34,0.4);
  transition: all var(--transition) !important;
  border: none;
  cursor: pointer;
}

.btn-pcb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(230,126,34,0.5) !important;
  background: linear-gradient(135deg, #d35400, var(--accent)) !important;
}

/* Toggle tema */
.theme-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.theme-toggle:hover { background: rgba(255,255,255,0.2); transform: rotate(15deg); }

/* Hamburger */
.hamburger {
  display: none;
  background: none; border: none; color: #fff;
  font-size: 1.5rem; cursor: pointer; padding: 0.5rem;
}

.nav-mobile {
  display: none;
}

/* === MAIN LAYOUT === */
.app-wrapper { padding-top: 68px; min-height: 100vh; }

/* === HERO SECTION === */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: #fff;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(230,126,34,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  position: relative; z-index: 1;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
}

.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1rem; color: #fff; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: rgba(255,255,255,0.8); margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }

.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem;
  margin-bottom: 2.5rem; flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-num { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 800; color: var(--accent-light); display: block; }
.stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.7); }

.hero-btns {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}

/* === BOTONES === */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none;
  justify-content: center;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(230,126,34,0.4);
}

.btn-primary:hover { background: #d35400; transform: translateY(-2px); box-shadow: 0 6px 24px rgba(230,126,34,0.5); }

.btn-secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover { background: rgba(255,255,255,0.25); transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.82rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }

/* === SECCIONES === */
.section { padding: 4rem 2rem; }
.section-alt { background: var(--bg-card); }

.container { max-width: 1200px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { margin-bottom: 0.75rem; }
.section-header p { max-width: 600px; margin: 0 auto; }
.section-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; padding: 0.3rem 0.9rem;
  border-radius: 50px; font-size: 0.78rem; font-weight: 600;
  margin-bottom: 0.75rem; letter-spacing: 0.5px;
}

/* === BÚSQUEDA === */
.search-section {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin: 2rem auto;
  max-width: 1200px;
}

.search-bar {
  display: flex; gap: 0.75rem; margin-bottom: 1rem; align-items: center;
}

.search-input {
  flex: 1;
  padding: 0.85rem 1.2rem 0.85rem 3rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,95,122,0.1); }

.search-wrapper { position: relative; flex: 1; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-light); }

.filter-tags {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}

.filter-tag {
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
}

.filter-tag:hover, .filter-tag.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* === GRID DE MATERIAS === */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.subject-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.subject-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.subject-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.subject-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
  transition: transform var(--transition);
}

.subject-card:hover .subject-icon { transform: scale(1.1) rotate(5deg); }

.subject-card h3 { font-size: 0.95rem; margin-bottom: 0.4rem; }
.subject-card p { font-size: 0.78rem; color: var(--text-light); }

.subject-count {
  display: inline-block;
  background: var(--bg);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.72rem; font-weight: 600;
  margin-top: 0.75rem;
}

/* === TARJETAS DE RECURSOS === */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.resource-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
  display: flex; flex-direction: column;
}

.resource-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary-light); }

.resource-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; }

.resource-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}

.resource-title { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: 0.2rem; }
.resource-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; flex: 1; }

.resource-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.75rem 0; }
.tag {
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.72rem; font-weight: 600;
  background: var(--bg-hover);
  color: var(--primary);
}

.resource-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border-light); }

/* === QUICK ACCESS === */
.quick-access {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.quick-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

.quick-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.quick-card .icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.quick-card h4 { font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
.quick-card p { font-size: 0.75rem; }

/* === TABS === */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.tab-btn {
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.tab-btn.active, .tab-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === MODAL === */
.modal {
  position: fixed; inset: 0;
  background: var(--bg-modal);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}

.modal.open { opacity: 1; pointer-events: all; }

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 700px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition);
}

.modal.open .modal-content { transform: scale(1) translateY(0); }

.modal-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.modal-close {
  margin-left: auto;
  background: var(--bg-hover); border: none;
  width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; font-size: 1.1rem; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; }

/* === BIBLIOTECA DIGITAL === */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.lib-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}

.lib-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.lib-banner {
  height: 90px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  position: relative;
}

.lib-body { padding: 1.25rem; }
.lib-body h4 { font-family: 'DM Sans', sans-serif; font-weight: 700; margin-bottom: 0.4rem; }
.lib-body p { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.lib-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

/* === ESTADÍSTICAS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--primary);
  transition: all var(--transition);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-info h3 { font-family: 'Playfair Display', serif; font-size: 1.8rem; margin-bottom: 0.2rem; }
.stat-info p { font-size: 0.8rem; color: var(--text-secondary); margin: 0; }

/* === FORMULARIOS === */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-weight: 600; font-size: 0.85rem;
  color: var(--text); margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}

.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,95,122,0.1); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* === NOTIFICACIONES === */
.toast-container {
  position: fixed; bottom: 2rem; right: 2rem;
  z-index: 3000; display: flex; flex-direction: column; gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-hover);
  border-left: 4px solid var(--primary);
  max-width: 350px;
  animation: slideIn 0.3s ease;
  font-size: 0.9rem;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === FOOTER === */
footer {
  background: var(--bg-nav);
  color: rgba(255,255,255,0.8);
  padding: 3rem 2rem 1.5rem;
}

.footer-content {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h3 { color: #fff; font-size: 1.3rem; margin-bottom: 0.5rem; }
.footer-brand p { font-size: 0.85rem; color: rgba(255,255,255,0.6); line-height: 1.6; }

.footer-links h4 { color: #fff; font-size: 0.9rem; margin-bottom: 1rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: rgba(255,255,255,0.6); font-size: 0.85rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent-light); }

.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: gap;
  gap: 1rem;
}

.footer-bottom p { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* === COLORS POR MATERIA === */
.color-math { background: linear-gradient(135deg, #667eea, #764ba2); }
.color-esp { background: linear-gradient(135deg, #f093fb, #f5576c); }
.color-eng { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.color-sci { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.color-bio { background: linear-gradient(135deg, #a8edea, #fed6e3); }
.color-chem { background: linear-gradient(135deg, #fd7043, #ffa726); }
.color-phys { background: linear-gradient(135deg, #667eea, #43e97b); }
.color-stem { background: linear-gradient(135deg, #1a5f7a, #2980b9); }
.color-comp { background: linear-gradient(135deg, #2c3e50, #4ca1af); }
.color-cul { background: linear-gradient(135deg, #ff6b6b, #feca57); }
.color-deca { background: linear-gradient(135deg, #54a0ff, #5f27cd); }
.color-agr { background: linear-gradient(135deg, #1abc9c, #2ecc71); }
.color-cos { background: linear-gradient(135deg, #fd79a8, #e84393); }
.color-adm { background: linear-gradient(135deg, #0984e3, #6c5ce7); }
.color-ruta { background: linear-gradient(135deg, #00b894, #00cec9); }
.color-hist { background: linear-gradient(135deg, #8d6e63, #795548); }
.color-soc { background: linear-gradient(135deg, #e17055, #d63031); }
.color-sal { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.color-gero { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

/* === SECCIÓN ACTIVA === */
.section-page { display: none; }
.section-page.active { display: block; }

/* === ANIMACIONES === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-in { animation: fadeInUp 0.5s ease both; }

/* Stagger */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* === DIVIDER === */
.divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 2rem 0;
}

/* === BADGE === */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.badge-primary { background: rgba(26,95,122,0.12); color: var(--primary); }
.badge-success { background: rgba(39,174,96,0.12); color: var(--success); }
.badge-warning { background: rgba(243,156,18,0.12); color: var(--warning); }
.badge-danger { background: rgba(231,76,60,0.12); color: var(--danger); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-actions { gap: 0.5rem; }
  .nav-actions .btn-pcb,
  .nav-actions a[href="admin.html"] {
    display: none;
  }

  .nav-mobile {
    position: fixed; top: 68px; left: 0; right: 0;
    background: var(--bg-nav);
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 999;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }

  .nav-mobile.open { display: block; }
  .nav-mobile ul { list-style: none; }
  .nav-mobile ul li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-nav);
    border-radius: var(--radius-sm);
  }
  .nav-mobile ul li a:hover { background: rgba(255,255,255,0.1); }

  .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .section { padding: 3rem 1rem; }
  .hero { padding: 3rem 1.5rem 2.5rem; }
  .hero-stats { gap: 1.5rem; }
  .search-section { padding: 1.25rem; margin: 1.25rem 1rem; border-radius: var(--radius); }
  .search-bar { flex-direction: column; align-items: stretch; }
  .search-wrapper { width: 100%; }
  .search-bar .btn { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .resources-grid { grid-template-columns: 1fr; }
  .subjects-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .quick-access { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
  .modal-content { padding: 1.25rem; }
}

@media (max-width: 480px) {
  .navbar { height: 62px; padding: 0 0.75rem; }
  .app-wrapper { padding-top: 62px; }
  .nav-logo { width: 36px; height: 36px; font-size: 1.1rem; }
  .nav-title { font-size: 0.95rem; }
  .nav-subtitle { display: none; }
  .nav-mobile { top: 62px; max-height: calc(100vh - 62px); }
  .theme-toggle { width: 34px; height: 34px; }
  .hamburger { padding: 0.35rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero-badge { border-radius: var(--radius-sm); }
  .hero-btns { flex-direction: column; }
  .btn-lg { width: 100%; justify-content: center; }
  .subjects-grid,
  .quick-access,
  .library-grid { grid-template-columns: 1fr; }
  .tabs { gap: 0.25rem; }
  .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.78rem; }
}

/* === LOADING SKELETON === */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-hover) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* === ADMIN STYLES === */
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.admin-table th {
  background: var(--primary); color: #fff;
  padding: 1rem; text-align: left; font-size: 0.85rem; font-weight: 600;
}

.admin-table td {
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem; vertical-align: middle;
}

.admin-table tr:hover td { background: var(--bg-hover); }
.admin-table tr:last-child td { border-bottom: none; }

/* Toggle switch */
.toggle-switch {
  position: relative; display: inline-block;
  width: 44px; height: 24px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 12px; transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: var(--transition);
}

input:checked + .toggle-slider { background: var(--success); }
input:checked + .toggle-slider::before { transform: translateX(20px); }
