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

/* === CSS RESET MODERNO === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  outline: none;
}

a {
  text-decoration: none;
  color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

/* === DESIGN SYSTEM: ROOT VARIABLES === */
:root {
  /* Colores */
  --color-primary: #7B66FF; /* Violeta vibrante */
  --color-primary-light: #9B8BFF;
  --color-primary-dark: #5F4BDB;
  --color-secondary: #00E6B8; /* Verde azulado de acento */
  --color-secondary-light: #33FFD2;
  --color-secondary-dark: #00B38C;

  --color-bg: #1A1A2E; /* Fondo principal oscuro */
  --color-bg-gradient-start: #1A1A2E;
  --color-bg-gradient-end: #1F2840;
  --color-bg-alt: #252D4A; /* Fondo alternativo (cards, modales) */
  --color-bg-header: rgba(26, 26, 46, 0.8); /* Fondo header con transparencia */

  --color-text-light: #E0E0E0; /* Texto principal claro */
  --color-text-dark: #A0A0A0; /* Texto secundario/desactivado */
  --color-text-contrast: #FFFFFF; /* Texto sobre elementos de color */

  --color-border: rgba(255, 255, 255, 0.1); /* Borde sutil */
  --color-border-focus: var(--color-primary-light);

  --color-success: #28a745;
  --color-error: #dc3545;
  --color-warning: #ffc107;
  --color-info: #17a2b8;

  /* Tipografía */
  --font-family-base: 'Inter', sans-serif;
  --font-size-base: 1rem; /* 16px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-lg: 1.125rem; /* 18px */

  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-base: 1.6;
  --line-height-heading: 1.2;

  /* Espaciado (Modular Scale) */
  --spacing-xxs: 0.25rem; /* 4px */
  --spacing-xs: 0.5rem;   /* 8px */
  --spacing-sm: 0.75rem;  /* 12px */
  --spacing-md: 1rem;     /* 16px */
  --spacing-lg: 1.5rem;   /* 24px */
  --spacing-xl: 2rem;     /* 32px */
  --spacing-xxl: 3rem;    /* 48px */
  --spacing-xxxl: 4rem;   /* 64px */

  /* Border Radius */
  --border-radius-sm: 0.25rem; /* 4px */
  --border-radius-md: 0.5rem;  /* 8px */
  --border-radius-lg: 1rem;    /* 16px */
  --border-radius-pill: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 8px 10px rgba(0, 0, 0, 0.04);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.2); /* Para elementos glassmorphic */
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.1);

  /* Transiciones */
  --transition-fast: all 0.15s ease-out;
  --transition-normal: all 0.3s ease-in-out;
  --transition-slow: all 0.5s ease;

  /* Z-index */
  --z-index-base: 1;
  --z-index-dropdown: 10;
  --z-index-sticky: 100;
  --z-index-modal: 1000;
  --z-index-tooltip: 1100;
}

/* === BASE STYLES === */
body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  background: linear-gradient(135deg, var(--color-bg-gradient-start) 0%, var(--color-bg-gradient-end) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-dark);
}

a {
  color: var(--color-primary);
  transition: var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-primary-light);
  text-decoration: underline;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.flex {
  display: flex;
  gap: var(--spacing-md);
}

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

.flex-row {
  flex-direction: row;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.section {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}

/* === HEADER / NAV === */
.header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-bg-header);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  z-index: var(--z-index-sticky);
  display: flex;
  align-items: center;
  justify-content: center; /* Centered by default for mobile */
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between; /* For desktop */
}

.header h1 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--color-text-contrast);
  font-weight: var(--font-weight-semibold);
}

/* === COMPONENTES === */

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-md);
  font-weight: var(--font-weight-medium);
  transition: var(--transition-normal);
  text-align: center;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text-contrast);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-text-contrast);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--color-secondary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-ghost {
  background: none;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-ghost:hover,
.btn-ghost:focus {
  background-color: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary-light);
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
}

.btn-icon {
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  background: none;
  color: var(--color-text-dark);
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-light);
}

.btn-sm {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  border-radius: var(--border-radius-sm);
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: var(--font-size-lg);
  border-radius: var(--border-radius-lg);
}

/* Tarjetas (Idea Card) */
.card {
  background-color: var(--color-bg-alt);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-glass);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.card-header {
  margin-bottom: var(--spacing-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-light);
}

.card-body {
  color: var(--color-text-dark);
}

.card-footer {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

/* Badge (para ideas vinculadas) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xxs) var(--spacing-xs);
  border-radius: var(--border-radius-pill);
  background-color: rgba(var(--color-secondary-rgb), 0.15);
  color: var(--color-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

/* Inputs y Textareas */
.input-group {
  margin-bottom: var(--spacing-md);
}

.input,
.textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
  background-color: rgba(var(--color-bg-alt-rgb), 0.5);
  color: var(--color-text-light);
  font-size: var(--font-size-base);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-inset);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-dark);
  opacity: 0.7;
}

.input:focus,
.textarea:focus {
  border-color: var(--color-border-focus);
  background-color: var(--color-bg-alt);
  box-shadow: var(--shadow-md);
}

.textarea {
  min-height: 80px;
  resize: vertical;
}

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-index-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--color-bg-alt);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  max-width: 500px;
  width: 90%;
  transform: translateY(-20px);
  opacity: 0;
  transition: transform var(--transition-normal) ease-out, opacity var(--transition-normal) ease-out;
}

.modal-overlay.is-active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  margin: 0;
  color: var(--color-text-light);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-dark);
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--color-text-light);
  transform: rotate(90deg);
}

.modal-body {
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-dark);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

/* === ANIMACIONES === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.7); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(var(--color-primary-rgb), 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0); }
}

.animate-fade-in {
  animation: fadeIn var(--transition-normal) forwards;
}

.animate-slide-up {
  animation: slideUp var(--transition-normal) forwards;
}

.btn:active {
  animation: pulse 0.5s ease-out;
}

/* === DARK MODE (Default is dark, but showing how to explicitly set) === */
/* For systems that prefer light mode, or a toggle */
@media (prefers-color-scheme: light) {
  /* This section would define light mode variables if needed,
     but the current design is inherently dark.
     If a toggle were implemented, a .light-mode class would override. */
}

/* Example of how a .light-mode class could work */
.light-mode {
  --color-primary: #5F4BDB;
  --color-primary-light: #7B66FF;
  --color-primary-dark: #4535B0;
  --color-secondary: #00B38C;

  --color-bg: #F8F8F8;
  --color-bg-gradient-start: #F8F8F8;
  --color-bg-gradient-end: #EFEFEF;
  --color-bg-alt: #FFFFFF;
  --color-bg-header: rgba(255, 255, 255, 0.8);

  --color-text-light: #333333;
  --color-text-dark: #666666;
  --color-text-contrast: #FFFFFF;

  --color-border: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.12), 0 4px 6px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 8px 10px rgba(0, 0, 0, 0.06);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* === RESPONSIVE DESIGN === */

/* Mobile (Default styles are mobile-first) */
body {
  padding: var(--spacing-md);
}

.header {
  padding: var(--spacing-md);
}

.header h1 {
  text-align: center;
  width: 100%;
}

.container {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

/* Tablet (min-width: 768px) */
@media (min-width: 768px) {
  body {
    padding: var(--spacing-lg);
  }

  .header {
    padding: var(--spacing-md) var(--spacing-xl);
  }

  .header h1 {
    text-align: left;
    width: auto;
  }

  h1 { font-size: 3rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 1.875rem; }

  .container {
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
  }

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

/* Desktop (min-width: 1024px) */
@media (min-width: 1024px) {
  body {
    padding: var(--spacing-xl);
  }

  .header {
    padding: var(--spacing-lg) var(--spacing-xxl);
  }

  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 2rem; }

  .container {
    padding-left: var(--spacing-xxl);
    padding-right: var(--spacing-xxl);
  }

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

/* Desktop Large (min-width: 1440px) */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
}

/* Utility classes for RGB values for rgba() usage */
/* These would typically be generated by a preprocessor or JS for dynamic themes */
:root {
  --color-primary-rgb: 123, 102, 255;
  --color-secondary-rgb: 0, 230, 184;
  --color-bg-alt-rgb: 37, 45, 74;
}