/* ═══════════════════════════════════════════════════════
   styles.css — Manual de Usuario AulaSync
   ═══════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────── */
:root {
  --primary:       #4f46e5;
  --primary-dark:  #3730a3;
  --primary-light: #eef2ff;
  --accent:        #6ee7b7;
  --text:          #1e293b;
  --text-sub:      #64748b;
  --border:        #e2e8f0;
  --surface:       #ffffff;
  --bg:            #f8fafc;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --navbar-h:      68px;
}

/* ── Reset y base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

/* ── Navbar ───────────────────────────────────────────── */
#mainNavbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  height: var(--navbar-h);
  box-shadow: 0 2px 12px rgba(0,0,0,.20);
  z-index: 1030;
}

#mainNavbar .navbar-brand { letter-spacing: -.3px; }
#mainNavbar .brand-icon { flex-shrink: 0; }

#mainNavbar .nav-link {
  color: rgba(255,255,255,.85) !important;
  font-size: .9rem;
  border-radius: var(--radius-sm);
  padding: 6px 10px !important;
  transition: background .15s;
}
#mainNavbar .nav-link:hover,
#mainNavbar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.12);
}

/* ── Fix: menú móvil transparente ─────────────────────────
   #mainNavbar tiene una altura fija (--navbar-h) pensada para
   el navbar en una sola línea. Al desplegar el menú hamburguesa
   en móvil, Bootstrap agrega el contenido DENTRO del <nav>, que
   desborda esa altura fija; el contenido desbordado ya no tiene
   el fondo del navbar detrás y se ve "flotando" transparente
   sobre el contenido de la página. La solución es darle su
   propio fondo al panel desplegado y dejar que el <nav> crezca. */
@media (max-width: 991px) {
  #mainNavbar { height: auto; }
  #mainNavbar .navbar-collapse {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    margin: 0 -12px;
    padding: 10px 12px 16px;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 12px 24px rgba(0,0,0,.25);
  }
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
  min-height: 480px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  /* El navbar ahora es "fixed" (sale del flujo normal), así que el
     hero necesita este espacio arriba para no quedar tapado. */
  padding-top: var(--navbar-h);
  padding-bottom: var(--navbar-h);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(110,231,183,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0%, transparent 50%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.20);
  color: rgba(255,255,255,.9);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1.1;
}

.hero .sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.75);
  margin-top: 12px;
}

.hero-graphic {
  position: relative;
}
.hero-window {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(4px);
}
.hero-window-bar {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
}
.hero-window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.hero-module-card {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: rgba(255,255,255,.9);
  font-size: .85rem;
  font-weight: 500;
}
.hero-module-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Scroll indicator ─────────────────────────────────── */
.scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.5);
  font-size: .75rem;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

/* ── Layout principal ─────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
  padding-top: 40px;
  /* Impide que el grid sea más ancho que su contenedor */
  min-width: 0;
  max-width: 100%;
}

/* Cada hijo del grid también debe poder contraerse */
.main-layout > * {
  min-width: 0;
}

@media (max-width: 991px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .toc-sidebar { display: none; }
}

@media (max-width: 767px) {
  .main-layout {
    padding-top: 24px;
  }
}

/* ── TOC sidebar ──────────────────────────────────────── */
.toc-sidebar {
  position: sticky;
  top: calc(var(--navbar-h) + 20px);
  max-height: calc(100vh - var(--navbar-h) - 40px);
  overflow-y: auto;
}

.toc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-bottom: 12px;
}

#toc-nav a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text-sub);
  text-decoration: none;
  transition: all .15s;
  border-left: 2px solid transparent;
}
#toc-nav a:hover {
  color: var(--primary);
  background: var(--primary-light);
}
#toc-nav a.active {
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
  background: var(--primary-light);
}
#toc-nav .toc-sub {
  padding-left: 20px;
  font-size: .8rem;
}

/* ── Secciones ────────────────────────────────────────── */
.section-block {
  scroll-margin-top: calc(var(--navbar-h) + 16px);
  margin-bottom: 56px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

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

.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

/* ── Sección de bienvenida ────────────────────────────── */
.about-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 32px;
}

/* ── Tarjetas de requisitos ───────────────────────────── */
.req-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  height: 100%;
  transition: box-shadow .2s, transform .2s;
}
.req-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.req-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.req-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.req-value {
  font-size: .85rem;
  color: var(--text-sub);
}

/* ── Pasos numerados ──────────────────────────────────── */
.steps-list { list-style: none; padding: 0; }
.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.step-num {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-content { flex: 1; }
.step-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 1rem;
}
.step-desc {
  color: var(--text-sub);
  font-size: .9rem;
}

/* ── Placeholder de captura de pantalla ───────────────── */
.screenshot-placeholder {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 2px dashed #94a3b8;
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  margin: 20px 0;
}
.screenshot-placeholder .ph-icon { font-size: 2.5rem; color: #94a3b8; }
.screenshot-placeholder .ph-label {
  font-size: .85rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 4px;
}
.screenshot-placeholder .ph-hint {
  font-size: .75rem;
  color: #94a3b8;
}
.screenshot-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
  margin: 20px 0;
}

/* ── Callouts / alertas informativas ──────────────────── */
.callout {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 16px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: .9rem;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.callout-info  { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.callout-tip   { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.callout-warn  { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.callout-danger{ background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

/* ── Código ───────────────────────────────────────────── */
.code-block {
  background: #1e293b;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 12px 0;
  overflow-x: auto;
}
.code-block code {
  color: #e2e8f0;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: .875rem;
}
.btn-copy {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: #94a3b8;
  padding: 4px 8px;
  font-size: .8rem;
  cursor: pointer;
  transition: .15s;
}
.btn-copy:hover  { background: rgba(255,255,255,.2); color: white; }
.btn-copy.copied { background: #16a34a; color: white; border-color: #16a34a; }

/* ── Tabla CSV ────────────────────────────────────────── */
.csv-table th { background: var(--primary); color: white; font-size: .8rem; }
.csv-table td { font-size: .85rem; vertical-align: middle; }
.csv-table .optional { color: #94a3b8; font-style: italic; font-size: .75rem; }

/* ── Badge de módulo ──────────────────────────────────── */
.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
}

/* ── Feature list ─────────────────────────────────────── */
.feature-list {
  list-style: none;
  padding: 0;
}
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  color: var(--text-sub);
}
.feature-list li:last-child { border-bottom: none; }
.feature-list .fi { color: var(--primary); font-size: 1rem; margin-top: 1px; flex-shrink: 0; }

/* ── Tabla de contenidos mini (FAQ) ───────────────────── */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  font-weight: 600;
  cursor: pointer;
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-size: .95rem;
}
.faq-answer {
  color: var(--text-sub);
  font-size: .9rem;
  padding-bottom: 14px;
  display: none;
}
.faq-answer.show { display: block; }

/* ── Botón volver arriba ──────────────────────────────── */
#btn-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
#btn-top.visible { opacity: 1; transform: translateY(0); }
#btn-top:hover   { background: var(--primary-dark); }

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  background: #0f172a;
  padding: 56px 0 32px;
  margin-top: 80px;
}
.footer-links { list-style: none; padding: 0; }
.footer-links li + li { margin-top: 6px; }
.footer-links a,
.footer-links li {
  color: #94a3b8;
  text-decoration: none;
  font-size: .875rem;
  transition: color .15s;
}
.footer-links a:hover { color: white; }
.footer-divider { border-color: #1e293b; }
.text-footer-sub { color: #64748b; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { min-height: 360px; }
  .hero h1 { font-size: 2rem; }
  .hero-graphic { display: none; }
  .section-title { font-size: 1.3rem; }

  /* Evitar que el about-card desborde en móvil */
  .about-card { padding: 20px 16px; }

  /* Tabla CSV: forzar scroll interno en lugar de romper layout */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Callouts sin desbordamiento */
  .callout { padding: 12px 14px; word-break: break-word; }

  /* Código inline no desborde */
  code { word-break: break-all; }

  /* Steps */
  .step-item { gap: 10px; }
  .step-num  { width: 30px; height: 30px; font-size: .8rem; flex-shrink: 0; }

  /* Screenshot placeholders */
  .screenshot-placeholder { padding: 28px 16px; }

  /* Sección de requisitos */
  .req-card { padding: 14px; }

  /* Footer margin reducido */
  .site-footer { margin-top: 48px; }
}
