/* Base styles */
/* ========= Base ========= */
:root {
  --brand: #007acc;
  --correct: #4CAF50;
  --wrong: #F44336;
  --fg: #222;
  --bg: #f0f0f0;
  --white: #fff;
  --radius: 10px;
  --shadow: 0 3px 10px rgba(0,0,0,0.1);
}

html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after {
  box-sizing: inherit;
}

body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background: var(--bg);
  margin: 0;
  color: var(--fg);
}

a {
  text-decoration: none;
  color: var(--brand);
}

ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

input, button {
  margin: 5px;
  padding: 8px;
  font-size: 16px;
}

/* ========= Main content ========= */
#main-content {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--white);
  padding: 20px;
  box-sizing: border-box;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Desktop layout */
@media (min-width: 768px) {
  body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-bottom: 20px;
  }
  #main-content {
    flex: 3;
  }
}

/* Mobile layout */
@media (max-width: 767px) {
  body {
    display: block;
  }

  #main-content {
    padding: 16px;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .option-button {
    font-size: 16px;
    padding: 12px 14px;
  }

  .tracker-circle {
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 13px;
  }
}

/* ========= Quiz pieces ========= */
#questionBox {
  font-size: 18px;
  margin-bottom: 16px;
  color: #333;
}

#optionsList {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Option buttons */
.option-button {
  display: block;
  margin: 10px 0;
  padding: 16px 20px;
  width: 100%;
  font-size: 18px;
  font-weight: bold;
  border: 2px solid #ccc;
  border-radius: 10px;
  background-color: #f1f1f1;
  cursor: pointer;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s, transform 0.1s;
}

.option-button:hover:enabled {
  background-color: #e0e0e0;
  transform: scale(1.01);
}

.option-button.correct {
  background-color: var(--correct) !important;
  color: white;
  border-color: #388e3c;
}

.option-button.wrong {
  background-color: var(--wrong) !important;
  color: white;
  border-color: #d32f2f;
}

/* Next/Submit button */
.nav-button {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.nav-button:disabled {
  background: #9e9e9e;
  cursor: not-allowed;
}

/* Tracker */
#tracker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 20px;
  justify-content: center;
}

.tracker-circle {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin: 5px;
  text-align: center;
  line-height: 28px;
  border-radius: 50%;
  background-color: #eee;
  cursor: pointer;
  border: 1px solid #ccc;
  transition: background-color 0.2s, transform 0.1s, border-color 0.2s;
}

.tracker-circle:hover {
  background-color: #d0ebff;
  transform: scale(1.1);
  border-color: #3399ff;
}

.tracker-unattempted {
  background: #ffffff;
  color: #000;
}

.tracker-correct {
  background-color: var(--correct) !important;
  color: white;
  border-color: var(--correct);
}

.tracker-wrong {
  background-color: var(--wrong) !important;
  color: white;
  border-color: var(--wrong);
}

/* Quiz results */
.result-question {
  margin-bottom: 20px;
  padding: 10px;
  background-color: #fdfdfd;
  border-left: 4px solid #ccc;
  border-radius: 6px;
}

.result-question ul {
  list-style-type: none;
  padding-left: 10px;
}

.result-option {
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 8px;
  font-size: 16px;
  border: 2px solid #ccc;
  background-color: #f9f9f9;
  transition: background-color 0.2s;
}

.correct-option {
  background-color: #e6ffe6;
  border-color: #2ecc71;
  color: #2e7d32;
  font-weight: bold;
}

.wrong-option {
  background-color: #ffe6e6;
  border-color: #e74c3c;
  color: #c0392b;
  font-weight: bold;
}

.explanation-box {
  margin-top: 10px;
  padding: 10px;
  background: #f0f8ff;
  border-left: 4px solid var(--correct);
  font-size: 14px;
}

/* Back button */
.back-button {
  margin-bottom: 16px;
  padding: 10px 18px;
  background-color: #dcdcdc;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.back-button:hover {
  background-color: #e74c3c;
  color: #fff;
}

/* Category list */
#categoryList li {
  list-style: none;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: background-color 0.3s;
  text-align: left;
}
#categoryList li:hover {
  background-color: #f1f1f1;
}
#categoryList li div strong {
  font-size: 20px;
  color: #2c3e50;
}
#categoryList button {
  padding: 8px 16px;
  font-size: 14px;
  margin-top: 8px;
  margin-right: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #3498db;
  color: white;
  transition: background-color 0.3s;
}
#categoryList button:hover {
  background-color: #2980b9;
}

.category-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.category-title {
  font-weight: bold;
  font-size: 18px;
  color: var(--brand);
  margin-bottom: 10px;
}
.btn {
  padding: 10px 16px;
  margin-right: 10px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.start-btn {
  background-color: #3498db;
  color: white;
}
.start-btn:hover {
  background-color: #2d80c0;
}
.explanation-btn {
  background-color: #e1e1e1;
  color: #333;
}
.explanation-btn:hover {
  background-color: #d0d0d0;
}
.back-link {
  display: block;
  margin-top: 20px;
  text-align: center;
  text-decoration: none;
  color: var(--brand);
}
