/* =============================================================================
   SIREB — main.css
   Variables CSS, Reset, Tipografía, Elementos base
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Roboto+Mono:wght@400;500&display=swap');

/* ============================================================================
   CSS CUSTOM PROPERTIES — Dark Premium Palette
   ============================================================================ */
:root {
  /* Fondos */
  --bg-primary:    #0a0a0a;
  --bg-secondary:  #111111;
  --bg-panel:      #1a1a1a;
  --bg-card:       #141414;
  --bg-input:      #0f0f0f;
  --bg-hover:      #222222;
  --bg-active:     #1e1e1e;

  /* Bordes */
  --border:        #2a2a2a;
  --border-light:  #333333;
  --border-focus:  #555555;

  /* Texto */
  --text-primary:   #e8e8e8;
  --text-secondary: #9a9a9a;
  --text-muted:     #666666;
  --text-disabled:  #444444;

  /* Acento */
  --accent:         #c0c0c0;
  --accent-hover:   #ffffff;
  --accent-dim:     #888888;

  /* Estados */
  --success:        #4a7a4a;
  --success-bg:     #1a2a1a;
  --success-text:   #7ab87a;
  --warning:        #8a5a2a;
  --warning-bg:     #2a1e0a;
  --warning-text:   #d4a055;
  --danger:         #7a2a2a;
  --danger-bg:      #2a0a0a;
  --danger-text:    #c86060;
  --info:           #2a4a6a;
  --info-bg:        #0a1a2a;
  --info-text:      #5a9ad4;
  --critical:       #6a0a0a;
  --critical-text:  #ff4444;

  /* Gradientes */
  --gradient-logo:  linear-gradient(135deg, #2a2a2a, #1a1a1a);
  --gradient-card:  linear-gradient(135deg, #141414 0%, #111111 100%);
  --gradient-panel: linear-gradient(180deg, #1a1a1a 0%, #111111 100%);

  /* Tipografía */
  --font-ui:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:  'Roboto Mono', 'Courier New', monospace;

  /* Espaciado */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.6);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.7);
  --shadow-xl:  0 16px 48px rgba(0,0,0,0.8);

  /* Transiciones */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* Tamaños de texto */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */
*, *::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-ui);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   TIPOGRAFÍA
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p { color: var(--text-secondary); margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-hover); }

strong { font-weight: 600; color: var(--text-primary); }
em { font-style: italic; }
small { font-size: var(--text-xs); color: var(--text-muted); }

code, pre {
  font-family: var(--font-mono);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
code { padding: 2px 6px; font-size: 0.875em; }
pre { padding: var(--space-md); overflow-x: auto; font-size: var(--text-sm); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

ul, ol { padding-left: var(--space-lg); color: var(--text-secondary); }
li { margin-bottom: var(--space-xs); }

/* ============================================================================
   SCROLLBAR PERSONALIZADO
   ============================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ============================================================================
   SELECCIÓN DE TEXTO
   ============================================================================ */
::selection {
  background: rgba(192, 192, 192, 0.2);
  color: var(--text-primary);
}

/* ============================================================================
   IMÁGENES
   ============================================================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================================================
   ANIMACIONES GLOBALES
   ============================================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes progressFill {
  from { width: 0%; }
  to   { width: var(--progress-width, 0%); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.animate-fade-in { animation: fadeIn var(--transition-normal) both; }
.animate-fade-in-left { animation: fadeInLeft var(--transition-normal) both; }
.animate-animate-fade-in-right { animation: fadeInRight var(--transition-normal) both; }
.animate-slide-down { animation: slideDown var(--transition-normal) both; }

/* Stagger animations */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* ============================================================================
   UTILIDADES
   ============================================================================ */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success-text) !important; }
.text-warning   { color: var(--warning-text) !important; }
.text-danger    { color: var(--danger-text) !important; }
.text-info      { color: var(--info-text) !important; }
.text-accent    { color: var(--accent) !important; }
.text-mono      { font-family: var(--font-mono); }

.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.fs-xs   { font-size: var(--text-xs); }
.fs-sm   { font-size: var(--text-sm); }
.fs-base { font-size: var(--text-base); }
.fs-lg   { font-size: var(--text-lg); }
.fs-xl   { font-size: var(--text-xl); }
.fs-2xl  { font-size: var(--text-2xl); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-block   { display: block; }
.d-none    { display: none !important; }
.d-inline  { display: inline; }

.flex-col   { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap  { flex-wrap: wrap; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.m-auto  { margin: auto; }
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }

.p-sm  { padding: var(--space-sm); }
.p-md  { padding: var(--space-md); }
.p-lg  { padding: var(--space-lg); }
.p-xl  { padding: var(--space-xl); }

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }

.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

.cursor-pointer { cursor: pointer; }
.select-none    { user-select: none; }
.pointer-events-none { pointer-events: none; }

.opacity-0  { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

.transition { transition: all var(--transition-normal); }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-panel) 25%, var(--bg-hover) 50%, var(--bg-panel) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
