/* Paleta principal */
:root {
  --color-primario: #029fec;   /* Azul */
  --color-secundario: #aa0088; /* Morado */
  --color-terciario: #d4aa00;  /* Dorado */
  --color-acentuador: #ff6600; /* Naranja */
  --color-blanco: #fff;
  --color-gris: #f4f4f4;
  --color-texto: #222;
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Estilos del cuerpo */
body {
  font-family: 'Baloo 2', Arial, sans-serif;
  line-height: 1.6;
  background: var(--color-blanco);
  color: var(--color-texto);
}

/* Encabezado */
header {
  position: fixed;
  width: 100%;
  background-color: var(--color-primario);
  background-image: linear-gradient(rgba(2,159,236,0.65), rgba(2,159,236,0.65)), url('assets/images/bgh.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--color-blanco);
  padding: 0.8rem 2vw;
  display: grid;
  grid-template-columns: 1fr 3fr 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(2,159,236,0.08);
}

/* Logo izquierdo (primer container) */
.logo-container:first-child {
  grid-column: 1;
  grid-row: 1 / span 2;
  justify-self: start;
}

/* Logo central y menú */
.logo {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--color-blanco);
  text-align: center;
}

/* Logo derecho (segundo container) */
.logo-container:last-child {
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
}

.logo-image {
  width: 60px;
  height: auto;
  max-width: 12vw;
  min-width: 32px;
}

/* Ocultar hamburger en desktop */
.hamburger {
  display: none;
}

/* Menú de navegación horizontal */
header nav {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  position: static;
  background: none;
  width: auto;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  justify-content: center;
  flex-wrap: wrap;
}

nav ul li {
  margin: 0;
}

nav ul li a {
  color: var(--color-blanco);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  font-size: 0.85rem;
  transform: scale(1) translateY(0) rotate(0deg);
  opacity: 1;
  box-shadow: none;
}

nav ul li a:hover {
  background: var(--color-acentuador);
  color: var(--color-blanco);
  transform: scale(1.3) rotate(-10deg);
  box-shadow: none;
}

/* Animaciones de entrada para los enlaces del nav */
nav ul li {
  opacity: 0;
  transform: translateY(-20px);
  animation: navItemFadeIn 0.6s ease-out forwards;
}

nav ul li:nth-child(1) { animation-delay: 0.1s; }
nav ul li:nth-child(2) { animation-delay: 0.2s; }
nav ul li:nth-child(3) { animation-delay: 0.3s; }
nav ul li:nth-child(4) { animation-delay: 0.4s; }
nav ul li:nth-child(5) { animation-delay: 0.5s; }
nav ul li:nth-child(6) { animation-delay: 0.6s; }

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

nav ul li a:active {
  transform: scale(0.95) translateY(0);
  transition: all 0.1s;
}

nav.hidden {
  /* En desktop el menú siempre está visible */
  opacity: 1;
  pointer-events: auto;
}

/* Responsive: volver al menú hamburguesa en móviles */
@media (max-width: 768px) {
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    grid-template-columns: none;
    grid-template-rows: none;
  }

  .logo-container:first-child {
    grid-column: unset;
    grid-row: unset;
    justify-self: unset;
  }

  .logo {
    grid-column: unset;
    grid-row: unset;
    justify-self: unset;
    text-align: left;
  }

  .logo-container:last-child {
    grid-column: unset;
    grid-row: unset;
    justify-self: unset;
  }

  .hamburger {
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1100;
  }

  .hamburger span {
    display: block;
    width: 28px;
    height: 4px;
    margin: 5px 0;
    background: var(--color-blanco);
    border-radius: 2px;
    transition: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .hamburger span:nth-child(3) {
    display: none;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
  }

  .hamburger.active span:nth-child(2) {
    transform: translateY(-4px) rotate(-45deg);
  }

  header nav {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: var(--color-primario);
    width: 200px;
    box-shadow: 0 4px 16px rgba(2,159,236,0.10);
    opacity: 1;
    pointer-events: auto;
    transition: right 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s cubic-bezier(0.22, 1, 0.36, 1);
    grid-column: unset;
    grid-row: unset;
    justify-self: unset;
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav ul li a {
    display: block;
    padding: 1rem;
    font-size: 1rem;
    white-space: normal;
    transform: scale(1);
    box-shadow: none;
  }

  nav ul li a:hover {
    transform: scale(1.03) translateX(8px) rotate(-5deg);
    box-shadow: 0 3px 12px rgba(255,102,0,0.3);
  }

  nav.hidden {
    right: -220px;
    opacity: 0;
    pointer-events: none;
  }

  /* Desactivar animaciones complejas en móvil */
  nav ul li {
    opacity: 1;
    transform: translateY(0);
    animation: none;
  }
  
  nav ul li a:active {
    transform: scale(0.98);
  }
}

/* Imagen de inicio */
.imagen-inicio {
  width: 100%;
  max-width: 100vw;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s;
  transform: scale(1.15);
  opacity: 0;
}

.imagen-inicio.visible {
  transform: scale(1);
  opacity: 1;
}

/* Secciones */
main {
  width: 80%;
  margin: 0 auto;
  padding-top: 100px; /* Espacio para el encabezado fijo más alto */
}

section {
  padding: 4rem 1rem;
  min-height: 100vh;
  transition: opacity 0.8s, transform 0.8s;
  opacity: 0;
  transform: translateY(40px);
  background: linear-gradient(
    0deg,
    rgba(2,159,236,0.1) 0%,    /* Azul muy translúcido */
    rgba(212,170,0,0.1) 50%,   /* Dorado muy translúcido */
    rgba(255,102,0,0.1) 100%   /* Naranja muy translúcido */
  );
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(2,159,236,0.10);
}

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

section:nth-child(even) {
  background: linear-gradient(
    90deg,
    rgba(2,159,236,0.1) 0%,    /* Azul muy translúcido */
    rgba(212,170,0,0.1) 50%,   /* Dorado muy translúcido */
    rgba(255,102,0,0.1) 100%   /* Naranja muy translúcido */
  );
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(2,159,236,0.10);
}

/* Títulos de sección */
section h1 {
  color: var(--color-secundario);
  margin-bottom: 1rem;
}

/* Formulario flotante */
.form-flotante {
  max-width: 400px;
  margin: 0 auto;
}

.campo {
  position: relative;
  margin-bottom: 1.5em;
}

.campo input,
.campo textarea {
  width: 100%;
  padding: 12px 8px 12px 8px;
  border: 1px solid var(--color-primario);
  border-radius: 4px;
  outline: none;
  font-size: 1em;
  background: none;
  color: var(--color-texto);
}

.campo input:focus,
.campo textarea:focus {
  border-color: var(--color-acentuador);
  box-shadow: 0 0 0 2px rgba(255,102,0,0.15);
}

.campo label {
  position: absolute;
  left: 10px;
  top: 12px;
  color: #888;
  background: var(--color-blanco);
  padding: 0 4px;
  pointer-events: none;
  transition: 0.2s;
}

.campo input:focus + label,
.campo input:not(:placeholder-shown) + label,
.campo textarea:focus + label,
.campo textarea:not(:placeholder-shown) + label {
  top: -10px;
  left: 6px;
  font-size: 0.85em;
  color: var(--color-secundario);
  background: var(--color-blanco);
}

.btn-whatsapp {
  background: var(--color-primario);
  color: var(--color-blanco);
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(255,102,0,0.10);
  letter-spacing: 1px;
}

.btn-whatsapp:hover {
  background: var(--color-acentuador);
  color: var(--color-blanco);
  box-shadow: 0 4px 16px rgba(212,170,0,0.15);
}

/* Ocultar menú */
.hidden {
  display: none;
}

.formulario-contacto {  
  background: var(--color-blanco);
  box-shadow: 0 2px 10px rgba(2,159,236,0.10);
  padding: 20px;
  border-radius: 8px;
  z-index: 1000;
}

.red-social {
  background: var(--color-blanco);
  box-shadow: 0 2px 10px rgba(2,159,236,0.10);
  padding: 20px;
  border-radius: 8px;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  gap: 32px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 100vw;
  box-sizing: border-box;
}

.redes {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
}

.redes a {
  text-decoration: none;
}

.icono-redes {
  width: auto;
  height: 50px;
  margin: 0;
  display: block;
  transition: transform 0.4s, box-shadow 0.4s, opacity 0.8s;
  opacity: 0;
  transform: scale(1.3) rotate(-10deg);
}

.icono-redes.visible {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.icono-redes.visible:hover {
  transform: scale(1.1) rotate(-5deg);
}

.lavel-redes {
  margin: 0;
  padding: 0;
  color: var(--color-secundario);
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.5px;
}

.redes a .lavel-redes {
  color: var(--color-texto);
  text-decoration: none;
  text-underline-position: none;
  cursor: pointer;
  transition: color 0.2s;
}

.redes a:hover .lavel-redes {
  color: var(--color-acentuador);
  /* Puedes cambiar el color al pasar el mouse si lo deseas */
}

/* Nueva sección para la tarjeta de video */
.video-tarjeta {
  max-width: 380px;
  margin: 2rem auto;
  background: var(--color-blanco);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(2,159,236,0.10);
  overflow: hidden;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s;
  transform: translateY(40px) scale(0.95);
  opacity: 0;
}

.video-tarjeta.visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.video-tarjeta iframe {
  width: 100%;
  height: 215px;
  display: block;
}

.video-descripcion {
  padding: 1rem;
  color: var(--color-texto);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  justify-items: center;
  align-items: stretch;
  margin: 0 auto;
  max-width: 900px;
}

.cursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  justify-content: center;
  align-items: stretch;
  margin: 2rem auto 0 auto;
  max-width: 900px;
}

.curso-tarjeta {
  background: var(--color-blanco);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(2,159,236,0.13);
  padding: 2.2rem 2rem 1.5rem 2rem;
  max-width: 420px;
  min-width: 300px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.curso-tarjeta:hover {
  transform: translateY(-6px) scale(1.025);
  box-shadow: 0 8px 32px rgba(2,159,236,0.18);
}

.curso-header {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  margin-bottom: 1.2rem;
}

.curso-logo {
  height: 54px;
  width: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(2,159,236,0.10);
  padding: 0.3rem 0.6rem;
  object-fit: contain;
}

.curso-logo.cressere {
  background: #f8f8f8;
}

.curso-info {
  width: 100%;
  text-align: center;
}

.curso-nombre {
  font-size: 1.1rem;
  color: var(--color-secundario);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.curso-invita {
  color: var(--color-primario);
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
  font-weight: 500;
}

.curso-titulo {
  font-size: 1.3rem;
  color: var(--color-acentuador);
  margin-bottom: 0.7rem;
  font-weight: bold;
}

.curso-descripcion {
  color: var(--color-texto);
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
}

.curso-datos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  font-size: 1.02rem;
  color: var(--color-secundario);
  background: var(--color-gris);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin-top: 0.5rem;
}

/* Palabra CREPA coloreada */
.crepa .letter {
  font-weight: bold;
  -webkit-text-stroke: 1px #111;
  text-shadow: 0 0 1px #111;
}
.letter.c { color: red; }
.letter.r { color: yellow; }
.letter.e { color: green; }
.letter.p { color: blue; }
.letter.a { color: purple; }

@media (max-width: 600px) {
  .curso-tarjeta {
    padding: 1.2rem 0.7rem 1rem 0.7rem;
    min-width: 0;
    max-width: 98vw;
  }
  .curso-header {
    gap: 0.7rem;
  }
  .curso-logo {
    height: 38px;
    padding: 0.2rem 0.3rem;
  }
}

@media (max-width: 900px) {
  header {
    background-size: cover;
    background-position: center;
    padding: 0.7rem 2vw;
  }
  .logo-image {
    width: 32px;
    max-width: 10vw;
  }
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 2vw;
  }
  .logo {
    font-size: 1.1rem;
    margin-top: 0.3em;
  }
  .logo-image {
    width: 28px;
    max-width: 16vw;
    margin-right: 0;
  }
  header nav {
    top: 48px;
    width: 90vw;
    min-width: 180px;
    right: 0;
  }
  .imagen-inicio {
    max-width: 98vw;
    max-height: 180px;
  }
  footer {
    font-size: 0.85rem;
    padding: 0.7rem 0.5rem;
    
  }
  .red-social {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 2vw;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }
  .redes {
    width: 100%;
    min-width: 0;
    max-width: 98vw;
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
  }
  .icono-redes {
    width: 36px;
    height: 36px;
  }
  .lavel-redes {
    font-size: 0.95rem;
    word-break: break-word;
    text-align: left;
  }
}

/* Estilos del footer */
footer {
  background-color: rgba(2,159,236,0.65);
  color: var(--color-blanco);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.95rem;
  width: 100vw;
  box-sizing: border-box;
  margin: 0;
}

.footer-nav {
  display: inline-block;
  margin-top: 0.5em;
  font-size: 1em;
  background: none;
  color: inherit;
}
.footer-nav a {
  color: var(--color-blanco);
  text-decoration: underline dotted rgba(255,255,255,0.3);
  margin: 0 0.2em;
  transition: color 0.2s;
}
.footer-nav a:hover {
  color: var(--color-acentuador);
}
@media (max-width: 600px) {
  footer {
    font-size: 0.85rem;
    padding: 0.7rem 0.5rem;
  }
  .footer-nav {
    display: block;
    font-size: 0.95em;
    margin-top: 0.4em;
    word-break: break-word;
  }
  .footer-nav a {
    display: inline-block;
    margin: 0.2em 0.1em;
  }
}
