/* RESET Y BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: #192D36;
  color: white;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

a, button {
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

/* HEADER & NAVBAR */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.logo img {
  height: 60px;
  animation: fadeIn 1s ease-in-out;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-weight: 600;
  color: white;
}

.nav-links a:hover {
  color: #c4e0e5;
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-icons a {
  font-size: 1.2rem;
  color: white;
}

.social-icons a:hover {
  color: #c4e0e5;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  cursor: pointer;
  z-index: 1100;
}

.menu-toggle span {
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: 0.4s ease;
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translateY(9px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translateY(-9px); }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .nav-links {
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0,0,0,0.95);
    width: 220px;
    padding: 1rem 0;
    border-radius: 0 0 0 10px;
    transform: translateX(100%);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 12px 20px;
    width: 100%;
  }
}


/* MAIN *//* MAIN *//* MAIN *//* MAIN *//* MAIN *//* MAIN *//* MAIN */
main {
  padding: 1rem;
  max-width: 1000px;
  margin: auto;
}

main h2 {
  color: white;
  text-align: center;
  margin-bottom: 1rem;
}

/* RECURSOS ACADÉMICOS */
.recurso-ceo {
  padding: 2rem 1rem;
  background: #192d36;
  color: white;
  text-align: center;
}

.recurso-ceo h2 {
  margin-bottom: 2rem;
}

.fichas-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.ficha {
  background: white;
  color: #000;
  border-radius: 10px;
  box-shadow: 0 0px 20px 15px rgba(200, 50, 50, 0.2);
  overflow: hidden;
  max-width: 240px;
  width: 100%;
  text-align: center;
  padding-bottom: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;

  /* Estado inicial para animación */
  opacity: 0;
  transform: scale(0.8);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Activado cuando entra en pantalla */
.ficha.visible {
  animation-name: zoomIn;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
  animation-timing-function: ease;
}

/* Retrasos escalonados *//* Retrasos escalonados *//* Retrasos escalonados *//* Retrasos escalonados *//* Retrasos escalonados */
/* Retrasos escalonados *//* Retrasos escalonados *//* Retrasos escalonados *//* Retrasos escalonados *//* Retrasos escalonados */

.ficha.delay-0 { animation-delay: 0s; }
.ficha.delay-1 { animation-delay: 0.1s; }
.ficha.delay-2 { animation-delay: 0.2s; }
.ficha.delay-3 { animation-delay: 0.3s; }
.ficha.delay-4 { animation-delay: 0.4s; }
.ficha.delay-5 { animation-delay: 0.5s; }

.ficha:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.ficha .img-wrapper {
  position: relative;
  width: 92%;
  margin: 4%;
  overflow: hidden;
  max-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #eee;
  border-radius: 8px;
}

.ficha .img-wrapper img {
  max-height: 180px;
  width: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}

.ficha:hover .img-wrapper img {
  transform: scale(1.05);
}


.ficha .png-wrapper {
  position: relative;
  width: 92%;
  margin: 4%;
  overflow: hidden;
  max-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #eee;
  border-radius: 8px;
}

.ficha .png-wrapper png {
  max-height: 180px;
  width: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}

.ficha:hover .png-wrapper png {
  transform: scale(1.05);
}


.ficha .img-wrapper::after {
  content: "";
  background: url('recursos/caballo-ceo.png') no-repeat center center;
  background-size: contain;
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0.75;
  pointer-events: none;
  z-index: 1;
}

.ficha h3 {
  font-size: 1rem;
  margin: 1rem 0 0.5rem;
  padding: 0 0.5rem;
  min-height: 48px;
  z-index: 2;
  line-height: 1.3;
  font-weight: 600;
}

.ficha .botones {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  z-index: 2;
}

.ficha .botones a {
  background: #1d66ad;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  font-size: 0.85rem;
  transition: background 0.3s ease;
  cursor: pointer;
}

.ficha .botones a:hover {
  background: #c62828;
}

@media (max-width: 768px) {
  .fichas-container {
    flex-direction: column;
    align-items: center;
  }
}

@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}


/* --- TUTORIALES INFORMATIVOS (Imágenes enlazadas) --- */
.tutoriales-informativos {
    padding: 1rem 1rem; /* Ajusta el padding según necesites */
    background-color: #1a2d36; /* Un fondo claro para esta sección */
    color: #333; /* Color de texto para que se vea bien sobre el fondo claro */
    text-align: center;
}

.tutoriales-informativos h2 {
    color: white; /* O el color que desees para los títulos */
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.tutorial-links-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem; /* Espacio entre los elementos */
    max-width: 1200px;
    margin: 0 auto;
}

.tutorial-link-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    width: 100%; /* Por defecto, ocupará todo el ancho en móviles */
    max-width: 380px; /* Ancho máximo para cada elemento */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-link-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.tutorial-link-item a {
    text-decoration: none; /* Quita el subrayado del enlace */
    color: inherit; /* Hereda el color de texto del padre */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.tutorial-link-item h3 {
    color: #333;
    margin-top: 0rem; /* Ajuste el margen superior para el título */
    margin-bottom: 0rem;
    font-size: 1.3rem;
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio (height / width = 9 / 16 = 0.5625) */
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    background-color: #000; /* Fondo negro para cuando la imagen cargue */
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra el espacio */
    transition: transform 0.3s ease;
}

.tutorial-link-item:hover .image-wrapper img {
    transform: scale(1.05); /* Efecto de zoom en la imagen al pasar el ratón */
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem; /* Tamaño del icono de YouTube */
    color: rgba(255, 255, 255, 0.85); /* Blanco semi-transparente */
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease;
    z-index: 1; /* Asegura que el icono esté por encima de la imagen */
}

.tutorial-link-item:hover .play-icon {
    color: #ff0000; /* Color rojo de YouTube al pasar el ratón */
}

.tutorial-description {
    font-size: 0.95rem;
    color: #555;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.tutorial-placeholder-item {
    background-color: #eee;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem 1rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    color: #777;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px; /* Para que tenga un tamaño similar a un video */
}

.tutorial-placeholder-item h3 {
    color: #777;
    margin-bottom: 0.5rem;
}

/* Media queries para responsividad */
@media (min-width: 600px) {
    .tutorial-link-item,
    .tutorial-placeholder-item {
        width: calc(50% - 1rem); /* Dos elementos por fila en tablets */
    }
}

@media (min-width: 992px) {
    .tutorial-link-item,
    .tutorial-placeholder-item {
        width: calc(33.333% - 1rem); /* Tres elementos por fila en desktop */
    }
}


/* Sección extra centrada con animación *//* Sección extra centrada con animación *//* Sección extra centrada con animación */
.extra-sections {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  background: #f5f5f5;
  padding: 2rem 1rem;
  color: #000;
  border-top: 2px solid #000;

  /* Animación al aparecer */
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Clase que se activa al hacer scroll */
.extra-sections.visible {
  opacity: 1;
  transform: translateY(0);
}

.enlaces-fce,
.redes-ceo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 300px;
  width: 100%;
}

.enlaces-fce h3,
.redes-ceo h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  font-weight: bold;
}

.enlaces-fce ul,
.redes-ceo ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.enlaces-fce li,
.redes-ceo li {
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: center;
}

.extra-sections a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background-color: #ffffff;
  color: #000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-decoration: none;
  transition: all 0.3s ease;
}

.extra-sections a:hover {
  background-color: #192D36;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .extra-sections {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .extra-sections > div {
    max-width: 320px;
    width: 100%;
  }
}


/* FOOTER */
footer {
  background: rgba(0, 0, 0, 0.8);
  text-align: center;
  padding: 1rem;
}

/* ANIMACIONES */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1.2s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* CARRUSEL */

.institucional-carousel {
  position: relative;
  overflow: hidden;
  padding: 0rem 0;
}

.carousel-slide {
  height: 300px;
  position: relative;
}

.institucion {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity:  0;
  transition: opacity 1s ease-in-out;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.institucion.active {
  opacity: 1;
  z-index: 1;
}

.institucion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.texto-superpuesto {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0;
  transition: all 0.8s ease;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
}

.institucion.active .texto-superpuesto {
  opacity: 1;
  transform: translate(-50%, -60%);
}

.texto-superpuesto::after {
  content: '|';
  animation: blink 0.7s infinite;
  margin-left: 5px;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: white;
  background: rgba(0,0,0,0.2);
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  transition: transform 0.3s ease, background 0.3s ease;
  z-index: 2;
}

.carousel-btn:hover {
  transform: scale(1.2);
  background-color: rgba(255, 255, 255, 0.2);
}

.prev { left: 1px; }
.next { right: 1px; }

.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.carousel-indicators button.active {
  background: #fff;
  width: 14px;
  height: 14px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

/* --- Modal Preview --- */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  padding-top: 60px; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  background-color: rgba(0,0,0,0.8); 
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
}

#caption {
  margin: 10px auto;
  text-align: center;
  color: #fff;
  font-size: 18px;
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}
