/* ============================================================
   BASE.CSS — Tokens, reset, layout y efecto glass
   ============================================================ */

/* ─── Tokens ────────────────────────────────────────────────── */
:root {
  /* Colores */
  --bg:          #080810;
  --bg-2:        #0e0e1a;
  --surface:     rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.085);
  --border:      rgba(255, 255, 255, 0.09);
  --border-glow: rgba(99, 102, 241, 0.35);

  --accent:      #6366f1;
  --accent-2:    #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);

  --green:  #10b981;
  --amber:  #f59e0b;
  --red:    #ef4444;

  /* Texto */
  --text-primary:   rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary:  rgba(255, 255, 255, 0.30);

  /* Tipografía */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Espaciado */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radios */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(99,102,241,0.15);

  /* Layout */
  --max-w:    720px;
  --header-h: 60px;
  --nav-h:    72px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Fondo con efecto nebulosa sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Glass panel ───────────────────────────────────────────── */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.glass-panel:hover {
  border-color: rgba(255,255,255,0.13);
}

/* ─── Layout ────────────────────────────────────────────────── */
#app {
  position: relative;
  min-height: 100dvh;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  gap: var(--space-4);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.brand-icon {
  font-size: 20px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-container {
  position: relative;
  padding-top: var(--header-h);
  padding-bottom: var(--nav-h);
  min-height: 100dvh;
  z-index: 1;
}

.page {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.page.active {
  display: block;
  animation: pageIn 0.25s ease forwards;
}

.page-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ─── Bottom nav ────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  border-radius: 0;
  border-bottom: none;
  border-left: none;
  border-right: none;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--space-4);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-5);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: color 0.2s, background 0.2s;
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.nav-btn .nav-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.2s;
}

.nav-btn:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.nav-btn.active {
  color: var(--accent-2);
}

.nav-btn.active .nav-icon {
  transform: scale(1.1);
}

/* ─── Typography ─────────────────────────────────────────────── */
.page-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

/* ─── Utilities ─────────────────────────────────────────────── */
.hidden { display: none !important; }

.divider {
  color: var(--text-tertiary);
}

.error-text {
  color: var(--red);
  font-size: 13px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 580px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
