/* Darwin Now - Main Styles */

/* CSS Variables - Sistema de Identidad Cromática */
:root {
  /* ===== LIGHT MODE ===== */

  /* Colores de Acento - Principal */
  --primary-purple: #8666FF; /* Principal (Acento) - CTAs primarios, enlaces activos, iconos activos */
  --primary-base: #A18BF2; /* Principal (Base) - Elementos destacados, barras de progreso, ilustraciones */
  --primary-light: #EDE8FF; /* Principal (Claro) - Estados hover, fondos de notificaciones */
  --primary-dark: #5F3DD4; /* Principal (Oscuro) - Texto de alto contraste, estados pressed */
  --purple-hover: #EDE8FF; /* Hover sutil con el color claro */
  --light-purple: #EDE8FF; /* Unificado con primary-light */

  /* Colores Neutros - Light Mode */
  --bg-primary: #FFFFFF; /* Fondo Base - Fondo principal de la interfaz */
  --bg-secondary: #F8F8FC; /* Fondo Secundario - Ligeras elevaciones para tarjetas (profundidad) */
  --bg-tertiary: #F3F4F6; /* Fondo terciario adicional */

  /* Texto - Light Mode */
  --color-text-primary: #1D1D1F; /* Texto Principal - Máxima legibilidad, títulos y cuerpo */
  --color-text-secondary: #6A6A6A; /* Texto Secundario - Etiquetas, ayuda contextual, bajo contraste */
  --color-text-tertiary: #9CA3AF; /* Texto terciario para elementos menos importantes */

  /* Colores Semánticos - Estados de UI */
  --color-success: #34C759; /* Éxito - Confirmaciones, completado */
  --color-error: #FF3B30; /* Error - Mensajes de error, acciones destructivas */
  --color-warning: #FFCC00; /* Advertencia - Alertas, precauciones */
  --color-info: #007AFF; /* Información - Mensajes neutros e informativos */

  /* Colores adicionales de compatibilidad */
  --accent-green: #34C759;
  --dark-bg: #1a1a2e;
  --text-dark: #1D1D1F;
  --text-light: #f8f9fa;
  --text-gray: #6A6A6A;

  /* Efectos Glass */
  --glass-bg: rgba(134, 102, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.18);

  /* Border Colors */
  --border-color: rgba(134, 102, 255, 0.2);
  --border-color-light: rgba(134, 102, 255, 0.1);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8666FF 0%, #A18BF2 100%);
  --gradient-accent: linear-gradient(135deg, #EDE8FF 0%, #ffffff 100%);
  --4DA2FF: linear-gradient(135deg, #8666FF 0%, #A18BF2 50%, #5F3DD4 100%);
  --gradient-success: linear-gradient(135deg, #34C759 0%, #2AAD4E 100%);
  --gradient-error: linear-gradient(135deg, #FF3B30 0%, #E02D23 100%);
  --gradient-warning: linear-gradient(135deg, #FFCC00 0%, #E6B800 100%);
  --gradient-info: linear-gradient(135deg, #007AFF 0%, #0062CC 100%);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;

  /* Typography */
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(31, 38, 135, 0.15);
  --shadow-glow: 0 4px 15px rgba(134, 102, 255, 0.4);
  --shadow-glow-hover: 0 6px 25px rgba(134, 102, 255, 0.6);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  /* Colores de Acento - Dark Mode */
  --primary-purple: #9B7FFF; /* Principal (Acento) - CTAs primarios (más claros para destacar) */
  --primary-base: #A18BF2; /* Principal (Base) - Fondos de progreso e ilustraciones */
  --primary-shadow: #44385C; /* Principal (Sombra) - Elementos desactivados / bajo contraste */
  --primary-luminous: #C3ACFF; /* Principal (Luminoso) - Texto destacado sobre fondo oscuro (alto contraste) */
  --purple-hover: #C3ACFF; /* Hover más claro para mayor visibilidad */
  --light-purple: #44385C; /* Versión oscura del light purple */

  /* Colores Neutros - Dark Mode */
  --bg-primary: #121212; /* Fondo Base - Fondo principal de la interfaz (evita negro puro) */
  --bg-secondary: #1D1D1D; /* Fondo Elevado - Elementos elevados (tarjetas) */
  --bg-tertiary: #252525; /* Fondo terciario para mayor profundidad */

  /* Texto - Dark Mode */
  --color-text-primary: #FFFFFF; /* Texto Principal - Títulos y texto de cuerpo (máxima legibilidad) */
  --color-text-secondary: #B0B0B0; /* Texto Secundario - Metadatos y etiquetas (contraste suave) */
  --color-text-tertiary: #7E8392; /* Texto terciario */

  /* Colores Semánticos - Dark Mode (ligeramente ajustados) */
  --color-success: #4CD964; /* Éxito - Versión más clara para dark mode */
  --color-error: #FF453A; /* Error - Versión más clara para dark mode */
  --color-warning: #FFD60A; /* Advertencia - Versión más clara para dark mode */
  --color-info: #0A84FF; /* Información - Versión más clara para dark mode */

  /* Colores adicionales de compatibilidad */
  --accent-green: #4CD964;
  --text-dark: #FFFFFF;
  --text-light: #FFFFFF;
  --text-gray: #B0B0B0;

  /* Border Colors - Dark Mode */
  --border-color: rgba(155, 127, 255, 0.2);
  --border-color-light: rgba(155, 127, 255, 0.1);

  /* Efectos Glass - Dark Mode */
  --glass-bg: rgba(29, 29, 29, 0.6);
  --glass-border: rgba(155, 127, 255, 0.15);

  /* Gradients - Dark Mode */
  --gradient-primary: linear-gradient(135deg, #9B7FFF 0%, #A18BF2 100%);
  --gradient-accent: linear-gradient(135deg, #1D1D1D 0%, #252525 100%);
  --4DA2FF: linear-gradient(135deg, #9B7FFF 0%, #A18BF2 50%, #C3ACFF 100%);
  --gradient-success: linear-gradient(135deg, #4CD964 0%, #3FB950 100%);
  --gradient-error: linear-gradient(135deg, #FF453A 0%, #E6342A 100%);
  --gradient-warning: linear-gradient(135deg, #FFD60A 0%, #E6C000 100%);
  --gradient-info: linear-gradient(135deg, #0A84FF 0%, #0066CC 100%);

  /* Shadows - Dark Mode (más sutiles) */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 4px 15px rgba(155, 127, 255, 0.3);
  --shadow-glow-hover: 0 6px 25px rgba(155, 127, 255, 0.5);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.875rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.3;
}

h4 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
}

p {
  margin-bottom: var(--spacing-sm);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.7;
  font-weight: 400;
}

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

a:hover {
  color: var(--primary-dark);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Section Spacing */
section {
  padding: var(--spacing-xl) 0;
}

 
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 16px 36px;
  font-weight: 700;
  font-size: 1.0625rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 8px 24px rgba(134, 102, 255, 0.4);
  font-size: 1.125rem;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(134, 102, 255, 0.6);
  color: white;
}

.btn-primary:active {
  transform: translateY(-1px) scale(1.01);
  background: linear-gradient(135deg, #5F3DD4 0%, #5F3DD4 100%);
}

.btn-secondary {
  background: white;
  color: var(--primary-purple);
  border: 2px solid var(--primary-purple);
  box-shadow: 0 4px 12px rgba(134, 102, 255, 0.15);
}

.btn-secondary:hover {
  background: var(--primary-light);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(134, 102, 255, 0.25);
  color: var(--primary-purple);
  border-color: var(--primary-purple);
}

.btn-secondary:active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

.btn-lg {
  padding: 22px 56px;
  font-size: 1.25rem;
  border-radius: 16px;
  min-height: 64px;
}

.btn-sm {
  padding: 12px 28px;
  font-size: 0.9375rem;
  min-height: 44px;
}

/* CTA Group */
.cta-group {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  align-items: center;
}

/* Text Utilities */
.text-center {
  text-align: center;
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-white {
  color: white;
}

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

.text-mono {
  font-family: var(--font-mono);
}

/* Grid Systems */
.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flex Utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Spacing Utilities */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.pt-sm { padding-top: var(--spacing-sm); }
.pt-md { padding-top: var(--spacing-md); }
.pt-lg { padding-top: var(--spacing-lg); }
.pb-sm { padding-bottom: var(--spacing-sm); }
.pb-md { padding-bottom: var(--spacing-md); }
.pb-lg { padding-bottom: var(--spacing-lg); }

/* Forms */
.form-group {
  margin-bottom: var(--spacing-sm);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: var(--transition-base);
  background: var(--bg-primary);
  color: var(--color-text-primary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(134, 102, 255, 0.15);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary-purple);
}

.badge-popular {
  background: var(--primary-base);
  color: white;
}

/* Stats Display */
.stat-number {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--primary-purple);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* Visibility */
.hidden {
  display: none;
}

.visible {
  display: block;
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-purple);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ===== CLASES DE UTILIDAD - COLORES SEMÁNTICOS ===== */

/* Mensajes de Éxito */
.alert-success,
.message-success,
.notification-success {
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(52, 199, 89, 0.05) 100%);
  border: 1px solid var(--color-success);
  color: var(--color-text-primary);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-success);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  flex-shrink: 0;
}

/* Mensajes de Error */
.alert-error,
.message-error,
.notification-error {
  background: linear-gradient(135deg, rgba(255, 59, 48, 0.1) 0%, rgba(255, 59, 48, 0.05) 100%);
  border: 1px solid var(--color-error);
  color: var(--color-text-primary);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-error::before {
  content: '✕';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-error);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  flex-shrink: 0;
}

/* Mensajes de Advertencia */
.alert-warning,
.message-warning,
.notification-warning {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.1) 0%, rgba(255, 204, 0, 0.05) 100%);
  border: 1px solid var(--color-warning);
  color: var(--color-text-primary);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-warning::before {
  content: '⚠';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-warning);
  color: #1D1D1F;
  border-radius: 50%;
  font-weight: bold;
  flex-shrink: 0;
}

/* Mensajes de Información */
.alert-info,
.message-info,
.notification-info {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 122, 255, 0.05) 100%);
  border: 1px solid var(--color-info);
  color: var(--color-text-primary);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-info::before {
  content: 'ℹ';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-info);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  flex-shrink: 0;
}

/* Botones Semánticos */
.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 8px 24px rgba(52, 199, 89, 0.3);
}

.btn-success:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(52, 199, 89, 0.5);
  color: white;
}

.btn-error {
  background: var(--gradient-error);
  color: white;
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.3);
}

.btn-error:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(255, 59, 48, 0.5);
  color: white;
}

.btn-warning {
  background: var(--gradient-warning);
  color: #1D1D1F;
  box-shadow: 0 8px 24px rgba(255, 204, 0, 0.3);
}

.btn-warning:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(255, 204, 0, 0.5);
  color: #1D1D1F;
}

.btn-info {
  background: var(--gradient-info);
  color: white;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

.btn-info:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 122, 255, 0.5);
  color: white;
}

/* Badges Semánticos */
.badge-success {
  background: var(--color-success);
  color: white;
}

.badge-error {
  background: var(--color-error);
  color: white;
}

.badge-warning {
  background: var(--color-warning);
  color: #1D1D1F;
}

.badge-info {
  background: var(--color-info);
  color: white;
}

/* Colores de texto semánticos */
.text-success {
  color: var(--color-success);
}

.text-error {
  color: var(--color-error);
}

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

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

/* Responsive Media Queries */
@media (max-width: 768px) {
  :root {
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
  }

  .container,
  .container-wide {
    padding: 0 var(--spacing-sm);
  }

  .cta-group {
    flex-direction: column;
    width: 100%;
  }

  .cta-group .btn {
    width: 100%;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  section {
    padding: var(--spacing-lg) 0;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .footer,
  .btn,
  .cta-group {
    display: none;
  }
}
