/* ═══════════════════════════════════════════════════════
   AxiomV — style.css  v2.0
   Estilos del idioma universal AxiomV.
   Sin dependencias externas.
   ═══════════════════════════════════════════════════════ */

/* ── VARIABLES ────────────────────────────────────────── */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1f2a40;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #00ff88;
  --accent-dim: #00cc6a;
  --danger: #ff4466;
  --warning: #ffaa00;
  --info: #4488ff;
  --border: #1e293b;
  --border-light: #334155;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(0, 255, 136, 0.15);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

/* ── RESET ────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── LAYOUT ───────────────────────────────────────────── */
#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── HEADER ───────────────────────────────────────────── */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-symbol {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.header-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-light);
}

.nav-btn.active {
  color: var(--accent);
  background: rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.25);
  box-shadow: var(--shadow-glow);
}

/* ── HERO ─────────────────────────────────────────────── */
#hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.hero-title {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 400;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 0.75rem;
  line-height: 1.7;
}

.hero-desc strong {
  color: var(--accent);
}

.hero-symbols {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.hero-sym {
  animation: pulse-sym 3s ease-in-out infinite;
}

.hero-sym:nth-child(2) { animation-delay: 0.2s; }
.hero-sym:nth-child(3) { animation-delay: 0.4s; }
.hero-sym:nth-child(4) { animation-delay: 0.6s; }
.hero-sym:nth-child(5) { animation-delay: 0.8s; }
.hero-sym:nth-child(6) { animation-delay: 1.0s; }
.hero-sym:nth-child(7) { animation-delay: 1.2s; }
.hero-sym:nth-child(8) { animation-delay: 1.4s; }
.hero-sym:nth-child(9) { animation-delay: 1.6s; }

@keyframes pulse-sym {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); color: var(--accent); }
}

/* ── TABS ─────────────────────────────────────────────── */
.tab {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab.active {
  display: block;
}

.tab.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-header {
  margin-bottom: 1.5rem;
}

.tab-header h2 {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.tab-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── CARDS ────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-light);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

/* ── INPUTS ───────────────────────────────────────────── */
.axiom-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}

.axiom-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.axiom-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── TRANSLATOR GRID ──────────────────────────────────── */
.translator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .translator-grid {
    grid-template-columns: 1fr;
  }
}

.input-meta {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.meta-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── OUTPUT ───────────────────────────────────────────── */
.axiom-output {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.et-display {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.1em;
  transition: color 0.3s ease, font-size 0.3s ease;
  word-break: break-all;
  text-align: center;
}

.translation-box {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.trans-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.trans-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.meaning-box {
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
}

.meaning-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
}

/* ── BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-card-hover);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
}

.btn-block {
  width: 100%;
  margin-top: 1rem;
}

/* ── SIMULATOR ────────────────────────────────────────── */
.simulator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .simulator-grid {
    grid-template-columns: 1fr;
  }
}

.et-preview {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── DICCIONARIO ──────────────────────────────────────── */
.diccionario-cargando {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-family: var(--font-mono);
}

.dic-categoria {
  margin-bottom: 1.5rem;
}

.dic-cat-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}

.dic-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.dic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
}

.dic-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  transition: border-color var(--transition), background var(--transition);
}

.dic-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.dic-simbolo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  min-width: 2rem;
  text-align: center;
  color: var(--accent);
}

.dic-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dic-nombre {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.dic-significado {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ── LECCIONES ────────────────────────────────────────── */
.lecciones-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.leccion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.leccion-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.leccion-card.active {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.05);
  box-shadow: var(--shadow-glow);
}

.leccion-num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  min-width: 1.8rem;
}

.leccion-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.leccion-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.leccion-texto {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.leccion-ejemplos {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ejemplo-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}

.ejemplo-simbolo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  min-width: 2rem;
  text-align: center;
  color: var(--accent);
}

.ejemplo-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.ejemplo-desc strong {
  color: var(--text-primary);
}

.leccion-practica {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.leccion-resultado {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-height: 2.5rem;
}

.leccion-result-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.leccion-result-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── HISTORIAL ────────────────────────────────────────── */
.historial-lista {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.9rem;
}

.historial-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.historial-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.historial-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.historial-texto {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}

.historial-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.historial-delete:hover {
  color: var(--danger);
  background: rgba(255, 68, 102, 0.1);
}

.historial-body {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.historial-et {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.historial-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.historial-footer {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.historial-fecha {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
  opacity: 0.6;
}

/* ── FOOTER ───────────────────────────────────────────── */
#footer {
  text-align: center;
  padding: 2rem 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-sym {
  font-family: var(--font-mono);
  color: var(--accent);
  opacity: 0.6;
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 640px) {
  #app {
    padding: 0 1rem;
  }

  #header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .header-brand {
    justify-content: center;
  }

  .header-nav {
    justify-content: center;
  }

  .nav-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-symbols {
    font-size: 1.3rem;
  }

  .lecciones-lista {
    grid-template-columns: 1fr;
  }

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

/* ── SELECTION ────────────────────────────────────────── */
::selection {
  background: rgba(0, 255, 136, 0.2);
  color: var(--accent);
}

/* ── CODE ─────────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  background: var(--bg-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
  border: 1px solid var(--border);
}
