:root {
  --primary-color: #3a86ff;
  --primary-color-rgb: 58, 134, 255;
  --secondary-color: #8338ec;
  --accent-color: #ff006e;
  --background-color: #ffffff;
  --text-color: #333333;
  --card-background: #f0f0f0;
  --bg-code: #0d1117;
  --bg-card: rgba(255, 255, 255, 0.04);
  --radius-lg: 0.75rem;
}

.dark {
  --primary-color: #3a86ff;
  --primary-color-rgb: 58, 134, 255;
  --secondary-color: #8338ec;
  --accent-color: #ff006e;
  --background-color: #001233;
  --text-color: #fffffe;
  --card-background: rgba(255, 255, 255, 0.05);
}

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

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

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: var(--background-color);
  padding-bottom: 1rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .container::after {
  content: "";
  display: table;
  clear: both;
}

header.scrolled {
  background: var(--background-color);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

header .logo {
  float: left;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

header nav {
  float: right;
}

header nav ul {
  list-style: none;
  display: flex;
  align-items: center;
}

header nav ul li {
  margin-left: 2rem;
}

header nav ul li a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

header nav ul li a:hover {
  color: var(--primary-color);
}

.dropdown {
  position: relative;
}

.dropdown > i {
  margin-left: 0.5rem;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card-background);
  border-radius: 8px;
  min-width: 160px;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.dropdown-menu.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-menu li {
  padding: 0.5rem 1rem;
}

.dropdown-menu li a {
  color: var(--text-color);
  text-decoration: none;
  display: block;
}

.login-button {
  background: var(--accent-color);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.3s ease;
  margin-left: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.login-button:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

@media (max-width: 768px) {
  header .logo,
  header nav {
    float: none;
    text-align: center;
  }

  header nav ul {
    flex-direction: column;
    padding-top: 1rem;
  }

  header nav ul li {
    margin: 0.5rem 0;
  }
}

.site-footer {
  background: #0b1c3a;
  color: #cfe3ff;
}

.site-footer .container {
  padding: 3rem 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.footer-col p {
  color: #cfe3ff;
  line-height: 1.6;
}

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

.footer-col li {
  margin: .5rem 0;
}

.footer-col a {
  color: #cfe3ff;
  text-decoration: none;
  transition: opacity .2s, transform .2s;
  display: inline-flex;
  gap: .5rem;
  align-items: center;
}

.footer-col a:hover {
  opacity: 0.9;
  transform: translateX(2px);
}

/* Center footer content globally (match index) */
.site-footer .footer-grid {
  text-align: center;
}

.site-footer .footer-col a {
  justify-content: center;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.footer-bottom p {
  margin: 0;
  color: #a8c4ff;
  font-size: .95rem;
}

.legal-links {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
}

.legal-links a {
  color: #cfe3ff;
  text-decoration: none;
  font-weight: 500;
}

.legal-links .sep {
  color: #5b77b6;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-col a {
    justify-content: center;
  }
}

.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.theme-toggle i {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .fa-sun {
  position: absolute;
  opacity: 0;
  transform: scale(0.5);
}

.dark .theme-toggle .fa-moon {
  opacity: 0;
  transform: scale(0.5);
}

.dark .theme-toggle .fa-sun {
  opacity: 1;
  transform: scale(1);
}

.cookie-banner {
  position: fixed;
  bottom: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(var(--primary-color-rgb), 0.95);
  color: #ffffff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  text-align: center;
  transition: bottom 0.5s ease-in-out;
  backdrop-filter: blur(5px);
}

.cookie-banner.show {
  bottom: 20px;
}

.cookie-banner p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.cookie-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.cookie-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cookie-btn.accept {
  background: #ffffff;
  color: var(--primary-color);
}

.cookie-btn.reject {
  background: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
}

.cookie-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

main {
    display: block;
    padding-top: 84px;
}

:root {
    --warning-color: #ff9800;
}

a:focus-visible,
button:focus-visible,
.service-link:focus-visible,
.inline-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 8px;
}

.section {
    scroll-margin-top: 88px;
}

:root {
  /* Colores primarios existentes */
  --primary-color-rgb: 58, 134, 255;
  --secondary-color-rgb: 131, 56, 236;
  --accent-color-rgb: 255, 0, 110;
  
  /* Colores temáticos para módulos teóricos */
  --theory-primary: #8B4513;
  --theory-secondary: #DAA520;
  --theory-accent: #FFD700;
  --theory-bg: rgba(139, 69, 19, 0.05);
  
  /* Colores temáticos para laboratorios */
  --lab-primary: #008080;
  --lab-secondary: #00FFFF;
  --lab-accent: #40E0D0;
  --lab-bg: rgba(0, 128, 128, 0.05);
  
  /* Colores temáticos para CTF */
  --ctf-primary: #9400D3;
  --ctf-secondary: #FF1493;
  --ctf-accent: #8A2BE2;
  --ctf-bg: rgba(148, 0, 211, 0.05);
  
  /* Gradientes temáticos */
  --theory-gradient: linear-gradient(135deg, var(--theory-primary), var(--theory-secondary));
  --lab-gradient: linear-gradient(135deg, var(--lab-primary), var(--lab-secondary));
  --ctf-gradient: linear-gradient(135deg, var(--ctf-primary), var(--ctf-secondary));
  
  /* Sombras temáticas */
  --theory-shadow: 0 10px 30px rgba(218, 165, 32, 0.2);
  --lab-shadow: 0 10px 30px rgba(0, 255, 255, 0.2);
  --ctf-shadow: 0 10px 30px rgba(255, 20, 147, 0.3);
  
  /* Efectos de brillo */
  --theory-glow: 0 0 20px rgba(218, 165, 32, 0.3);
  --lab-glow: 0 0 20px rgba(0, 255, 255, 0.4);
  --ctf-glow: 0 0 30px rgba(255, 20, 147, 0.5);
}

/* Modo dark - ajustes para colores temáticos */
.dark {
  --theory-bg: rgba(139, 69, 19, 0.08);
  --lab-bg: rgba(0, 128, 128, 0.08);
  --ctf-bg: rgba(148, 0, 211, 0.08);
  
  --theory-shadow: 0 10px 30px rgba(218, 165, 32, 0.15);
  --lab-shadow: 0 10px 30px rgba(0, 255, 255, 0.15);
  --ctf-shadow: 0 10px 30px rgba(255, 20, 147, 0.2);
}

/* Utilidades para animaciones */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    filter: brightness(1) saturate(1);
  }
  to {
    filter: brightness(1.1) saturate(1.2);
  }
}

/* Transiciones suaves para cambios de tema */
* {
  transition-property: background-color, border-color, box-shadow, filter;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}