body { 
  padding-top: 56px; 
}
.left-aligned { 
  margin-left: auto; 
}
.bg-dark { 
  background-color: #343a40 !important; 
}
.bg-hero { 
  background-color: #45b06cff; 
}

/* Make all <hr> lines transparent but keep their space */
hr {
  border: none !important;
  background: transparent !important;
  height: 1px !important;
  margin: 1em 0 !important;
  opacity: 0 !important;
}

/* CALLOUT */
.bd-callout { 
  padding: 1.25rem; 
  margin-top: 1.25rem; 
  margin-bottom: 1.25rem; 
  border: 1px solid #e9ecef; 
  border-left-width: .25rem; 
  border-radius: .25rem 
}
.bd-callout h4 { 
  margin-bottom: 1.25rem 
}
.bd-callout p:last-child { 
  margin-bottom: 0 
}
.bd-callout code { 
  border-radius: .25rem 
}
.bd-callout+.bd-callout { 
  margin-top: -.25rem 
}
.bd-callout-info { 
  border-left-color: #5bc0de 
}
.bd-callout-warning { 
  border-left-color: #f0ad4e 
}
.bd-callout-danger { 
  border-left-color: #d9534f 
}

/* footer */
footer a { 
  color: white; 
  font-weight: bold; 
  text-decoration: none; 
}
footer a:hover { 
  color: white; 
  text-decoration: underline; 
}

/* Fade-in animation for text *//* Center fade-in text and extend animation duration */
.fade-in {
  opacity: 0;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, 0);
  animation: fadeInToMiddle 5s ease forwards;
  text-align: center;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  z-index: 10;
}

@keyframes fadeInToMiddle {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -4vh); /* Move to middle of header (adjust 37vh as needed) */
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -11vh);
  }
}

/* Make the animated arrow SVG smaller but keep animation, structure, and placement */
.arrow-svg {
  display: block;
  margin: 40px auto 40px auto; /* Add space above and below */
  width: 64px;
  height: 64px;
  max-width: 100%;
}

/* Video Containers: Enforce 16:9 aspect ratio with padding hack */
.video-container,
.video-wave-container {
  position: relative;
  width: 100%;
  max-width: 1200px;  /* Optional: Cap width for large screens */
  margin: 20px auto;  /* Center and add spacing */
  height: 0;  /* Collapse height */
  padding-bottom: 56.25%;  /* 16:9 = 9/16 * 100% = 56.25% */
  overflow: hidden;  /* Clip any overflow */
  z-index: 5;  /* Ensure above decorative elements */
  background: #000;  /* Optional: Black background for video */
  border-radius: 8px;  /* Optional: Rounded corners */
}

/* Iframe Styling: Fill the container absolutely */
.video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;  /* Remove any default borders */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .video-container,
  .video-wave-container {
    margin: 10px auto;
    padding-bottom: 56.25%;  /* Maintain aspect on mobile */
  }
}

/* Wave effect */
.wave-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.wave-inverted {
  width: 100%;
  transform: scaleY(-1); /* flips the wave */
  display: block;
}

/* Make wave-svg image same width as header */
.wave-svg {
  display: block;
  width: 100vw;
  max-width: 50%;
  min-width: 100%;
  margin: 0 auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

/* Fish animation */
/* Inline fish for <hr> sections with horizontal movement */
.fish-container {
  position: relative;
  width: 100%;
  height: 40px;
  margin-bottom: 1em;
}

.fish {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: auto;
  z-index: 2;
  animation: swim-full 30s ease-in-out infinite;
  display: block;
  margin: 0;
}

/* Fish 5 also moves up and down while swimming left to right */
.fish5 {
  animation: swim-full-wave 30s ease-in-out infinite;
}

@keyframes swim-full {
  0%   { left: 0;   transform: scaleX(1); }
  40%  { left: calc(100% - 40px); transform: scaleX(1.1);}
  50%  { left: calc(100% - 40px); transform: scaleX(-1);}
  90%  { left: 0;   transform: scaleX(-1.1);}
  100% { left: 0;   transform: scaleX(1);}
}

@keyframes swim-full-wave {
  0%   { left: 0;   top: 0;    transform: scaleX(1);}
  10%  { left: 10%; top: -10px;}
  20%  { left: 20%; top: -20px;}
  30%  { left: 30%; top: -10px;}
  40%  { left: calc(100% - 40px); top: 0;}
  50%  { left: calc(100% - 40px); top: 10px; transform: scaleX(-1);}
  60%  { left: 60%; top: 20px;}
  70%  { left: 40%; top: 10px;}
  80%  { left: 20%; top: 0;}
  90%  { left: 10%; top: -10px;}
  100% { left: 0;   top: 0;   transform: scaleX(1);}
}

/* Underwater section */
.underwater-container {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 100px); /* approximate header + footer space */
  overflow: hidden;
}

.underwater-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* full height of container */
  pointer-events: none;
  z-index: 1;
}

/* Bubble style */ 

.bubble {
  position: fixed;          /* relative to viewport */
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  z-index: 10;              /* on top of other content */
  pointer-events: none;     /* doesn’t block clicks */
  width: 10px;              /* default, overridden by JS */
  height: 10px;             /* default, overridden by JS */
}
/* STATIC PNG HOME (through years section */ 
.ag-timeline-card_img-box-right {
  float: right;
  margin-left: 32px;
  margin-bottom: 16px;
  max-width: 320px;
}

.ag-timeline-card_img-box-right img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.ag-timeline-card_img-box-left {
  float: left;
  margin-right: 32px;
  margin-bottom: 16px;
  max-width: 320px;
}

.ag-timeline-card_img-box-left img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* imagen de challenge */
.image-container {
  position: relative;
  width: 100%;
  height: auto; /* imagen determina la altura */
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 20px; 
}

.image-container .img-fluid {
  width: 100%;
  height: auto; 
  object-fit: cover; 
  display: block;
}

/* Responsividad para pantallas pequeñas */
@media (max-width: 768px) {
  .image-container {
    height: auto; 
    margin-bottom: 10px;
  }
}

.discover-text-container {
  background-color: #6faacd; 
  padding: 2rem; 
  text-align: center; 
  color: #333; 
  font-size: 1.2rem; 
  line-height: 1.6; 
  margin-top: 0;
  margin-bottom: 0;
}

/* Responsividad para pantallas pequeñas */

/* contenedor de facts */
.image-overlay-container {
  position: relative;
  width: 100%;
  height: 600px; 
  overflow: hidden;
  margin-top: 0;
}

.image-overlay-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0); /* Changed to fully transparent */
  display: flex;
  flex-direction: column; 
  justify-content: center;
  align-items: center;
  color: white;
  padding: 2rem;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
}

.overlay h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem; 
  font-family: 'Montserrat', sans-serif;
  width: 100%; 
  text-align: center; 
  display: block; 
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7); /* Added to improve readability against the image */
}

.overlay .fact-container {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  width: 100%;
  flex-wrap: wrap; /* Permite que se ajuste en pantallas pequeñas */
}

.overlay .fact {
  display: flex;
  flex-direction: column; 
  align-items: center; 
  font-size: 1.5rem;
  margin: 0.5rem;
  font-family: 'Montserrat', sans-serif;
  flex: 1; 
  min-width: 200px; 
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7); /* Added to improve readability */
}

.overlay .fact-text {
  font-size: 1.2rem; 
  text-align: center; 
  margin-top: 0.5rem; 
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7); /* Added to improve readability */
}

.overlay .counter {
  font-size: 2rem;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7); /* Added to improve readability */
}

/* Responsividad para pantallas pequeñas */
@media (max-width: 768px) {
  .image-overlay-container {
    height: 300px;
  }
  .overlay h2 {
    font-size: 1.8rem;
  }
  .overlay .fact-container {
    flex-direction: column; /* Apila verticalmente en pantallas pequeñas */
    align-items: center;
  }
  .overlay .fact {
    font-size: 1.2rem;
  }
  .overlay .fact-text {
    font-size: 1rem;
  }
  .overlay .counter {
    font-size: 1.5rem;
  }
}

/* Estilos para el timeline */
.ag-timeline-block {
  padding: 100px 0 0; 
  background-color: transparent; 
}

.ag-timeline_title-box {
  padding: 0 0 30px;
  text-align: center;
}

.ag-timeline_tagline {
  font-size: 40px;
  color: #333; 
  font-family: 'Montserrat', sans-serif;
}

.ag-timeline_title {
  font-size: 80px;
  color: #ffffff; /* Color más oscuro para el título */
  font-family: 'Montserrat', sans-serif;
  background-image: none; /* Quitamos el fondo de imagen para simplicidad */
  -webkit-background-clip: initial;
  background-clip: initial;
  text-fill-color: initial;
}

.ag-timeline_item {
  margin: 0 0 50px;
  position: relative;
}

.ag-timeline_item:nth-child(2n) {
  text-align: right;
}

.ag-timeline {
  display: inline-block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

.ag-timeline_line {
  width: 2px;
  background-color: #81670c;
  position: absolute;
  top: 2px;
  left: 50%;
  bottom: 0;
  overflow: hidden;
  transform: translateX(-50%);
}

.ag-timeline_line-progress {
  width: 100%;
  height: 20%;
  background-color: #2E5A7A; 
}

.ag-timeline-card_box {
  padding: 0 0 20px 50%;
}

.ag-timeline_item:nth-child(2n) .ag-timeline-card_box {
  padding: 0 50% 20px 0;
}

.ag-timeline-card_point-box {
  display: inline-block;
  margin: 0 14px 0 -28px;
}

.ag-timeline_item:nth-child(2n) .ag-timeline-card_point-box {
  margin: 0 -28px 0 14px;
}

.ag-timeline-card_point {
  position: relative;
  width: 50px; 
  height: 50px;
  background: #fff5e6; 
  border: 3px solid #2E5A7A; 
  border-radius: 50%; 
  overflow: hidden; 
  display: flex; 
  justify-content: center;
  align-items: center;
}

.js-ag-active .ag-timeline-card_point {
  color: #fff5e6;
  background-color: #2E5A7A;
}

.ag-timeline-card_meta-box {
  display: inline-block;
}

.ag-timeline-card_meta {
  margin: 10px 0 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: bold;
  font-size: 28px;
  color: #ffffff; 
}

.ag-timeline-card_item {
  display: inline-block;
  width: 45%;
  margin: -77px 0 0;
  background-color: #fff; /* Fondo blanco para las tarjetas */
  opacity: 0;
  border-radius: 6px;
  box-shadow: 0 0 5px rgba(0,0,0,.5);
  transition: transform .5s, opacity .5s;
  position: relative;
}

.ag-timeline_item:nth-child(2n+1) .ag-timeline-card_item {
  transform: translateX(-200%);
}

.ag-timeline_item:nth-child(2n) .ag-timeline-card_item {
  transform: translateX(200%);
}

.js-ag-active.ag-timeline_item:nth-child(2n+1) .ag-timeline-card_item,
.js-ag-active.ag-timeline_item:nth-child(2n) .ag-timeline-card_item {
  opacity: 1;
  transform: translateX(0);
}

.ag-timeline-card_arrow {
  height: 18px;
  width: 18px;
  margin-top: 20px;
  background-color: #fff; /* Fondo blanco para la flecha */
  z-index: -1;
  position: absolute;
  top: 0;
  right: 0;
  transform: rotate(45deg);
}

.ag-timeline_item:nth-child(2n+1) .ag-timeline-card_arrow {
  margin-left: calc(-18px / 2);
  margin-right: calc(-18px / 2);
}

.ag-timeline_item:nth-child(2n) .ag-timeline-card_arrow {
  margin-left: -10px;
  right: auto;
  left: 0;
}

.ag-timeline-card_img {
  width: 100%;
}

.ag-timeline-card_info {
  padding: 20px 30px;
}

.ag-timeline-card_title {
  display: none;
  margin: 10px 0 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: bold;
  font-size: 28px;
  color: #ffffff; 
}

.ag-timeline-card_desc {
  line-height: 1.45;
  font-size: 16px;
  color: #979494;
}

.timeline-bacteria {
  width: 100%; 
  height: auto; 
  max-width: 100%;
  max-height: 100%; 
  object-fit: contain; 
}

/* Media queries ajustadas */
@media only screen and (max-width: 979px) {
  .ag-timeline_line {
    left: 30px;
  }
  .ag-timeline_item:nth-child(2n) {
    text-align: left;
  }
  .ag-timeline-card_box,
  .ag-timeline_item:nth-child(2n) .ag-timeline-card_box {
    padding: 0 0 20px;
  }
  .ag-timeline-card_meta-box {
    display: none;
  }
  .ag-timeline-card_point-box,
  .ag-timeline_item:nth-child(2n) .ag-timeline-card_point-box {
    margin: 0 0 0 8px;
  }
  .ag-timeline-card_point {
    height: 40px;
    line-height: 40px;
  }
}

.ag-timeline-card_button-container {
  text-align: center;
  margin-top: 20px; 
}

.ag-timeline-card_button {
  display: inline-block;
  padding: 10px 20px;
  background-color: #2E5A7A;
  color: white;
  text-decoration: none;
  border-radius: 5px;
}

.ag-timeline-card_button:hover {
  background-color: #2E5A7A;
}

/* Estilos para las tarjetas */
#discover-cards {
  padding: 0 15px;
  background-color: transparent;
}

.discover-title {
  text-align: center;
  margin-bottom: 2rem; /* Space below title */
  font-family: 'Montserrat', sans-serif;
}

.discover-title h2 {
  font-size: 2rem; /* Match crema-text-container h2 */
  color: #ffffff; 
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
  .discover-title h2 {
    font-size: 1.5rem; /* Match crema-text-container h2 on mobile */
  }
}

.abou-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Animación de rotación tarjetas de discover */
@keyframes rotate-once {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

.all-card {
  width: 200px;
  height: 250px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d; 
}

.all-card.rotate {
  animation: rotate-once 1s ease-in-out forwards; /* gira 1 vez en 1 segundo */
}

.all-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.all-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.top-half {
  height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.top-half img {
  max-width: 120px; 
  max-height: 120px; 
  object-fit: contain; /* Ensures the image scales without distortion */
}

.btm-half {
  height: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #fff;
  text-align: center;
  background: rgba(60, 79, 102); /* estas tres lineas se encargan de estilo inferior de tarjetas */
  backdrop-filter: blur(10px);          
  border-top: 1px solid rgba(0, 0, 0, 0.1); 
}

.view-btn {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(45deg, #334457, #14181d);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.view-btn:hover {
  background-color: #0056b3;
}

/* Media queries */
@media (max-width: 768px) {
  .all-card {
    width: 150px;
    height: 200px;
  }
  .top-half img {
    max-width: 90px; /* Adjusted for smaller screens */
    max-height: 90px; 
  }
}

footer.footer {
  background-image: url('https://static.igem.wiki/teams/5905/footer/output-onlinepngtools.webp');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #fff; /* Ensure text is readable */
  padding: 40px 20px;
  text-align: center;
  position: relative;
  z-index: 1;
}

html, body {
  overflow-x: hidden !important;
}