/* ===============================
   Variables globales y modo oscuro
   =============================== */
:root {
  --bg: #f4f7fc;
  --text: #111111;
  --accent: #4cafef;
  --card-bg: #ffffff;
  --shadow: rgba(0,0,0,0.1);
  --glow: 0 0 15px rgba(76,175,239,0.6);
  --font-primary: "Poppins", "Segoe UI", Roboto, sans-serif;
  --font-size-base: 1rem;
}

body.dark-mode {
  --bg: #0f1117;
  --text: #f5f5f5;
  --accent: #58d3ff;
  --card-bg: #1c1e28;
  --shadow: rgba(0,0,0,0.6);
  --glow: 0 0 15px rgba(88,211,255,0.6);
}

/* ===============================
   Estilos globales
   =============================== */
body {
  margin: 0;
  padding-top: 56px;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: background 0.4s, color 0.4s;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.3s;
}

a:hover {
  color: var(--accent);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ===============================
   Header y navegación
   =============================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px var(--shadow);
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  white-space: nowrap;
  padding-bottom: 0.2rem;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  flex-shrink: 0;
}

.logo span {
  color: var(--accent);
  text-shadow: var(--glow);
}

/* Navegación */
.nav-list {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: max-content;
  flex-shrink: 0;
}

.nav-list li {
  flex-shrink: 0;
}

.nav-list li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.3s;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  background: var(--card-bg);
  box-shadow: 0 1px 3px var(--shadow);
  position: relative;
  z-index: 1;
}

.nav-list li a:hover,
.nav-list li a.active {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

/* Forzar que contenido interno no bloquee clicks */
.nav-list li a * {
  pointer-events: none;
}

/* Botón toggle tema */
.toggle-theme {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--text);
  transition: transform 0.3s;
  z-index: 2000;
}

.toggle-theme:hover {
  transform: scale(1.1) rotate(10deg);
}

/* ===============================
   Hero
   =============================== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  padding: 3rem 2rem;
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: var(--glow);
  transition: text-shadow 0.3s;
}

.hero-text h1:hover {
  text-shadow: 0 0 20px var(--accent);
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.hero-img img {
  width: 100%;
  max-width: 700px;
  aspect-ratio: 7/4;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 20px var(--shadow);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hero-img img:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}

/* ===============================
   Secciones principales
   =============================== */
section {
  padding: 3rem 2rem;
  min-height: 300px;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease;
  scroll-margin-top: 80px;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===============================
   Secciones temáticas
   =============================== */
section.contenido-tema {
  background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
  padding: 3rem 2rem;
  border-radius: 16px;
  border: 1px solid #d0d8e5;
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

section.contenido-tema:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 18px 36px rgba(0,0,0,0.15);
}

section.contenido-tema h2 {
  font-size: 2.4rem;
  font-weight: 800;
  color: #1e2c4f;
  margin-bottom: 1.5rem;
  position: relative;
  letter-spacing: -0.5px;
}

section.contenido-tema h2::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 0;
  height: 4px;
  background-color: #1e2c4f;
  border-radius: 2px;
  transition: width 0.4s ease;
}

section.contenido-tema h2:hover::after {
  width: 80px;
}

section.contenido-tema p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #2c3e5a;
  margin-bottom: 1.5rem;
}

section.contenido-tema ul {
  padding-left: 1.5rem;
}

section.contenido-tema ul li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 1rem;
  font-weight: 500;
  color: #2a3b5f;
}

section.contenido-tema ul li::before {
  content: "➤";
  position: absolute;
  left: 0;
  top: 0;
  color: #2a7;
  font-size: 1rem;
}

/* ===============================
   Blockquote caso real
   =============================== */
blockquote.bloque-caso {
  background: linear-gradient(135deg, #e3edff, #d0e1ff);
  border-left: 6px solid #2a5dd0;
  padding: 1.6rem 2rem;
  border-radius: 12px;
  font-style: italic;
  margin: 2rem 0;
  color: #1a2a4f;
  position: relative;
  transition: background 0.3s, transform 0.3s;
}

blockquote.bloque-caso:hover {
  transform: translateY(-3px) scale(1.01);
}

blockquote.bloque-caso::before {
  content: "📌 Caso real";
  position: absolute;
  top: -1.4rem;
  left: 1rem;
  background-color: #2a5dd0;
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
}

/* ===============================
   Footer
   =============================== */
.footer {
  background: var(--card-bg);
  text-align: center;
  padding: 1.5rem;
  box-shadow: 0 -2px 5px var(--shadow);
  font-size: 1rem;
}

/* ===============================
   Responsive Mobile <600px
   =============================== */
@media (max-width: 600px) {
  body { font-size: 0.95rem; padding-top: 56px; }

  .header-left {
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    white-space: nowrap;
  }

  .nav-list { gap: 0.4rem; min-width: max-content; }

  .nav-list li { flex-shrink: 0; }

  .nav-list li a {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-width: 60px;
    text-align: center;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 2rem 1rem;
  }

  .hero-text h1 { font-size: 2rem; }
  .hero-text p { font-size: 1rem; }

  section.contenido-tema { padding: 2rem 1rem; }
  section.contenido-tema h2 { font-size: 1.6rem; text-align: center; }
  .footer { font-size: 0.9rem; padding: 1rem; }
}

/* ===============================
   Modo oscuro refinado
   =============================== */
body.dark-mode {
  background: var(--bg);
  color: var(--text);
}

body.dark-mode section.contenido-tema {
  background: linear-gradient(135deg, #1a1d24 0%, #2a2f3c 100%);
  border: 1px solid #3a3f4c;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  color: #f5f5f5;
}

body.dark-mode section.contenido-tema h2 { color: #ffffff; }

body.dark-mode section.contenido-tema h2::after { background-color: #ffffff; }

body.dark-mode section.contenido-tema p,
body.dark-mode section.contenido-tema ul li { color: #f5f5f5; }

body.dark-mode section.contenido-tema ul li::before { color: #4cd137; }

body.dark-mode blockquote.bloque-caso {
  background: linear-gradient(135deg, #2c3442, #3a4055) !important;
  border-left-color: #58d3ff !important;
  color: #f5f5f5 !important;
}

body.dark-mode blockquote.bloque-caso::before {
  background-color: #58d3ff !important;
  color: #fff !important;
}

body.dark-mode blockquote.bloque-caso * { color: #f5f5f5 !important; }

/* ===============================
   Fullscreen message
   =============================== */
#fullscreenMessage {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #2a5dd0;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#fullscreenMessage.visible { opacity: 1; }

/* ===============================
   Botón tema2 fix PC
   =============================== */
.nav-list li a#tema2 {
  position: relative;
  z-index: 1002;
}
