/* ===== Global Styles ===== */
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Century Gothic", "AppleGothic", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
  color: white;
  background: linear-gradient(to bottom, rgba(9, 9, 121, 0.7), rgba(0, 0, 0, 0.7));
  position: relative; /* Needed for ::before */
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('../images/history-background.png') repeat;
  background-size: auto;
  opacity: 0.05; /* Adjust visibility */
  z-index: -1;   /* Push behind all content */
  pointer-events: none; /* Prevent interference */
}

/* Hide Scrollbar */
html {
  scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {
  width: 0px; /* Chrome, Edge, Safari */
}

/* ===== Typography ===== */
h1, h2, h3, p {
  margin: 0;
  padding: 0;
  text-align: center;
}

/* ===== Scroll Indicator ===== */
#scroll-indicator {
  position: fixed;
  top: 15%;
  right: 20px;
  width: 10px;
  height: 70%;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  z-index: 999;
}
#scroll-indicator .indicator {
  width: 100%;
  background: #00bcd4;
  border-radius: 5px;
  transition: height 0.3s ease;
}

/* ===== Hero Section ===== */
.hero-section {
  position: relative;
  width: 100%;
  height: calc(85vh); /* 👈 Set the height you want the div to be */
  overflow: hidden;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures the video covers the div without distortion */
  z-index: 0;
}

/* ===== Overlay Text ===== */
.overlay-aim {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  animation: fadeIn 1.5s ease-out forwards;
  text-align: center;
  color: #fff;
  z-index: 112;
}
.aim {
  font-size: 4rem;
  font-weight: bold;
  letter-spacing: 2px;
}
.underline {
  width: 50%;
  height: 4px;
  background: rgb(76, 136, 183);
  margin: 10px auto;
}
.tagline {
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.background-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center;
  z-index: -1;
  opacity: 1;
  pointer-events: none;
  background-color: transparent; /* For areas around the video */
}

/* ===== Fade Animation ===== */
@keyframes fadeIn {
  0% { opacity: 0; transform: translate(-50%, -60%); }
  100% { opacity: 1; transform: translate(-50%, -50%); }
}

/* ===== Services Section ===== */
.services-introduction {
  padding: 40px;
  background: linear-gradient(to top, rgba(45,45,45, 0.7), rgba(25, 25, 25, 0.9));
  color: white;
  box-shadow: 0 -5px 5px 5px rgba(25, 25, 25, 0.9);
  text-align: center;
  z-index: 5;
  font-size: 1.25em;
}

.services-introduction h2 {
  font-size: 3.75rem;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.services-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 25px 10px 0;
  position: relative;
}

.service-item {
  flex: 1 1 calc(33.33% - 40px);
  max-width: calc(33.33% - 40px);
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: radial-gradient(rgba(45,45,45, 0.7), rgba(25, 25, 25, 0.9));
  color: white;
  text-align: center;
  border-radius: 15px;
  box-shadow: 0 10px 20px 10px rgba(0, 0, 0, 0.4);
}

@media (max-width:1486px) {
    .service-item h1 {
      height: 25%;
  }
}

.service-item ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;
  text-align: center;
}

.service-item img {
  width: 100%;
  max-height: 60%;
  border-radius: 15px;
  object-fit: cover;
}

.service-item h1 {
  font-size: 2.5em;
  margin-bottom: 0 auto;
}

.card, .video-thumbnail-container {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: white;
  color: #333;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card {
  position: relative;
  overflow: hidden;
}

.video-thumbnail-container {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000; /* fallback background */
  object-fit: cover;
}

.card:hover,
.video-thumbnail-container:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: scale(1.03);
}

.card img,
.video-thumbnail-container video {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.video-thumbnail-container video:hover {
  transform: scale(1.02);
}

.video-overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.6);
  color: white;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  user-select: none;
  pointer-events: none;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.6); /* semi-transparent black */
  color: white;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  user-select: none;
  pointer-events: none;
}


.view-more-btn {
  background: linear-gradient(135deg, rgba(0, 188, 212, 0.3), rgba(0, 128, 128, 0.3));
  color: white;
  border: none;
  padding: 10px 20px;
  margin-top: 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  text-transform: uppercase;
  font-size: 24px;
}

.view-more-btn:hover {
  background-color: #00ffff;
  color: black;
  transform: scale(1.1);
}

/* ===== Modal Popup ===== */
.popup {
  position: fixed;       /* Fix it relative to viewport */
  top: 0; left: 0;
  width: 100vw;          /* Full viewport width */
  height: 100vh;         /* Full viewport height */
  background: rgba(0, 0, 0, 0.9); /* Dark overlay */
  display: flex;         /* Flexbox to center */
  justify-content: center;
  align-items: center;
  z-index: 9998;
  overflow-y: auto;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

.popup-content {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.6);
  max-width: 1200px;
  width: 90vw;
  max-height: 80vh; /* or any height less than the full screen */
  overflow-y: auto;
  padding: 1rem;
  position: relative;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.popup-content-title {
  color: #333;
}

.popup:not(.hides) .popup-content{
  opacity: 1;
  pointer-events: auto;
}

.close-popup {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 9998;
  transition: all 0.3s ease;
}

.close-popup:hover {
  transform: scale(1.1);
  background: rgba(255, 80, 80, 0.25); /* soft red tint */
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.promo-card {
  cursor: pointer;
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem;
  max-width: 300px;
  transition: transform 0.2s;
}

.promo-card:hover {
  transform: scale(1.03);
}

.text-popup {
  position: fixed; /* or absolute */
  z-index: 10000;  /* something higher than the grid */
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.text-modal-content {
  background: white;
  padding: 2rem;
  max-width: 600px;
  border-radius: 10px;
  color: black;
}

#text-modal-thumbnail {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  border-radius: 5px 5px 5px 5px;
}

.text-popup.hides {
  display: none;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); /* Slightly smaller min width for better fit on narrow screens */
  gap: 1.5rem;
  margin-top: 1rem;
}

/* Shared fullscreen modal for playing full video */
#video-modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
}

#video-modal video {
  width: 90%;
  max-height: 85%;
  border-radius: 8px;
  background: black;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* Close button on full video modal */
.close-video-modal,
.close-text-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  user-select: none;
  transition: color 0.3s ease;background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 9999;
  transition: all 0.3s ease;
}
.close-video-modal:hover,
.close-text-modal:hover {
  transform: scale(1.1);
  background: rgba(255, 80, 80, 0.25); /* soft red tint */
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

/* Utility to hide elements */
.hides {
  display: none !important;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .popup-content {
    padding: 1rem;
    width: 95vw;
    max-height: 90vh;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* Results Section */

.extras-section {
  margin: 50px 0;
  width: 100%;
  color: #eee;
}

.extras-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px 20px;
  gap: 180px;
  margin: 0 auto;
}

.extras-section h1 {
  padding: 40px 20px;
  font-size: 3.75rem;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
  margin: 0;
  color: #fff;
}

.extras-card {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  gap: 80px;
  width: 100%;
  max-width: calc(80vw);
  flex-wrap: nowrap;
  transition: flex-direction 0.3s ease;
}

.extras-card img {
  width: 100%;
  max-width: 650px; 
  height: auto;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  object-fit: cover;
}

.card-text {
  max-width: 600px;
}

.card-text h2 {
  font-size: 2.25rem;
  margin-bottom: 15px;
  color: #fff;
}

.card-text p {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #ddd;
  text-align: left;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .extras-card,
  .extras-card.reverse {
    flex-direction: column;
    gap: 30px;
    max-width: 90%;
  }

  .extras-card img {
    width: 100%;
    max-width: 400px;
  }

  .card-text {
    max-width: 100%;
    text-align: center;
  }

  .card-text h2 {
    font-size: 1.75rem;
  }

  .card-text p {
    font-size: 1rem;
  }
}

/* ===== CTA Section ===== */
.cta-section {
  position: relative;
  background: radial-gradient(rgba(0, 0, 0, 0.8), rgba(19, 19, 176, 0.8));
  color: white;
  text-align: center;
  padding: 60px 20px;
  margin: 50px 10px;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.cta-section h2 {
  font-size: 2.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);
}

.cta-section p {
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 40px;
}

.cta-section button {
  background-color: white;
  color: #008080;
  border: 2px solid white;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, transform 0.2s;
}
.cta-section button:hover {
  background-color: #008080;
  color: white;
  transform: scale(1.05);
}

.cta-section .highlight {
  color: #bef9ff;
  font-weight: bold;
}

/* ---------- Responsive Styles ---------- */

/* Tablets and small desktops */
@media screen and (max-width: 1024px) {
  .aim {
    font-size: 3rem;
  }

  .overlay-aim h2 {
    font-size: 1.5rem;
  }

  .services-container {
    flex-wrap: wrap;
    gap: 20px;
  }

  .service-item {
    flex: 1 1 45%;
    max-width: 45%;
    min-height: 350px;
  }

  .extras-showcase {
    gap: 100px;
  }

  .cta-section h2 {
    font-size: 2.3rem;
  }

  .cta-section p {
    font-size: 1.1rem;
  }
}

/* Tablets and large phones */
@media screen and (max-width: 768px) {
  .aim {
    font-size: 2.25rem;
    letter-spacing: 1.2px;
  }

  .tagline {
    font-size: 0.95rem;
  }

  .hero-section {
    height: 60vh;
  }

  .overlay-aim {
    padding: 0 10px;
  }

  .services-introduction h2 {
    font-size: 2.5rem;
  }

  .services-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .service-item {
    max-width: 90%;
    min-height: auto;
    padding: 15px;
  }

  .service-item h1 {
    font-size: 2rem;
  }

  .card-text {
    max-width: 100%;
    text-align: center;
  }

  .card-text h2 {
    font-size: 1.5rem;
  }

  .card-text p {
    font-size: 1rem;
  }

  .cta-section {
    padding: 40px 15px;
    margin: 40px 10px;
  }

  .cta-section h2 {
    font-size: 2rem;
  }

  .cta-section p {
    font-size: 1rem;
  }

  .cta-section button {
    padding: 12px 24px;
    font-size: 1rem;
  }

  #scroll-indicator {
    display: none;
  }
}

/* Flip direction for even-numbered cards */
.extras-card:nth-child(even) {
  display: flex;
  flex-direction: row-reverse;
}

/* Responsive zigzag stack */
@media (max-width: 900px) {
  .extras-card,
  .extras-card:nth-child(even) {
    flex-direction: column !important;
    gap: 30px;
    max-width: 90%;
    text-align: center;
  }

  .card-text {
    text-align: center;
  }
}

/* Small phones and narrow screens */
@media screen and (max-width: 480px) {
  .aim {
    font-size: 1.75rem;
    letter-spacing: 1px;
  }

  .hero-section {
    height: calc(25vh + 70px);
  }

  .tagline {
    font-size: 0.85rem;
  }

  .overlay-aim h2 {
    font-size: 1.2rem;
  }

  .underline {
    width: 70%;
    height: 3px;
  }

  .services-introduction h2 {
    font-size: 1.75rem;
  }

  .service-item h1 {
    font-size: 1.5rem;
  }

  .view-more-btn {
    font-size: 1rem;
    padding: 8px 16px;
  }

  .extras-section h1 {
    font-size: 2rem;
  }

  .cta-section h2 {
    font-size: 1.6rem;
  }

  .cta-section p {
    font-size: 0.9rem;
  }

  .cta-section button {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .popup-content {
    width: 95vw;
    padding: 0.75rem;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .close-popup,
  .close-video-modal {
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
  }
}
