.container {
  max-width: 67.5rem; /* ~1080px if root font size is 16px */
}
.intro-container {
  max-width: 100%;
}

/* Service tier card styling */
.tier-card {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0px 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  width: 100%;
  position: relative;
  left: 0;
  cursor: pointer;
}
.tier-card-header {
  display: flex;
  font-size: 1.1rem;
  font-weight: bold;
  background-color: #fa8c0a;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
  justify-content: space-between;
  align-items: center;
}
.toggle-icon {
  font-size: 1.25rem;
  transform:scale(1.5,0.75); /* stretch the width */
}
.tier-card-content {
  max-height: 0; /* Start fully collapsed */
  overflow: hidden; /* Prevent content from being visible initially */
  transition: max-height 0.4s ease-in-out, padding 0.5s ease-in-out;
  padding: 0 15px; /* Padding removed initially to prevent jump */
  border-radius: 0.75rem;
  box-shadow: 0px 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}
th,
td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #cccccc;
}
th {
  background-color: #fae2b8;
  color: #333333;
  font-weight: bold;
}
tr {
  font-size: 0.75rem;
}
tr:nth-child(even) {
  background-color: #dddddd;
}
tr:nth-child(odd) {
  background-color: #eeeeee;
}

.grid-container {
  width: 100%; /* Takes up full width */
  max-width: 1920px; /* Ensures it doesn't exceed 1920px */
  margin: 0 auto; /* Centers the container */
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1920px;
  padding: 1rem;
  margin: 0 auto; /* Ensures grid itself is centered */
  justify-items: center; /* Ensures individual items are centered */
}

.flip-card {
  position: relative;
  background-color: transparent;
  width: 600px;
  height: 512px;
  perspective: 1000px;
  padding-top: 20px;
  cursor: pointer;
}
.flip-card-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flip-card.flip .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: 1.1rem;
  box-sizing: border-box;
  border-radius: 12px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-card-front {
  background-color: #ffffff;
  padding: 12px;
}
.flip-card-back {
  background-color: #ffffff;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.flip-card-back img {
  width: 100%;
  height: auto;
  object-fit: fill;
}

.label {
  font-weight: bold;
}
.label-icon {
  font-size: 1.5rem;
}

/* Expand button on card back */
.expand-button {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(250, 140, 10, 0.4);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #ffffff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  z-index: 5;
}
.expand-button:hover {
  background-color: rgba(250, 140, 10, 0.8);
  scale: 1.5;
}

/* Card Action Buttons */
.card-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}
.card-actions button,
.card-actions a {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.5s ease;
  background-color: #444444;
  color: #999999;
}
/* When the card is activated (flipped and ready), buttons become fully visible and take on the correct colour */
.flip-card.activated .card-actions button,
.flip-card.activated .card-actions a {
  opacity: 1;
  background-color: #fa8c0a;
  color: #ffffff;
  transition: background 0.3s ease-in-out;
}
.flip-card.activated .card-actions button:hover,
.flip-card.activated .card-actions a:hover {
  background-color: #e67c00;
}

.view-animation {
}

.coming-soon-overlay {
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  height: calc(100% - 20px);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  text-align: center;
  z-index: 10;
  pointer-events: all; /* Blocks interaction with the card below */
  font-size: 8rem;
  font-weight: bolder;
  color: #fa8c0a;
}

/* Modal Overlay for animation and image */
.modal,
#imageModal,
#animationModal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
}
.modal-content,
#imageModal .modal-content,
#animationModal .modal-content {
  position: relative;
  margin: 10%;
  margin-top: 10rem;
  padding: 5px;
  background-color: transparent;
  border-radius: 10px;
}
#imageModal .modal-content {
  max-width: 80%;
}
#animationModal .modal-content {
  max-width: 90%;
}
.modal-content img,
#imageModal .modal-content img {
  width: 100%;
  height: auto;
}
.close-button {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 4rem;
  color: #ff0000;
  cursor: pointer;
  z-index: 1001; /* Ensure it's above other elements */
  pointer-events: auto; /* Ensure it can be clicked */
}
.close-button:hover {
  scale: 1.5;
}

/* Let's remove the Links Styling for text links only */
a:not(:has(img)) {
  color: inherit;
  text-decoration: none;
}
a:not(:has(img)):hover {
  color: #999999;
  box-shadow: none;
}
a:not(:has(img)):focus {
  outline: none;
}

.video-controls {
  position: fixed; /* Fixed relative to the viewport */
  bottom: 20px; /* 20px from the bottom */
  left: 50%; /* Center horizontally */
  transform: translateX(-50%); /* Adjust so it’s exactly centered */
  display: flex; /* Layout the buttons in a row */
  gap: 0.75rem;
  z-index: 20; /* Ensure controls appear above the modal/video */
}
.video-controls button {
  background-color: rgba(255, 255, 255, 0.4);
  color: #fa8c0a;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  padding: 0.75rem;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-controls button:hover {
  background-color: #fa8c0a;
  color: #ffffff;
}
#speedToggleButton span {
  font-size: 1.5rem;
}

/* Image is 1200x1024, card is 600x512, so when screen is too small for the card, let's flex the card width */
@media screen and (max-width: 640px) {
  html {
    font-size: 14px;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 5px;
  }
  .flip-card {
    width: 100%;
    min-width: 300px;
  }
  .coming-soon-overlay {
    font-size: 6rem;
  }
}

/* Dark Mode Styling */
@media (prefers-color-scheme: dark) {
  .intro-container,
  .flip-card-front,
  .flip-card-back {
    background: #333333; /* Darker background for boxes */
    box-shadow: 0px 4px 0.625rem rgba(0, 0, 0, 0.6),
      0px 8px 2rem rgba(0, 0, 0, 0.4); /* Subtle shadow */
  }

  .tier-card {
    background: #666666;
  }
  th {
    background-color: #333333;
    color: #fae2b8;
    font-weight: bold;
  }
  tr:nth-child(even) {
    background-color: #444444;
  }
  tr:nth-child(odd) {
    background-color: #555555;
  }
}
