/* ==========================================================================
   PumaDB Engine — Web Landing & Interactive CLI
   Estilos inspirados en cli.github.com (Dark Mode de Alto Contraste)
   ========================================================================== */

:root {
  --bg-page: #06090f;
  --bg-canvas: #090d16;
  --bg-card: #0d1117;
  --bg-surface: #161b22;
  --bg-overlay: #21262d;
  --bg-input: #04070b;

  --border-default: #30363d;
  --border-muted: #21262d;
  --border-hover: #484f58;
  --border-focus: #58a6ff;

  --fg-default: #c9d1d9;
  --fg-muted: #8b949e;
  --fg-subtle: #6e7681;
  --fg-bright: #f0f6fc;

  /* Colores UNAM & ANSI Terminal */
  --accent-gold: #f2ba42;
  --accent-gold-glow: rgba(242, 186, 66, 0.15);
  --accent-blue: #58a6ff;
  --accent-blue-glow: rgba(88, 166, 255, 0.15);
  --accent-cyan: #39c5bb;
  --accent-green: #3fb950;
  --accent-purple: #bc8cff;
  --accent-red: #f85149;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-terminal: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-default);
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-page);
  color: var(--fg-default);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(57, 197, 187, 0.12), transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(242, 186, 66, 0.08), transparent 60%);
  background-attachment: fixed;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #79c0ff;
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  background-color: rgba(110, 118, 129, 0.15);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--fg-bright);
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center {
  text-align: center;
}

/* Header de la Página */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-muted);
  transition: border-color 0.2s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg-bright);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand-logo:hover {
  text-decoration: none;
}

.brand-icon {
  font-size: 1.35rem;
}

.brand-accent {
  color: var(--accent-gold);
}

.badge-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  background-color: var(--bg-surface);
  color: var(--accent-cyan);
  border: 1px solid var(--border-default);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--fg-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--fg-bright);
  text-decoration: none;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: var(--bg-surface);
  color: var(--fg-bright);
  border: 1px solid var(--border-default);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-github:hover {
  background-color: var(--bg-overlay);
  border-color: var(--fg-muted);
  color: #fff;
  text-decoration: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  padding: 4.5rem 0 3.5rem;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.hero-badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
}

.unam-badge {
  background-color: rgba(242, 186, 66, 0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(242, 186, 66, 0.3);
}

.subject-badge {
  background-color: rgba(57, 197, 187, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(57, 197, 187, 0.3);
}

.hero-title {
  font-size: 3.1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--fg-bright);
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  max-width: 680px;
  margin: 0 auto 2.25rem;
  font-size: 1.15rem;
  color: var(--fg-muted);
}

.hero-description strong {
  color: var(--fg-bright);
}

/* Quickstart Snippet */
.quickstart-box {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  max-width: 100%;
}

.quickstart-code {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  overflow-x: auto;
  white-space: nowrap;
  padding-right: 0.75rem;
}

.prompt-symbol {
  color: var(--accent-cyan);
  font-weight: 700;
  user-select: none;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-surface);
  color: var(--fg-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-copy:hover {
  background-color: var(--bg-overlay);
  color: var(--fg-bright);
  border-color: var(--fg-muted);
}

.btn-copy.copied {
  background-color: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

/* ==========================================================================
   Terminal Window (Emulador Interactivo)
   ========================================================================== */

.terminal-wrapper {
  margin-top: 2.75rem;
}

.terminal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.terminal-tabs-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.terminal-action-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-btn {
  background-color: var(--bg-surface);
  color: var(--fg-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pill-btn:hover {
  background-color: var(--bg-overlay);
  border-color: var(--accent-cyan);
  color: var(--fg-bright);
  transform: translateY(-1px);
}

.pill-verb {
  font-weight: 700;
  color: var(--accent-cyan);
}

.pill-btn:nth-child(2) .pill-verb { color: var(--accent-green); }
.pill-btn:nth-child(3) .pill-verb { color: var(--accent-gold); }
.pill-btn:nth-child(4) .pill-verb { color: var(--accent-red); }
.pill-btn:nth-child(5) .pill-verb { color: var(--accent-purple); }
.pill-btn-clear .pill-verb { color: var(--fg-muted); }

.terminal-window {
  background-color: #05080e;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-terminal);
  overflow: hidden;
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #0b0f17;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-default);
  user-select: none;
}

.terminal-window-buttons {
  display: flex;
  gap: 0.5rem;
}

.win-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.win-btn.close { background-color: #ff5f56; }
.win-btn.minimize { background-color: #ffbd2e; }
.win-btn.zoom { background-color: #27c93f; }

.terminal-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.terminal-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-green);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.terminal-body {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg-bright);
  min-height: 480px;
  max-height: 600px;
  overflow-y: auto;
  overflow-x: auto;
  outline: none;
}

/* Formato de texto y logs en la terminal */
.terminal-line {
  white-space: pre;
  word-break: break-all;
  margin-bottom: 0.15rem;
}

.terminal-cmd-echo {
  color: var(--accent-cyan);
  font-weight: 700;
  margin-top: 0.5rem;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  background-color: rgba(22, 27, 34, 0.4);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
}

.cli-prompt {
  color: var(--accent-cyan);
  font-weight: 700;
  user-select: none;
  font-size: 1.1rem;
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
}

#terminal-input::placeholder {
  color: var(--fg-subtle);
  font-size: 0.85rem;
}

.btn-execute {
  background-color: var(--bg-surface);
  color: var(--accent-cyan);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-execute:hover {
  background-color: var(--accent-cyan);
  color: #000;
}

.terminal-footer-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-align: center;
}

/* Clases de emulación ANSI */
.ansi-gray { color: #8b949e; }
.ansi-cyan { color: #39c5bb; font-weight: 700; }
.ansi-yellow { color: #f2ba42; font-weight: 700; }
.ansi-green { color: #3fb950; font-weight: 700; }
.ansi-blue { color: #58a6ff; font-weight: 700; }
.ansi-magenta { color: #bc8cff; font-weight: 700; }
.ansi-red { color: #f85149; font-weight: 700; }
.ansi-dim { opacity: 0.65; }
.ansi-bold { font-weight: 700; }

/* ==========================================================================
   Secciones Generales
   ========================================================================== */

.section {
  padding: 5rem 0;
  border-top: 1px solid var(--border-muted);
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--fg-bright);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--fg-muted);
  max-width: 620px;
  margin: 0 auto 3rem;
}

/* ==========================================================================
   Grid de Características
   ========================================================================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.feature-icon-box {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--fg-bright);
  margin-bottom: 0.65rem;
}

.feature-text {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.55;
  flex: 1;
}

.feature-meta {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  border-top: 1px solid var(--border-muted);
  padding-top: 0.75rem;
}

/* ==========================================================================
   Showcase de Capturas
   ========================================================================== */

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 2rem;
}

.screenshot-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}

.screenshot-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
}

.screenshot-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: #030508;
  overflow: hidden;
}

.screenshot-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.screenshot-card:hover .screenshot-preview img {
  transform: scale(1.02);
}

.screenshot-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(9, 13, 22, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.screenshot-card:hover .screenshot-overlay {
  opacity: 1;
}

.zoom-btn {
  background-color: var(--bg-overlay);
  color: #fff;
  border: 1px solid var(--border-default);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.screenshot-info {
  padding: 1.5rem;
}

.screenshot-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.screenshot-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg-bright);
  margin-bottom: 0.4rem;
}

.screenshot-desc {
  font-size: 0.92rem;
  color: var(--fg-muted);
}

/* ==========================================================================
   Tabla de Referencia SQL
   ========================================================================== */

.table-container {
  overflow-x: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.sql-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.sql-table th {
  background-color: var(--bg-surface);
  color: var(--fg-bright);
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
}

.sql-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-muted);
  vertical-align: middle;
}

.sql-table tr:last-child td {
  border-bottom: none;
}

.sql-table tr:hover td {
  background-color: rgba(22, 27, 34, 0.4);
}

.sql-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.sql-badge.select { background-color: rgba(57, 197, 187, 0.15); color: var(--accent-cyan); }
.sql-badge.insert { background-color: rgba(63, 185, 80, 0.15); color: var(--accent-green); }
.sql-badge.update { background-color: rgba(242, 186, 66, 0.15); color: var(--accent-gold); }
.sql-badge.delete { background-color: rgba(248, 81, 73, 0.15); color: var(--accent-red); }
.sql-badge.exit { background-color: rgba(188, 140, 255, 0.15); color: var(--accent-purple); }

.lock-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.lock-badge.shared { background-color: rgba(88, 166, 255, 0.12); color: var(--accent-blue); }
.lock-badge.exclusive { background-color: rgba(242, 186, 66, 0.12); color: var(--accent-gold); }
.lock-badge.none { color: var(--fg-subtle); }

/* ==========================================================================
   Banner de Documentación
   ========================================================================== */

.docs-banner {
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.9) 0%, rgba(9, 13, 22, 0.9) 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.docs-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(circle, rgba(57, 197, 187, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.docs-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--fg-bright);
  margin-bottom: 0.75rem;
}

.docs-description {
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--fg-muted);
}

.docs-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-doc {
  background-color: var(--bg-surface);
  color: var(--fg-bright);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-doc:hover {
  background-color: var(--bg-overlay);
  border-color: var(--accent-cyan);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}

/* ==========================================================================
   Pie de Página
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border-muted);
  padding: 3rem 0;
  background-color: #04070b;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg-bright);
  margin-bottom: 0.35rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--fg-subtle);
  line-height: 1.4;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 0.35rem;
}

.back-to-top {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ==========================================================================
   Modal Lightbox
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--accent-red);
}

.modal-image-wrapper {
  background-color: #000;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
}

.modal-image-wrapper img {
  display: block;
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
}

.modal-caption {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--fg-default);
  font-family: var(--font-mono);
  text-align: center;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .screenshots-grid {
    grid-template-columns: 1fr;
  }

  .terminal-body {
    min-height: 380px;
    font-size: 0.8rem;
  }

  .quickstart-box {
    width: 100%;
  }

  .quickstart-code {
    font-size: 0.78rem;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  .footer-right {
    text-align: center;
  }
}

