/* assets/css/base.css - Variables + Reset + Utilidades */

:root {
  /* 🎨 Paleta profesional - Celeste oscuro */
  --primary: #0c4a6e;
  --primary-light: #0ea5e9;
  --primary-dark: #072e4a;
  --primary-glow: rgba(14, 165, 233, 0.15);
  
  /* Neutros */
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  
  /* Estados */
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  
  /* 🎨 10 colores calendario */
  --cal-1: #ef4444; --cal-2: #f97316; --cal-3: #eab308;
  --cal-4: #22c55e; --cal-5: #06b6d4; --cal-6: #3b82f6;
  --cal-7: #8b5cf6; --cal-8: #ec4899; --cal-9: #64748b; --cal-10: #0c4a6e;
  
  /* Layout */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --transition: all 0.2s ease;
  
  /* Touch targets */
  --touch-min: 44px;
  
  /* Tipografía */
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Reset esencial */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom); /* iOS notch */
}

/* 📱 Mobile-first: contenedores */
.container { width: 100%; max-width: 100%; padding: 0 1rem; }
@media (min-width: 768px) {
  .container { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }
}
@media (min-width: 1024px) {
  .container { max-width: 960px; padding: 0 2rem; }
}

/* 🔘 Botones táctiles */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; min-height: var(--touch-min);
  padding: 0.75rem 1.25rem;
  background: var(--primary); color: white;
  border: none; border-radius: var(--radius);
  font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-outline {
  background: transparent; border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:active { background: var(--primary-glow); }

.btn-block { width: 100%; }

/* 📝 Formularios optimizados para móvil */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; margin-bottom: 0.5rem;
  font-weight: 500; font-size: 0.95rem;
  color: var(--text);
}
.form-input, .form-select, .form-textarea {
  width: 100%; min-height: var(--touch-min);
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem; /* Evita zoom en iOS */
  background: var(--surface);
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder { color: var(--text-muted); }

/* 🗂️ Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-header {
  padding-bottom: 0.75rem; margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600; color: var(--primary);
}

/* 🎯 Utilidades */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; }

/* 🔄 Loading spinner */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--primary-glow);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 📱 Barra de navegación inferior (mobile) */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 0.5rem 0 env(safe-area-inset-bottom);
  z-index: 1000;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.5rem; color: var(--text-muted);
  text-decoration: none; font-size: 0.75rem;
  min-width: 60px;
}
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
.bottom-nav svg { width: 24px; height: 24px; margin-bottom: 2px; }

/* Tablet: mostrar bottom-nav solo si es necesario */
@media (min-width: 768px) {
  .bottom-nav { display: none; } /* En tablet usamos sidebar */
}

/* 🎨 Badge motivacional */
.motivational-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--primary-glow); color: var(--primary);
  padding: 0.6rem 1rem; border-radius: 50px;
  font-size: 0.9rem; font-weight: 500;
  animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}