/* ==========================================================================
   jpegs.tools — Guía de usuario
   Sistema de diseño. Paleta extraída de frontend/tailwind.config.js
   ========================================================================== */

:root {
  /* Marca jpegs.tools */
  --bg:        #0d0d14;
  --card:      #16161f;
  --secondary: #1a1a2e;
  --border:    #2a2a3e;
  --primary:   #00ff88;   /* verde neón — el alma de la marca */
  --primary-dim: #00cc6e;

  /* Texto */
  --text:      #e8e8f0;
  --text-soft: #a0a0b8;
  --text-mute: #6a6a82;

  /* Acentos funcionales */
  --danger:  #ff4d5e;
  --warning: #ffb020;
  --info:    #4d9fff;
  --gold:    #ffcf4d;

  /* Glow del neón */
  --glow: 0 0 24px rgba(0, 255, 136, 0.25);
  --glow-strong: 0 0 36px rgba(0, 255, 136, 0.45);

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 980px;
  --sidebar-w: 264px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Sutil glow ambiental verde arriba */
  background-image:
    radial-gradient(900px 500px at 80% -10%, rgba(0,255,136,0.06), transparent 60%),
    radial-gradient(700px 400px at 0% 0%, rgba(77,159,255,0.04), transparent 55%);
  background-attachment: fixed;
}

/* ---------- Layout: sidebar + contenido ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #11111a, #0c0c12);
  border-right: 1px solid var(--border);
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 0 6px;
}
.brand .mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  box-shadow: var(--glow);
  border: 1px solid rgba(0,255,136,0.3);
}
.brand .name { font-weight: 800; font-size: 16px; letter-spacing: -0.3px; }
.brand .name span { color: var(--primary); }
.brand .tag { font-size: 11px; color: var(--text-mute); letter-spacing: 1.5px; text-transform: uppercase; }

.nav-group-label {
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 22px 10px 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .16s ease;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--secondary); color: var(--text); }
.nav a.active {
  background: rgba(0,255,136,0.08);
  color: var(--primary);
  border-color: rgba(0,255,136,0.25);
}
.nav a .ico { font-size: 16px; width: 20px; text-align: center; }

/* ---------- Contenido principal ---------- */
.main { flex: 1; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(13,13,20,0.78);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-soft);
}
.topbar .crumbs { display: flex; align-items: center; gap: 12px; }
.topbar .crumbs b { color: var(--text); }

/* Hamburguesa (solo móvil) */
.hamburger {
  display: none;
  background: var(--secondary);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  align-items: center; justify-content: center;
}
.hamburger:hover { border-color: rgba(0,255,136,0.4); color: var(--primary); }

.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

/* Anti-flash: oculta el contenido hasta que i18n aplica el idioma.
   Solo se activa por JS (script en <head>); si el JS está apagado, nunca
   se oculta y se ve el español inline. */
.i18n-loading .content,
.i18n-loading .sidebar .nav,
.i18n-loading .site-footer { visibility: hidden; }

/* Selector de idioma (lo inyecta i18n.js) */
.lang-switch { position: relative; margin-left: auto; margin-right: 10px; }
.lang-switch .lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--secondary); border: 1px solid var(--border);
  color: var(--text-soft); padding: 5px 12px; border-radius: 999px;
  font-size: 12px; cursor: pointer; font-family: inherit; line-height: 1;
}
.lang-switch .lang-btn:hover { border-color: rgba(0,255,136,0.45); color: var(--primary); }
.lang-switch .lang-btn .caret { font-size: 9px; opacity: .7; }
.lang-switch .lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 11px; padding: 6px; min-width: 168px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.55); z-index: 60; display: none;
}
.lang-switch.open .lang-menu { display: block; }
.lang-switch .lang-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: var(--text-soft);
  padding: 9px 11px; border-radius: 8px; font-size: 13px;
  cursor: pointer; text-align: left; font-family: inherit;
}
.lang-switch .lang-menu button:hover { background: var(--secondary); color: var(--text); }
.lang-switch .lang-menu button.active { color: var(--primary); font-weight: 600; }
.lang-switch .lang-menu button .flag { font-size: 15px; line-height: 1; }
/* En RTL (ej. árabe a futuro) el contenido se alinea a la derecha */
html[dir="rtl"] .content { direction: rtl; }
html[dir="rtl"] .steps > li { border-left: none; border-right: 2px solid var(--border); padding: 0 52px 22px 0; margin-left: 0; margin-right: 15px; }
html[dir="rtl"] .steps > li::before { left: auto; right: -16px; }
html[dir="rtl"] .callout { border-left-width: 1px; border-right-width: 4px; }
.topbar .pill {
  background: var(--secondary);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
}
.topbar .pill .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); margin-right: 7px;
  box-shadow: var(--glow);
}

.content { max-width: var(--maxw); margin: 0 auto; padding: 48px 32px 96px; }

/* ---------- Tipografía ---------- */
h1 {
  font-size: 38px; font-weight: 800; letter-spacing: -1px;
  line-height: 1.1; margin-bottom: 14px;
}
h1 .accent { color: var(--primary); }
h2 {
  font-size: 25px; font-weight: 700; letter-spacing: -0.5px;
  margin: 52px 0 16px; padding-top: 8px;
  display: flex; align-items: center; gap: 12px;
}
h2 .num {
  font-size: 14px; font-weight: 800;
  color: var(--primary);
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.3);
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
}
h3 { font-size: 18px; font-weight: 700; margin: 30px 0 10px; }
p { color: var(--text-soft); margin-bottom: 14px; }
p strong, li strong { color: var(--text); font-weight: 600; }
a { color: var(--primary); }

.lead { font-size: 18px; color: var(--text-soft); margin-bottom: 8px; }

code {
  font-family: var(--mono);
  background: var(--secondary);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.88em;
  color: var(--primary);
}

/* ---------- Hero (en index) ---------- */
.hero {
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(600px 300px at 90% -20%, rgba(0,255,136,0.12), transparent 70%),
    linear-gradient(160deg, #15151f, #101018);
  padding: 48px 44px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.hero .kicker {
  color: var(--primary); font-weight: 700; font-size: 13px;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 18px 0;
}

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  display: block;
  transition: all .18s ease;
}
.feature-card:hover {
  border-color: rgba(0,255,136,0.4);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}
.feature-card .fc-ico {
  width: 44px; height: 44px; border-radius: 11px;
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.25);
  display: grid; place-items: center; font-size: 22px;
  margin-bottom: 14px;
}
.feature-card h3 { color: var(--text); margin: 0 0 6px; }
.feature-card p { font-size: 14px; margin: 0; }
.feature-card .fc-go { color: var(--primary); font-weight: 600; font-size: 13px; margin-top: 12px; display: inline-block; }

/* ---------- Screenshots ---------- */
figure {
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--secondary);
}
figure img { width: 100%; display: block; }
figcaption {
  padding: 11px 16px;
  font-size: 12.5px;
  color: var(--text-mute);
  border-top: 1px solid var(--border);
  background: var(--card);
}
figcaption b { color: var(--primary); font-weight: 600; }

/* Capturas verticales/angostas (paneles del sidebar): tamaño nativo, centradas,
   sin estirar a todo el ancho. La descripción mantiene ancho cómodo. */
figure.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
figure.narrow img { width: auto; max-width: 240px; margin: 0 auto; }

/* ---------- Pasos numerados ---------- */
.steps { list-style: none; counter-reset: step; margin: 18px 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 52px;
  border-left: 2px solid var(--border);
  margin-left: 15px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: -16px; top: -4px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
}
.steps > li b { color: var(--text); }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius);
  padding: 16px 18px 16px 20px;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--card);
  font-size: 14.5px;
}
.callout .ct-title { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.callout p { margin: 0; }
.callout.tip     { border-left-color: var(--primary); }
.callout.tip .ct-title { color: var(--primary); }
.callout.warn    { border-left-color: var(--warning); }
.callout.warn .ct-title { color: var(--warning); }
.callout.danger  { border-left-color: var(--danger); }
.callout.danger .ct-title { color: var(--danger); }
.callout.info    { border-left-color: var(--info); }
.callout.info .ct-title { color: var(--info); }

/* ---------- Tablas ---------- */
table {
  width: 100%; border-collapse: collapse; margin: 20px 0;
  font-size: 14px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
th {
  background: var(--secondary); text-align: left;
  padding: 12px 16px; font-weight: 700; color: var(--text);
  font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase;
}
td { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-soft); }
td code { font-size: 12.5px; }
tr:hover td { background: rgba(255,255,255,0.015); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; vertical-align: middle;
}
.badge.green { background: rgba(0,255,136,0.12); color: var(--primary); border: 1px solid rgba(0,255,136,0.3); }
.badge.gray  { background: var(--secondary); color: var(--text-soft); border: 1px solid var(--border); }
.badge.gold  { background: rgba(255,207,77,0.12); color: var(--gold); border: 1px solid rgba(255,207,77,0.3); }
.badge.red   { background: rgba(255,77,94,0.12); color: var(--danger); border: 1px solid rgba(255,77,94,0.3); }

/* ---------- UI mock (botones/inputs de ejemplo) ---------- */
.btn-demo {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #04130b;
  font-weight: 700; font-size: 13px;
  padding: 9px 16px; border-radius: 9px;
  box-shadow: var(--glow);
}
.kbd {
  font-family: var(--mono); font-size: 12px;
  background: var(--secondary); border: 1px solid var(--border);
  border-bottom-width: 2px; padding: 2px 7px; border-radius: 6px;
  color: var(--text);
}

ul.clean, ol.clean { margin: 12px 0 16px 4px; padding-left: 22px; }
ul.clean li, ol.clean li { color: var(--text-soft); margin-bottom: 8px; }

hr { border: none; border-top: 1px solid var(--border); margin: 44px 0; }

/* ---------- Footer nav (prev/next) ---------- */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.pager a {
  flex: 1; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; background: var(--card);
  transition: all .16s ease;
}
.pager a:hover { border-color: rgba(0,255,136,0.4); box-shadow: var(--glow); }
.pager .dir { font-size: 12px; color: var(--text-mute); letter-spacing: 1px; text-transform: uppercase; }
.pager .ttl { color: var(--text); font-weight: 700; margin-top: 4px; }
.pager a.next { text-align: right; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-mute);
}
.site-footer span { color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  /* La sidebar pasa a ser un drawer deslizable en vez de desaparecer */
  .sidebar {
    position: fixed; top: 0; left: 0;
    z-index: 50;
    width: min(82vw, 300px);
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: inline-flex; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .content { padding: 32px 20px 72px; }
  h1 { font-size: 30px; }
}
