/**
 * SGB - Sistema de Gestión de Bodegas
 * base.css - Estilos básicos y variables
 * 
 * Este archivo contiene:
 * 1. Reseteo de estilos
 * 2. Variables CSS para temas
 * 3. Tipografía base
 * 4. Estilos fundamentales
 */

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, h4, h5, h6, p, ol, ul {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== VARIABLES CSS ===== */
:root {
  /* Espaciado */
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 1rem;
  --spacing-4: 1.5rem;
  --spacing-5: 3rem;
  
  /* Tipografía */
  --font-size-small: 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;
  
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Bordes y sombras */
  --border-radius: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-color: #dee2e6;
  
  --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Tema claro (predeterminado) */
:root,
html[data-theme="light"] {
  /* Colores primarios */
  --color-primary: #0d6efd;
  --color-primary-rgb: 13, 110, 253;
  --color-secondary: #6c757d;
  --color-success: #198754;
  --color-info: #0dcaf0;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --color-light: #f8f9fa;
  --color-dark: #212529;
  
  /* Backgrounds */
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  
  /* Textos */
  --text-main: #212529;
  --text-muted: #6c757d;
  --text-light: #f8f9fa;
  --text-sidebar: #212529;
  
  /* Bordes */
  --border-color: #dee2e6;
}

/* Tema oscuro */
html[data-theme="dark"] {
  /* Colores primarios */
  --color-primary: #0d6efd;
  --color-primary-rgb: 13, 110, 253;
  --color-secondary: #6c757d;
  --color-success: #198754;
  --color-info: #0dcaf0;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --color-light: #343a40;
  --color-dark: #f8f9fa;
  
  /* Backgrounds */
  --bg-main: #121212;
  --bg-card: #1e1e1e;
  --bg-sidebar: #1e1e1e;
  --bg-header: #1e1e1e;
  
  /* Textos */
  --text-main: #e9ecef;
  --text-muted: #adb5bd;
  --text-light: #f8f9fa;
  --text-sidebar: #e9ecef;
  
  /* Bordes */
  --border-color: #2d3238;
}

/* Tema lectura */
html[data-theme="reading"] {
  /* Colores primarios */
  --color-primary: #5a4a41;
  --color-primary-rgb: 90, 74, 65;
  --color-secondary: #7c6b62;
  --color-success: #5a8070;
  --color-info: #73a1a8;
  --color-warning: #b79f7e;
  --color-danger: #a06a64;
  --color-light: #ede0d4;
  --color-dark: #3c2f29;
  
  /* Backgrounds */
  --bg-main: #f7f1e7;
  --bg-card: #ede0d4;
  --bg-sidebar: #5a4a41;
  --bg-header: #ede0d4;
  
  /* Textos */
  --text-main: #3c2f29;
  --text-muted: #7c6b62;
  --text-light: #f7f1e7;
  --text-sidebar: #f7f1e7;
  
  /* Bordes */
  --border-color: #c8b6a6;
}

/* ===== TIPOGRAFÍA BASE ===== */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: var(--spacing-3);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--spacing-3);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== UTILIDADES BÁSICAS ===== */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--color-primary) !important;
}

.text-success {
  color: var(--color-success) !important;
}

.text-danger {
  color: var(--color-danger) !important;
}

.text-warning {
  color: var(--color-warning) !important;
}

.text-info {
  color: var(--color-info) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.bg-primary {
  background-color: var(--color-primary) !important;
}

.bg-light {
  background-color: var(--color-light) !important;
}

.bg-dark {
  background-color: var(--color-dark) !important;
}

/* Estilos para los temas aplicados al body */
body.dark-mode {
  background-color: var(--bg-main);
  color: var(--text-main);
}

body.reading-mode {
  background-color: var(--bg-main);
  color: var(--text-main);
}

/* Hover estándar para botones de acción del banner (definido en STYLEGUIDE.md) */
.btn-banner-action:hover {
    background-color: var(--bs-primary) !important; /* Color primario (del banner) */
    color: white !important; /* Mantener texto blanco */
    border-color: var(--bs-primary) !important; /* Borde color primario */
}

/* Forzar centrado vertical del modal de video (fallback STYLEGUIDE.md) */
#modalVideo .modal-dialog {
    display: flex !important; 
    align-items: center !important;
    min-height: calc(100% - 1rem);
    margin: 0.5rem auto;
}

/* Forzar centrado vertical del modal de ayuda (fallback STYLEGUIDE.md) */
#modalAyuda .modal-dialog {
    display: flex !important; 
    align-items: center !important;
    min-height: calc(100% - 1rem);
    margin: 0.5rem auto;
}
