/* ===== Root Variables ===== */
:root {
  --bg-light: #f9f9f9;
  --bg-dark: #121212;
  --text-light: #333;
  --text-dark: #e0e0e0;
  --accent: #00a8cc;
  --nav-bg: #0a1f44;         /* still used for header/nav background */
  --heading-blue: #1976d2;   /* lighter blue for headings */
  --nav-hover: #1c345d;
  --max-width: 960px;
}

/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-light);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Layout Container ===== */
main {
  max-width: var(--max-width);
  margin: auto;
  padding: 40px 20px;
}

/* ===== Header ===== */
header {
  background-color: var(--nav-bg);
  color: white;
  padding: 20px;
  border-bottom: 3px solid var(--accent);
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo {
  height: 60px;
}

.tagline h1 {
  font-size: 2em;
  margin-bottom: 5px;
}

.tagline p {
  font-size: 1em;
  color: #ccc;
}

/* ===== Navigation ===== */
nav {
  margin-top: 15px;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 10px;
  display: block;
}

.nav-menu a:hover {
  background-color: var(--nav-hover);
  border-radius: 4px;
}

/* ===== Dropdown ===== */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--nav-hover);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== Typography ===== */
h1 {
  font-size: 2.5em;
  color: var(--accent);
  margin-bottom: 0.5em;
}

h2 {
  font-size: 1.8em;
  margin-top: 1.5em;
  color: var(--heading-blue);
}

p {
  margin-bottom: 1em;
}

/* ===== Links ===== */
a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
}

a:hover {
  text-decoration: underline;
}

/* ===== Footer ===== */
footer {
  background-color: var(--nav-bg);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
}

/* ===== Banner ===== */
.banner-container {
  width: 100%;
  background-color: var(--nav-bg);
  text-align: center;
  overflow: hidden;
}

.banner {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-bottom: 2px solid var(--accent);
}

/* ===== Dark Mode ===== */
body.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

body.dark-mode header,
body.dark-mode footer {
  background-color: #1c1c1c;
}

body.dark-mode .nav-menu a {
  color: var(--text-dark);
}

body.dark-mode .dropdown-menu {
  background-color: #333;
}

/* Animation for quiz result */
@keyframes fadeScale {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#quizResult {
  font-weight: bold;
  color: var(--accent-color);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#quizResult.animate {
  animation: fadeScale 0.5s ease forwards;
}

/* Try Again button */
#tryAgainBtn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: var(--accent-color);
}

/* ===== Responsive Design ===== */
@media (max-width: 600px) {
  .logo-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .nav-menu {
    flex-direction: column;
    align-items: center;
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  main {
    padding: 20px 10px;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.5em;
  }
}

