/* Variables para colores y estilos básicos */
:root {
  --primary-color: #005a87;
  --secondary-color: #003f5c;
  --accent-color: #ff6b6b;
  --bg-color: #f4f4f4;
  --white: #ffffff;
  --text-color: #333333;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Reset y box-sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Estilo global para el body */
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Header moderno y centrado */
header {
  background: var(--primary-color);
  color: var(--white);
  padding: 2rem;
  text-align: center;
  position: relative;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1rem;
}

/* Contenedor principal */
main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

/* Secciones de contenido */
article section {
  margin-bottom: 2rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 1.5rem;
}

article section:last-child {
  border-bottom: none;
}

article section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  position: relative;
}

article section h2::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent-color);
  margin-top: 0.5rem;
  border-radius: 2px;
}

article section p {
  font-size: 1rem;
  margin-bottom: 1rem;
  line-height: 1.8;
}

article section ul {
  list-style-type: disc;
  padding-left: 1.5rem;
}

article section ul li {
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  background: var(--secondary-color);
  color: var(--white);
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

/* Enlaces */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Botón "Volver Arriba" */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow);
  transition: background 0.3s, transform 0.3s;
}

#back-to-top:hover {
  background: var(--secondary-color);
  transform: scale(1.1);
}

/* Botones laterales desplegables y animaciones para iconos */
#side-buttons {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 1000;
}

#side-buttons.show {
  opacity: 1;
}

/* Los botones se muestran con efecto pop-in y contienen los iconos */
#side-buttons .side-btn {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 5px 0 0 5px;
  padding: 10px 15px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  /* Efecto de despliegue: inicia en escala 0 y se expande */
  transform: scale(0);
  animation: popIn 0.5s forwards;
  animation-delay: 0.3s;
}

.side-btn:hover {
  background: var(--secondary-color);
  transform: translateX(-5px);
}

/* Animación para los iconos (latido de corazón) */
.side-btn i {
  font-size: 1.5rem;
  display: inline-block;
  animation: heartbeat 1s infinite;
}

@keyframes popIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* Opcional: Pausar la animación de latido al pasar el cursor */
.side-btn:hover i {
  animation-play-state: paused;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  main {
    margin: 1rem;
    padding: 1rem;
  }
  
  article section h2 {
    font-size: 1.5rem;
  }
}
