/* ==========================================================================
VARIABLES & PALETA DE COLORES
========================================================================== */
:root {
  /* Colores Base del Cliente */
  --brand-primary: rgb(91, 200, 0);
  --brand-primary-hover: rgb(75, 170, 0);
  --brand-secondary: #C3C3C3;
  --brand-tertiary: #1E1E1E;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1200px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* TEMA OSCURO (Por defecto) */
[data-theme="dark"] {
  --bg-body: var(--brand-tertiary);
  --bg-card: rgba(35, 35, 35, 0.7);
  --bg-card-hover: rgba(45, 45, 45, 0.9);
  --bg-nav: rgba(30, 30, 30, 0.8);
  --text-main: #FFFFFF;
  --text-muted: var(--brand-secondary);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: var(--brand-primary);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --glow-color: rgba(91, 200, 0, 0.12);
}

/* TEMA CLARO */
[data-theme="light"] {
  --bg-body: #F4F6F8;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFFFF;
  --bg-nav: rgba(244, 246, 248, 0.85);
  --text-main: #141414;
  --text-muted: #555555;
  --border-color: rgba(0, 0, 0, 0.1);
  --border-hover: var(--brand-primary);
  --shadow-color: rgba(0, 0, 0, 0.06);
  --glow-color: rgba(91, 200, 0, 0.15);
}

/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
}

html {
  scroll-behavior: smooth;
}

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

/* Luz ambiental superior */
.bg-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1000px;
  height: 500px;
  background: radial-gradient(circle, var(--glow-color) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

/* ==========================================================================
ENCABEZADO & NAVEGACIÓN
========================================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

.brand-logo {
  color: var(--brand-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-personal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-primary);
  color: #1E1E1E;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.btn-personal:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(91, 200, 0, 0.3);
}

/* ==========================================================================
ERO SECTION (OBJETIVO)
========================================================================= */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(91, 200, 0, 0.1);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
  max-width: 900px;
}

.highlight-text {
  color: var(--brand-primary);
}

.hero-objective {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 780px;
  margin-bottom: 2.5rem;
}

/* ==========================================================================
SECCIÓN CÓDIGO
========================================================================= */
.code-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.5rem 0.5rem;
}

.section-header {
  margin-bottom: 2rem;
  text-align: left;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ==========================================================================
FOOTER (NUEVA ESTRUCTURA)
========================================================================= */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 4rem 1.5rem 2.5rem;
  background: rgba(0, 0, 0, 0.15);
  background-color: transparent;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 450px;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: var(--transition);
  text-decoration: none;
}

.social-link:hover {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-link {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

#scrollToTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #1e293b;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#scrollToTopBtn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scrollToTopBtn:hover {
  background-color: #0f172a;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#scrollToTopBtn:active {
  transform: translateY(-1px);
}

.theme-toggle,
.mobile-menu-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover,
.mobile-menu-toggle:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.mobile-menu-toggle {
  display: none;
  border-radius: var(--radius-md);
}

/* ==========================================================================
BADGED DOCUMENTACIÓN DESACTUALIZADA
========================================================================= */
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.warning-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background-color: #f59e0b;
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 14px;
  line-height: 1;
}

.warning-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #92400e;
}

.warning-content a {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
}

.warning-content a:hover {
  color: #78350f;
}

/* ==========================================================================
RESPONSIVIDAD
========================================================================= */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 3.5rem;
  }

  .nav-container {
    padding: 0.8rem 1rem;
  }

  .btn-personal span {
    display: none;
  }

  .btn-personal {
    padding: 0.55rem;
    border-radius: 50%;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
       RESPONSIVIDAD & MENÚ DESPLEGABLE MÓVIL
       ========================================================================== */
@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: relative;
    top: 0;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 1.5rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Navegación central responsiva dinámica */
  .nav-center {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    gap: 1.2rem;
    align-items: flex-start;
    box-shadow: 0 10px 25px var(--shadow-color);
    backdrop-filter: blur(12px);
  }

  .nav-center.open {
    display: flex;
  }

  .nav-link.active::after {
    display: none;
  }
}