/* Estilos de FeynmanGraph */

/* Estilos del Header */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
}

.mega-menu {
    display: none;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 200ms ease, transform 200ms ease;
    will-change: opacity, transform;
}

.group:hover .mega-menu,
.group:focus-within .mega-menu {
    display: grid;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mega-menu-link svg {
    transition: color 200ms ease, transform 200ms ease;
}

.mega-menu-link:hover svg {
    color: var(--accent-neon);
    transform: scale(1.1);
}

.mega-menu-link:hover .link-title {
    color: var(--accent-neon);
}

.interactive-halo {
    transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}

.interactive-halo:hover {
    box-shadow: 0 0 25px 8px rgba(0, 255, 153, 0.2);
    transform: scale(1.02);
}

/* Ajuste para el contenido debajo del header */
body {
    padding-top: 0;
}

main {
    padding-top: 76px; /* Altura del header */
}

:root {
    --bg-base: #0A0A0A;
    --bg-surface: #0E1F33;
    --bg-interactive: #111111;
    --text-primary: #EAEAEA;
    --text-secondary: #B9B9B9;
    --text-detail: #888888;
    --accent-neon: #00FF99;
    --accent-system: #6FFFE9;
    --border-color: rgba(234, 234, 234, 0.1);

  color-scheme: light dark;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background-color: #0f172a;
  color: #e2e8f0;
  --fg-background: rgba(15, 23, 42, 0.85);
  --fg-surface: rgba(30, 41, 59, 0.85);
  --fg-surface-highlight: rgba(51, 65, 85, 0.85);
  --fg-border: rgba(148, 163, 184, 0.25);
  --fg-primary: #38bdf8;
  --fg-secondary: #94a3b8;
  --fg-success: #34d399;
  --fg-danger: #f87171;
  --fg-radius: 18px;
  --fg-spacing-xs: 0.5rem;
  --fg-spacing-sm: 1rem;
  --fg-spacing-md: 1.5rem;
  --fg-spacing-lg: 2rem;
  --fg-max-width: 1200px;
}

/* Variables globales */
:root {
  --bg-dark: #1B263B;
  --bg-darker: #0D131C;
  --text-light: #E0E1DD;
  --text-muted: #A9A9B2;
  --border-dark: #4A5568;
  --accent-1: #40E0D0;
  --accent-2: #7B2CBF;
  --accent-glow: rgba(64, 224, 208, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
  background: radial-gradient(circle at top left, #1d4ed8 0%, rgba(79, 70, 229, 0.25) 25%, rgba(15, 23, 42, 0.9) 50%, #0f172a 100%);
  color: #e2e8f0;
  font-family: 'Roboto', sans-serif;
  background: radial-gradient(circle at top left, rgba(64,224,208,0.05), transparent 40%),
              linear-gradient(to bottom, var(--bg-dark), var(--bg-darker));
}

body > main {
  max-width: var(--fg-max-width);
  margin: 0 auto;
  padding: var(--fg-spacing-lg) var(--fg-spacing-md);
}

a {
  color: var(--fg-primary);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover,
a:focus-visible {
  color: #7dd3fc;
  opacity: 0.9;
}

code,
pre {
  font-family: "Fira Code", "Source Code Pro", Menlo, monospace;
}

code {
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

pre {
  position: relative;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--fg-border);
  border-radius: calc(var(--fg-radius) / 2);
  padding: calc(var(--fg-spacing-sm) + 1rem) var(--fg-spacing-sm) var(--fg-spacing-sm);
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.4);
}

pre[data-language]::before {
  content: attr(data-language);
  position: absolute;
  top: 0.4rem;
  right: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.65);
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

h1,
h2,
h3,
h4 {
  color: var(--fg-primary);
  font-weight: 600;
  line-height: 1.3;
}

p {
  color: #cbd5f5;
  margin-block: 0 1rem;
}

details {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: calc(var(--fg-radius) / 2);
  padding: var(--fg-spacing-xs) var(--fg-spacing-sm);
  box-shadow: 0 16px 30px rgba(8, 11, 25, 0.35);
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fg-primary);
}

.page-hero {
  background: linear-gradient(120deg, rgba(14, 165, 233, 0.25) 0%, rgba(99, 102, 241, 0.15) 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(12px);
}

.page-hero__inner {
  max-width: var(--fg-max-width);
  margin: 0 auto;
  padding: var(--fg-spacing-lg) var(--fg-spacing-md);
}

.page-hero__title {
  margin: 0 0 var(--fg-spacing-xs);
  font-size: clamp(2rem, 2.4vw + 1rem, 3rem);
}

.page-hero__subtitle {
  color: var(--fg-secondary);
  font-size: 1.05rem;
  margin: 0;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-template-areas: "sidebar content";
  gap: var(--fg-spacing-lg);
  max-width: var(--fg-max-width);
  margin: 0 auto;
  padding: var(--fg-spacing-lg) var(--fg-spacing-md) var(--fg-spacing-lg) var(--fg-spacing-md);
}

.docs-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--fg-spacing-md);
  align-self: start;
  background: var(--fg-surface);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius);
  padding: var(--fg-spacing-md);
  backdrop-filter: blur(16px);
}

.docs-nav {
  margin: 0;
}

.docs-nav + .docs-nav {
  margin-top: var(--fg-spacing-lg);
  padding-top: var(--fg-spacing-md);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.docs-nav__title {
  margin: 0 0 var(--fg-spacing-sm);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-secondary);
}

.docs-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.docs-nav__list a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  color: #e2e8f0;
  background: transparent;
  border: 1px solid transparent;
}

.docs-nav__list a:hover,
.docs-nav__list a:focus-visible {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.docs-nav__list a.is-active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
}

.docs-content {
  grid-area: content;
  display: grid;
  gap: var(--fg-spacing-lg);
}

.docs-section {
  background: var(--fg-surface);
  border-radius: var(--fg-radius);
  border: 1px solid var(--fg-border);
  padding: var(--fg-spacing-lg);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
  scroll-margin-top: 2.5rem;
}

.docs-section__header {
  margin-bottom: var(--fg-spacing-sm);
}

.docs-section__eyebrow {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-secondary);
}

.docs-section__title {
  margin: 0.25rem 0 0;
  font-size: 1.65rem;
}

.docs-section__body {
  color: #e2e8f0;
  display: grid;
  gap: var(--fg-spacing-sm);
}

.docs-section__body > pre,
.docs-section__body > blockquote,
.docs-section__body > details,
.docs-section__body > table {
  margin-top: var(--fg-spacing-sm);
}

.docs-section__body ul,
.docs-section__body ol {
  padding-left: 1.25rem;
  margin: 0;
  display: grid;
  gap: 0.4rem;
  color: #dbeafe;
}

.docs-section__body li::marker {
  color: rgba(125, 211, 252, 0.8);
}

.docs-section__body > *:first-child {
  margin-top: 0;
}

.docs-section__body > *:last-child {
  margin-bottom: 0;
}

.docs-section__body blockquote {
  margin: 0;
  padding: var(--fg-spacing-sm) var(--fg-spacing-md);
  border-left: 4px solid rgba(56, 189, 248, 0.45);
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5f5;
  border-radius: calc(var(--fg-radius) / 2);
}

.docs-section__body table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: calc(var(--fg-radius) / 2);
  overflow: hidden;
}

.docs-section__body th,
.docs-section__body td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.docs-section__body th {
  background: rgba(15, 23, 42, 0.75);
  font-weight: 600;
  color: #bfdbfe;
}

.docs-section__body tr:last-child td {
  border-bottom: none;
}

.docs-section__body img {
  max-width: 100%;
  border-radius: calc(var(--fg-radius) / 2);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.docs-section__body .mermaid {
  background: rgba(15, 23, 42, 0.65);
  border-radius: calc(var(--fg-radius) / 2);
  padding: var(--fg-spacing-md);
  border: 1px solid rgba(148, 163, 184, 0.3);
  overflow-x: auto;
}

.docs-section__collection {
  display: grid;
  gap: var(--fg-spacing-md);
}

.docs-subtitle {
  margin: 0;
  font-size: 1.25rem;
  color: #dbeafe;
}

.docs-card {
  background: var(--fg-surface-highlight);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: calc(var(--fg-radius) - 4px);
  padding: var(--fg-spacing-md);
  display: grid;
  gap: var(--fg-spacing-sm);
  scroll-margin-top: 2.5rem;
}

.docs-card__title {
  margin: 0;
  font-size: 1.25rem;
}

.docs-card__body {
  display: grid;
  gap: 0.75rem;
  color: #e2e8f0;
}

.docs-card__body pre {
  margin: 0;
}

.docs-card__body h1,
.docs-card__body h2,
.docs-card__body h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #bfdbfe;
}

.docs-card__meta {
  font-size: 0.875rem;
  color: var(--fg-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.docs-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.docs-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.docs-card__links a {
  font-size: 0.9rem;
  color: #bae6fd;
}

.docs-status {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: calc(var(--fg-radius) / 2);
  padding: var(--fg-spacing-sm);
  color: #fecaca;
}

.docs-status[data-state="success"] {
  border-color: rgba(52, 211, 153, 0.35);
  color: #bbf7d0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-status[data-state="success"]::before {
  content: "✓";
  font-weight: 700;
}

.docs-status[data-state="pending"] {
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-status[data-state="pending"]::before {
  content: "…";
  font-weight: 700;
  animation: docs-status-pulse 1.2s ease-in-out infinite;
}

.docs-status[data-state="error"]::before {
  content: "⚠";
  margin-right: 0.5rem;
}

@keyframes docs-status-pulse {
  0%, 100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.9;
  }
}
@media (max-width: 1080px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "content"
      "sidebar";
  }

  .docs-sidebar {
    position: static;
  }

  .docs-content {
    order: initial;
  }
}

@media (max-width: 640px) {
  body > main {
    padding: var(--fg-spacing-md);
  }

  .docs-layout {
    padding: var(--fg-spacing-md);
  }

  .docs-section {
    padding: var(--fg-spacing-md);
  }
}

/* Tipografía */
.font-display {
  font-family: 'Montserrat', sans-serif;
}

/* Contenedores y Layout */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 6rem 2rem;
  position: relative;
  overflow: hidden;
}

/* Componentes */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px -5px var(--accent-glow);
}

.button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  border: none;
  cursor: pointer;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--accent-glow);
}

/* Hero con video */
.hero-section {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(11, 18, 32, 0.9),
    rgba(11, 18, 32, 0.7)
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
  text-align: center;
}

/* Efectos y animaciones */
.text-gradient {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.backdrop-blur {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

/* Utilidades */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gradient-border {
  border: 1px solid;
  border-image-slice: 1;
  border-image-source: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

/* Responsive */
@media (max-width: 768px) {
  .section {
    padding: 4rem 1rem;
  }
  
  .hero-content {
    padding: 1rem;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}

/* Variables y estilos base */
:root {
    --accent-1: #40E0D0;
    --accent-2: #7B2CBF;
    --bg-dark: #1B263B;
    --text-primary: #E0E1DD;
    --text-secondary: #A9A9B2;
    --border-color: rgba(255, 255, 255, 0.1);
}

/* Animaciones de XP y Logros */
@keyframes xpFloat {
    0% { 
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -70%) scale(1.2);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -200%) scale(0.8);
        opacity: 0;
    }
}

.xp-gain {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-1);
    text-shadow: 0 0 10px var(--accent-1);
    pointer-events: none;
    z-index: 100;
    animation: xpFloat 1.5s ease-out forwards;
}

/* Efectos de hover y transiciones */
.nav-button {
    transition: all 0.3s ease;
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 224, 208, 0.2);
}

/* Animaciones de resolución */
.solution-step {
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efectos de resplandor */
.glow-effect {
    position: relative;
}

.glow-effect::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-effect:hover::after {
    opacity: 1;
}

/* Animaciones para los badges y logros */
@keyframes badgeUnlock {
    0% {
        transform: scale(0.5) rotate(-15deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.badge-unlock {
    animation: badgeUnlock 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Efectos de partículas para logros especiales */
.particle {
    position: absolute;
    pointer-events: none;
    background: radial-gradient(circle, var(--accent-1), transparent);
    border-radius: 50%;
    animation: particleFloat 1s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x, 100px), var(--y, -100px)) scale(0);
        opacity: 0;
    }
}

/* Mejoras visuales para el quiz */
.quiz-option {
    position: relative;
    overflow: hidden;
}

.quiz-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, var(--accent-1), var(--accent-2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-option:hover::before {
    opacity: 0.1;
}

.quiz-option.correct {
    animation: correctAnswer 0.5s ease forwards;
}

@keyframes correctAnswer {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}
