:root {
  --primary: #1976d2;
  --primary-dark: #0d47a1;
  --bg: #f9f9f9;
  --card-bg: #ffffff;
  --correct: #c8e6c9;
  --wrong: #ffcdd2;
  --shadow: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: var(--primary);
  color: white;
  padding: 1.5rem;
  text-align: center;
  font-size: 1.8rem;
}

.container {
  max-width: 850px;
  margin: auto;
  padding: 2rem;
  flex-grow: 1;
}

.card {
  background: var(--card-bg);
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
  transition: height 0.3s ease, padding 0.3s ease;
  overflow: hidden;
}

select,
button {
  padding: 12px;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
}

button {
  background: var(--primary);
  color: white;
  cursor: pointer;
  border: none;
  font-weight: bold;
}

button:hover {
  background: var(--primary-dark);
}

.question {
  margin: 1rem 0;
  font-weight: bold;
  font-size: 1.1rem;
}

.option {
  padding: 10px;
  background: #f1f1f1;
  margin: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: 0.3s;
}

.option.correct {
  background: var(--correct);
}

.option.correct::after {
  content: '✔';
  position: absolute;
  right: 12px;
  color: green;
  font-weight: bold;
}

.option.wrong {
  background: var(--wrong);
}

.option.wrong::after {
  content: '✖';
  position: absolute;
  right: 12px;
  color: red;
  font-weight: bold;
}

#scoreBox {
  text-align: right;
  font-weight: bold;
  margin-bottom: 1rem;
}

#progressText {
  text-align: center;
  font-weight: bold;
  margin-bottom: 1rem;
}

#scoreCard {
  display: none;
  text-align: center;
  font-size: 1.2rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: #e3f2fd;
  color: #0d47a1;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 1rem;
}

.nav-buttons button {
  padding: 10px 20px;
  font-size: 0.9rem;
  width: 48%;
}

#retryButton,
#printButton {
  display: none;
  margin-top: 1rem;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: bold;
  cursor: pointer;
}

#retryButton:hover,
#printButton:hover {
  background: var(--primary-dark);
}

footer {
  text-align: center;
  padding: 1rem;
  color: #777;
  font-size: 0.9rem;
  background: #eee;
}

@media (max-width: 600px) {
  .card {
    padding: 1rem;
  }
  .question {
    font-size: 1rem;
  }
  .nav-buttons {
    flex-direction: column;
  }
  .nav-buttons button {
    width: 100%;
  }
}
