/* ============================================
   THEME VARIABLES - Sistema Gestión de Barriles
   ============================================
   Sistema de diseño basado en variables CSS
   Soporte para tema claro y oscuro
   ============================================ */

:root {
  /* ========== COLORES PRIMARIOS ========== */
  --primary: #1e1b4b;
  --primary-light: #312e81;
  --primary-dark: #0f0d24;
  --secondary: #4338ca;
  --secondary-light: #6366f1;
  --accent: #0ea5e9;
  --accent-light: #38bdf8;

  /* ========== COLORES DE ESTADO ========== */
  --success: #10b981;
  --success-light: #34d399;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;

  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --info: #3b82f6;
  --info-light: #60a5fa;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  --danger: #ef4444;
  --danger-light: #f87171;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  /* ========== COLORES ADICIONALES ========== */
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --purple-bg: #f5f3ff;
  --purple-border: #ddd6fe;

  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --cyan-bg: #ecfeff;
  --cyan-border: #a5f3fc;

  --orange: #f97316;
  --orange-light: #fb923c;
  --orange-bg: #fff7ed;
  --orange-border: #fed7aa;

  --teal: #14b8a6;
  --teal-light: #2dd4bf;
  --teal-bg: #f0fdfa;
  --teal-border: #99f6e4;

  --indigo: #6366f1;
  --indigo-light: #818cf8;
  --indigo-bg: #eef2ff;
  --indigo-border: #c7d2fe;

  /* ========== ESCALA DE GRISES (SLATE) ========== */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* ========== MEDIDAS Y ESPACIADO ========== */
  --sidebar-width: 256px;
  --header-height: 64px;
  --border-radius-sm: 0.375rem;
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  --border-radius-2xl: 1.5rem;
  --border-radius-full: 9999px;

  /* ========== SOMBRAS ========== */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* ========== TRANSICIONES ========== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ========== TIPOGRAFÍA ========== */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  /* ================================================
     TEMA CLARO (DEFAULT)
     ================================================ */
  --bg-page: #f3f4f6;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f9fafb;
  --bg-surface-hover: #f3f4f6;
  --bg-sidebar: var(--primary);
  --bg-header: #ffffff;

  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;

  --border-color: #e5e7eb;
  --border-color-light: #f3f4f6;
  --border-color-dark: #d1d5db;

  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-focus-border: var(--accent);
  --input-focus-ring: rgba(14, 165, 233, 0.2);

  /* Estados de tabla */
  --table-header-bg: #f9fafb;
  --table-row-hover: #f9fafb;
  --table-border: #e5e7eb;
}

/* ================================================
   TEMA OSCURO
   ================================================ */
[data-theme="dark"] {
  --bg-page: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-secondary: #334155;
  --bg-surface-hover: #334155;
  --bg-sidebar: #0f172a;
  --bg-header: #1e293b;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --border-color: #334155;
  --border-color-light: #1e293b;
  --border-color-dark: #475569;

  --input-bg: #1e293b;
  --input-border: #475569;
  --input-focus-border: var(--accent);
  --input-focus-ring: rgba(14, 165, 233, 0.3);

  /* Estados de tabla - dark */
  --table-header-bg: #334155;
  --table-row-hover: rgba(255, 255, 255, 0.05);
  --table-border: #334155;

  /* Ajustes de colores de estado para dark mode */
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.3);
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);
  --info-bg: rgba(59, 130, 246, 0.1);
  --info-border: rgba(59, 130, 246, 0.3);
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);
  --purple-bg: rgba(139, 92, 246, 0.1);
  --purple-border: rgba(139, 92, 246, 0.3);
  --cyan-bg: rgba(6, 182, 212, 0.1);
  --cyan-border: rgba(6, 182, 212, 0.3);
  --orange-bg: rgba(249, 115, 22, 0.1);
  --orange-border: rgba(249, 115, 22, 0.3);
  --teal-bg: rgba(20, 184, 166, 0.1);
  --teal-border: rgba(20, 184, 166, 0.3);
  --indigo-bg: rgba(99, 102, 241, 0.1);
  --indigo-border: rgba(99, 102, 241, 0.3);

  /* Sombras para dark mode */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
}

/* ================================================
   APLICACIÓN DE VARIABLES BASE
   ================================================ */
html {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
