
html {
  font-size: 16px;
}

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(
    -45deg,
    rgb(137, 58, 150),
    rgba(0, 119, 255, 0.7),
    rgb(137, 58, 150)
  );
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

/* ================================================================== */
/* Main content GRID SYSTEM*/
/* ================================================================== */
main {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1 0 auto;
  margin-top: 70px;  /* IMPORTANT for the fixed header */
  overflow: hidden;
}

/* Add these styles to each section to control spacing */
#team-frontshow,
#leishmania-info,
#team-news-container,
#twitter-zone {
  width: 100%;
  padding: 2rem 0;
}

/* ================================================================== */
/* Team-frontshow */
/* ================================================================== */
#team-frontshow {  /* General box */
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding-top: 0;
  padding-bottom: 0;
}

/* Start with the image*/
#carousel-container {
  position: relative;
  margin: auto;
  overflow: hidden;
}

#carousel-slide {
  display:flex;
  transition: transform 0.5s ease-in-out;
  width: 100%;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

.carousel-slide-img {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 16/9;  /* fixed aspect ratio */
  overflow: hidden;
  position: relative; /* Add this - makes this the positioning reference */
}

.carousel-slide-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* Ensures the image covers the area without distortion */
  border-radius: 0;
}

.carousel-button {
  position: absolute;
  /* top: 50%; */
  /* transform: translateY(-50%); */
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 1;
}

.carousel-dots {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 3;
}

.dot {
  width: 12px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s;
  border: 1px solid grey;
}

.dot.active {
  background-color: white;
  transform: scale(1.2);
}

/* Now the text in the image */
#team-frontshow-text {
  position: absolute;
  bottom: 40px;
  left: 20px;
  background-color: rgba(137, 58, 150, 0.8); /* Purple with transparency */
  color: white;
  padding: 15px;
  max-width: 700px;
  border-radius: 10px;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#team-frontshow-text-header h3 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

#team-frontshow-text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

#team-frontshow-button {
  display: flex;
  margin-left: auto; /* Push button to right edge */
  color: rgb(255, 255, 255);
  background-color: rgb(154, 113, 38);
  padding: 0.4rem;
  border-radius: 10px;
  font-size: 0.75rem;
  box-shadow: none;
  border: none;
}

#team-frontshow-button:hover {
  background-color: rgb(191, 12, 204);
  cursor: pointer;
}

/* ================================================================== */
/* Leish info cards */
/* ================================================================== */
#leishmania-info {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 0;
  overflow: hidden;
}

#leish-info-container {
  width: 70%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
}

.leish-card-carousel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
}

#leish-card-container {
  width: 80%;
  min-height: 450px;
  perspective: 1000px;
}

.leish-card {
  background-color: white;
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.6s, opacity 0.4s;
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  top: 0;
  left: 0;
  opacity: 0;
  display: flex;
  flex-direction: column;
}

.leish-card.active {
  opacity: 1;
  transform: translateZ(0);
  z-index: 5;
}

.leish-card.prev {
  opacity: 0.7;
  /*transform: translateX(-50%) scale(0.9) rotateY(10deg);*/
  transform: translateX(-45%) scale(0.9) rotateY(10deg); /* 45% avoids pushing too far left */
  z-index: 4;
}

.leish-card.next {
  opacity: 0.7;
  transform: translateX(45%) scale(0.9) rotateY(-10deg); /* 45% avoids pushing too far right */
  z-index: 4;
}

.leish-card-title {
  color: rgb(137, 58, 150);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  border-bottom: 2px solid rgb(137, 58, 150);
  padding-bottom: 0.5rem;
}

.leish-card-img {
  width: 100%;
  height: 200px;
  margin-bottom: 1rem;
  border-radius: 10px;
  overflow: hidden;
}

.leish-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leish-card-description {
  flex-grow: 1;
  line-height: 1.5;
  color: #444;
}

.card-dots {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.card-dot {
  width: 10px;
  height: 10px;
  background-color: rgba(137, 58, 150, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
}

.card-dot.active {
  background-color: rgb(137, 58, 150);
  transform: scale(1.2);
}

/* ================================================================== */
/* World Map Section */
/* ================================================================== */
#world-map-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 0;
  background: linear-gradient(
    0deg,
    rgb(137, 58, 150),
    rgba(0, 119, 255, 0.7)
  );
  position: relative;
}

.world-map-header {
  text-align: center;
  margin-bottom: 2rem;
  width: 80%;
  max-width: 800px;
}

.world-map-header h2 {
  color: white;
  font-size: 2.2rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  font-weight: 700;
  letter-spacing: 1px;
}

.world-map-header h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: white;
  border-radius: 4px;
}

.world-map-header p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 1rem auto 0;
  line-height: 1.6;
}

.world-map-container {
  width: 80%;
  max-width: 1200px;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.selectors-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1.25rem;
  background-color: #f8f8f8;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.selector-group {
  display: flex;
  align-items: center;
}

.selector-group label {
  margin-right: 1rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.year-selector, .case-type-selector {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 1rem;
  color: #333;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  min-width: 120px;
}

.year-selector:hover, .year-selector:focus,
.case-type-selector:hover, .case-type-selector:focus {
  border-color: rgb(137, 58, 150);
  box-shadow: 0 0 0 2px rgba(137, 58, 150, 0.2);
}

.world-map-plot {
  width: 100%;
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
}

/* Media queries for world map section */
@media only screen and (max-width: 768px) {
  .world-map-container {
    width: 95%;
    padding: 1rem;
  }

  .world-map-header h2 {
    font-size: 1.8rem;
  }

  .world-map-header p {
    font-size: 1rem;
  }

  .world-map-plot {
    height: 400px;
  }
}

@media only screen and (max-width: 480px) {
  .world-map-container {
    width: 100%;
    border-radius: 0;
  }

  .world-map-header h2 {
    font-size: 1.6rem;
  }

  .world-map-header p {
    font-size: 0.9rem;
  }

  .selectors-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .selector-group {
    width: 100%;
    margin-bottom: 0.75rem;
  }

  .selector-group:last-child {
    margin-bottom: 0;
  }

  .selector-group label {
    margin-bottom: 0.5rem;
  }

  .world-map-plot {
    height: 300px;
  }
}

/* ================================================================== */
/* Social Media Updates Section */
/* ================================================================== */
#social-updates {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem 0;
  background: linear-gradient(
    180deg,
    rgb(137, 58, 150),
    rgba(0, 119, 255, 0.7)
  );
  position: relative;
}

.social-header {
  text-align: center;
  margin-bottom: 3rem;
  width: 80%;
  max-width: 800px;
}

.social-header h2 {
  color: white;
  font-size: 2.2rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  font-weight: 700;
  letter-spacing: 1px;
}

.social-header h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: white;
  border-radius: 4px;
}

.social-header p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 1rem auto 0;
  line-height: 1.6;
}

.social-tabs-container {
  width: 70%;
  max-width: 1200px;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.social-tabs {
  display: flex;
  background-color: #f8f8f8;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.social-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 1.2rem 0.8rem;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  outline: none;
  border-bottom: 3px solid transparent;
}

.social-tab-btn img {
  height: 28px;
  width: auto;
  opacity: 0.8;
  transition: all 0.25s;
  filter: grayscale(30%);
}

.social-tab-btn:hover {
  background-color: rgba(0, 0, 0, 0.03);
  color: rgb(137, 58, 150);
}

.social-tab-btn:hover img {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.05);
}

.social-tab-btn.active {
  background-color: white;
  color: rgb(137, 58, 150);
  font-weight: 600;
  border-bottom: 3px solid rgb(137, 58, 150);
}

.social-tab-btn.active img {
  opacity: 1;
  filter: grayscale(0%);
}

.social-tab-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(137, 58, 150, 0.3);
  z-index: 1;
}

.social-content {
  position: relative;
  min-height: 800px;
}

.social-panel {
  display: none;
  padding: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.social-panel.active {
  display: block;
  opacity: 1;
}

/* Loading indicator */
.loading-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid rgba(137, 58, 150, 0.2);
  border-radius: 50%;
  border-top-color: rgb(137, 58, 150);
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.social-panel.loading .loading-spinner {
  display: block;
}

/* Style for the container of bsky-embed */
.bsky-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  background-color: #fff;
  width: 100%;
  height: 100%;
  min-height: 600px;
  overflow: hidden;
}

/* Style for the embed element specifically */
/*noinspection CssInvalidHtmlTagReference*/
bsky-embed {
  width: 100% !important;
  height: 100% !important;
  min-height: 600px;
  border: none;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}

/* Additional override for embedded content */
/*noinspection CssInvalidHtmlTagReference*/
.social-panel.active bsky-embed {
  width: 100% !important;
  height: auto !important;
  min-height: 600px;
}

/* ================================================================== */
/* Media queries */
/* ================================================================== */

/* Desktop WIDE */
/* ================================================================== */
@media only screen and (min-width: 1025px) {
  #team-frontshow {
    height: 600px;
  }

  #team-frontshow-text {
    font-size: 1.5rem;
    max-width: min(700px, 40%); /* Responsive max-width */
    bottom: 40px; /* Keep consistent with mobile */
    left: 40px;
  }

  #carousel-container {
    height: 100%;
    width: 100%;
  }

  .carousel-slide-img {
    height: 100%;
  }

  .carousel-slide-img img {
    object-position: center 20%;
    inset(0 0 40% 0);
  }

  #leish-card-container {
    min-width: 400px;
    max-width: 600px;
    min-height: 600px;
  }
}

/* Tablet portrait mode */
/* ================================================================== */
@media only screen and (min-width: 481px) and (max-width: 775px) {

  /*For team images*/
  #team-frontshow {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* Increase gap for better spacing on smaller tablets */
    width: 100%;
  }

  #carousel-container {
    width: 100%; /* Adjust carousel size for tablet screens */
    margin-bottom: 1rem;

  }

  #team-frontshow-text {
    font-size: 1rem;
    max-width: 600px;
    text-align: center; /* Center-align text for better presentation */
  }

  /*For the leishmania info cards*/
  #leish-info-container {
    width: 90%;
  }

  .leish-card-title {
    font-size: 1.3rem;
  }
}

@media only screen and (max-width: 630px) {
  #team-frontshow-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 700px;
  }

  #team-frontshow-text-header h3 {
    font-size: 1rem;
  }

  #team-frontshow-text p {
    font-size: 0.8rem;
  }

  .leish-card-title {
    font-size: 1.2rem;
  }

  .leish-card-description {
    font-size: 0.8rem;
    overflow-y: auto;
    max-height: 200px;
    padding-right: 10px;
  }

  #leish-info-container{
    width: 100%;
  }

  /* Social media section responsive styles */
  .social-tabs-container {
    width: 95%;
    border-radius: 12px;
  }

  .social-header h2 {
    font-size: 1.8rem;
  }

  .social-header p {
    font-size: 1rem;
  }

  .social-tab-btn {
    padding: 1rem 0.5rem;
  }

  .social-tab-btn img {
    height: 24px;
  }

  .social-content {
    min-height: 600px;
  }

  .bsky-container {
    min-height: 500px;
  }

  /*noinspection ALL*/
  bsky-embed {
    min-height: 500px;
  }
}

/* Smartphones */
/* ================================================================== */
@media only screen and (max-width: 480px) {
  #team-frontshow {
    flex-direction: column;
    align-items: center;
    gap: 1rem; /* Reduced gap for compact spacing */
  }

  #carousel-container {
    width: 100%; /* Full width for small mobile screens */
  }

  #team-frontshow-text {
    position: relative;
    text-align: center;
    padding: 10px;
    max-width: 100%;
    bottom: -5px; /* Increased negative value to move text further down */
    top: 0;
    background-color: rgba(137, 58, 150, 0.95); /* Increase opacity for better readability */
  }

  #team-frontshow-button {
    font-size: 0.7rem; /* Smaller button on mobile */
    padding: 0.3rem;
    border-radius: 8px;
  }

  /* Social media section responsive styles for smartphones */
  #social-updates {
    padding: 2rem 0;
  }

  .social-header {
    width: 90%;
    margin-bottom: 2rem;
  }

  .social-header h2 {
    font-size: 1.6rem;
  }

  .social-header p {
    font-size: 0.9rem;
  }

  .social-tabs-container {
    width: 100%;
    border-radius: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }

  .social-tabs {
    flex-wrap: wrap;
  }

  .social-tab-btn {
    flex: 1 0 50%; /* Two buttons per row */
    padding: 0.8rem 0.4rem;
  }

  .social-tab-btn img {
    height: 20px;
  }

  .social-content {
    min-height: 500px;
  }

  .bsky-container {
    min-height: 400px;
  }

  /*noinspection ALL*/
  bsky-embed {
    min-height: 400px;
  }

  /* Add a class for screen reader only text */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
