/* CSS Variables */
:root {
  --color-primary: #023d58;
  --color-primary-hover: #003a55;
  --color-secondary: #002536;
  --color-background: #fafafa;
  --color-text: #333;
  --color-light: #fff;
  --color-muted: #ddd;
  --font-family: 'Arial, sans-serif';
  --transition-speed: 0.3s;
}

/* GENERAL RESET & BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
}

body {
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.5;
}

/* HERO SECTION */
.hero {
  position: relative;
  text-align: center;
  background-color: #f3f9fc;
  padding: 2rem 1rem;
  margin-bottom: 1rem;
  animation: gradientAnimation 10s infinite;
}

.hero-image {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  z-index: -10;
}

.hero-title {
  font-size: 2rem;
  margin-top: 1rem;
  color: #000; /* Changed from var(--color-light) to black */
}

.hero-subtitle {
  font-size: 1rem;
  color: #000; /* Changed from var(--color-light) to black */
  margin-top: 0.5rem;
}

/* Background Gradient Animation */
@keyframes gradientAnimation {
  0% {
    background-color: #f3f9fc;
  }
  50% {
    background-color: #e0f7fa;
  }
  100% {
    background-color: #f3f9fc;
  }
}

/* TAB NAVIGATION */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  background-color: var(--color-primary);
  padding: 0.5rem;
  justify-content: center;
}

.tab-button {
  background-color: transparent;
  border: none;
  color: var(--color-light);
  padding: 0.75rem 1rem;
  margin: 0.25rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color var(--transition-speed) ease;
}

.tab-button:hover {
  background-color: var(--color-primary-hover);
}

.tab-button.active {
  background-color: var(--color-secondary);
  color: var(--color-light); /* Ensure text contrasts with button background */
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .tab-nav {
    display: none;
    flex-direction: column;
    background-color: var(--color-primary);
    position: absolute;
    top: 60px;
    width: 100%;
    left: 0;
  }

  .tab-nav.active {
    display: flex;
    z-index: 20; /* Ensures the nav menu appears above other elements */
  }

  .burger {
    display: block;
  }
}

/* MAIN CONTENT */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 100px; /* Height of the footer */
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: slideIn 0.5s ease-out forwards;
}

.tab-content-inner {
  background: var(--color-light);
  padding: 2rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  box-shadow: 0px 2px 5px rgba(0,0,0,0.1);
}

/* SECTION ICONS */
.section-icon {
  width: 50px;
  height: 50px;
  float: right;
  margin: 0 0 1rem 1rem;
}

/* ACCORDIONS */
.accordion {
  margin-bottom: 1rem;
  border: 1px solid var(--color-muted);
  border-radius: 4px;
}

.accordion-button {
  background-color: #f7f7f7;
  cursor: pointer;
  padding: 1rem;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 1rem;
}

.accordion-button:hover {
  background-color: #e9e9e9;
}

.accordion-content {
  padding: 0 1rem;
  display: none;
  background-color: var(--color-light);
}

.accordion-content p {
  padding: 1rem 0;
}

/* MODAL */
.modal {
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: none;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--color-light);
  width: 90%;
  max-width: 600px;
  padding: 2rem;
  position: relative;
  border-radius: 4px;
}

.modal-close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--color-text);
}

/* Modal Active State */
.modal.active {
  display: flex;
}

/* PROGRESS TRACKER */
.progress-tracker {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-muted);
  z-index: 1000;
}

.progress-bar {
  height: 100%;
  background: var(--color-primary);
  width: 0;
  transition: width var(--transition-speed) ease;
}

/* CARDS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.info-card {
  background: var(--color-light);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.info-card:hover {
  transform: translateY(-5px);
}

/* TIMELINE */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background: var(--color-primary);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
}

.timeline-item {
  padding: 1rem 2rem;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 50%;
  top: 50%;
  right: -10px;
  margin-top: -10px;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-item:nth-child(even)::after {
  left: -10px;
}

/* ENHANCED MODAL */
.modal-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.5rem;
  border: 1px solid var(--color-muted);
  border-radius: 4px;
  margin-top: 0.25rem;
}

.submit-button {
  background: var(--color-primary);
  color: var(--color-light);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
}

.submit-button:hover {
  background: var(--color-primary-hover);
}

/* BURGER MENU */
.burger {
  display: none; /* Changed from block to none */
  cursor: pointer;
  width: 25px;
  height: 20px;
}

/* MEDIA QUERY TO TOGGLE BURGER DISPLAY */
@media (max-width: 768px) {
  .burger {
    display: block;
  }

  .tab-nav.active {
    z-index: 20; /* Ensures the nav menu appears above other elements */
  }
}

/* TOOLTIP STYLES */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition-speed);
  pointer-events: none;
  font-size: 0.875rem;
}

.tooltip:hover::after,
.tooltip:focus::after {
  opacity: 1;
}

/* FOCUS STATES FOR ACCESSIBILITY */
.button:focus,
.tab-button:focus,
.modal-close-button:focus {
  outline: 2px dashed var(--color-secondary);
  outline-offset: 4px;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* VIDEO GALLERY */
.video-gallery {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 2rem auto;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: visible; /* Changed from hidden to allow buttons to show */
}

.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
}

.video-container iframe.active {
  display: block;
  z-index: 1; /* Ensure active video is above others */
}

.video-nav {
  position: absolute;
  bottom: -50px; /* Position below video container */
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.video-nav button {
  z-index: 2; /* Ensure buttons are clickable */
}

/* FIXED FOOTER */
.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-secondary); /* Changed to a darker background for better contrast */
  color: var(--color-light); /* Ensure text is readable against background */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.footer-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.footer-button {
  background: transparent;
  border: none;
  color: var(--color-light);
  cursor: pointer;
  font-size: 1rem;
  text-decoration: underline;
  padding: 0;
}

.footer-button:hover {
  color: var(--color-primary-hover);
}



@media (max-width: 768px) {
  .hero-image {
    position: static; 
    display: block;
    width: 100%;
    height: auto;
  }

  .hero {
    padding: 1rem 0.5rem; /* Slightly reduce padding on smaller screens */
  }

  .tab-nav {
    width: 100%;
  }
}


#safeguarding-game {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 1;
}

#safeguarding-game h2 {
  margin-bottom: 20px;
}

#safeguarding-game #wm-question {
  font-size: 1.1em;
  margin-bottom: 15px;
}

#safeguarding-game .wm-option {
  display: block;
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  background-color: #e7e7e7;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  text-align: left;
}

#safeguarding-game .wm-option:hover:not(:disabled) {
  background-color: #d4d4d4;
}

#safeguarding-game .wm-option:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

#safeguarding-game #wm-result {
  margin-top: 15px;
  font-weight: bold;
}

#safeguarding-game #wm-next-btn {
  padding: 10px 20px;
  margin-top: 15px;
  font-size: 1em;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: #4CAF50;
  color: white;
  transition: background-color 0.3s;
}

#safeguarding-game #wm-next-btn:hover {
  background-color: #45a049;
}

/* MILLIONAIRE GAME STYLES */
#safeguarding-game {
  background-image: url('./images/backdrop.webp'); /* Updated path */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

/* Play Game Button */
.play-game-btn {
    background: #4CAF50;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.play-game-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* Game Container Styles */
#safeguarding-game {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1000;
    background-image: url('./images/backdrop.webp'); /* Ensure background is set here too */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#safeguarding-game.maximized,
#safeguarding-game:fullscreen {
    background-image: url('./images/backdrop.webp'); /* Consistent background */
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wm-title {
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  margin-bottom: 2rem;
  font-size: 2em;
  background-color: #002536;

}

.wm-question-container {
  width: 90%;
  max-width: 90%;
  top: 40%;
  background: rgba(2, 61, 88, 0.95);
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  color: #fff;
  margin: 2rem auto;
  margin-bottom: 10%;
  transform: translateX(-100%);
  animation: slideInQuestion 0.5s forwards;
  position: relative;
  z-index: 5;
  text-align: center; /* Center the text */
  font-size: 2em; /* Double the font size */
}

.wm-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  position: relative;
  z-index: 10;
}

.wm-option {
  opacity: 0;
  background: linear-gradient(135deg, #034f75, #023d58);
  color: #fff;
  padding: 1rem;
  border: 2px solid #0596d4;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1em;
  transition: all 0.3s ease, background-color 0.5s ease;
  animation: fadeIn 0.5s ease forwards;
  position: relative;
  z-index: 15;
  min-height: 60px;
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.wm-option.correct-answer {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border-color: #27ae60;
  transform: scale(1.05);
}

.wm-option.wrong-answer {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border-color: #c0392b;
  opacity: 0.7;
}

.wm-option:hover {
  background: linear-gradient(135deg, #0596d4, #034f75);
  transform: scale(1.02);
}

.wm-score {
  color: #ffd700;
  font-size: 1.5em;
  text-align: center;
  margin: 1rem 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  background-color: #002536;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.wm-try-again {
  background: #ffd700;
  color: #000;
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1.2em;
  cursor: pointer;
  margin-top: 2rem;
  transition: all 0.3s ease;
}

.wm-try-again:hover {
  background: #ffed4a;
  transform: scale(1.05);
}

/* Try Again Button Visibility */
.wm-try-again.hidden {
  display: none;
}

.wm-try-again {
  display: block;
}

@keyframes slideInQuestion {
  to {
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure proper display in fullscreen */
:fullscreen #safeguarding-game {
    display: block;
    background: #fff;
    width: 100vw;
    height: 100vh;
}

/* GAME CONTAINER ACTIVE STATE */
#wg-game-container.active {
  display: block;
  /* Add any additional styles needed to display the game properly */
}

/* Fix missing closing braces and complete incomplete rules */

/* Example Fix */
.modal.active {
  display: flex;
}

/* Ensure all classes used in JavaScript are defined */
.hidden {
  display: none;
}

.active {
  display: block; /* or flex, depending on layout */
}


.wm-game-container {
    width: 80%:
    margin: 0 auto;
    padding: 20px;
    height: 80vh; /* Added specific height */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wm-option {
    transition: background-color 0.3s ease, color 0.3s ease;
}
