/** STYLE.CSS **/

/* Reset & Base */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Rubik', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #ebf7ff;
  color: #333;
  margin: 0;
  padding: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App container */
#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 10px;
}

/* Headings */
h1 {
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 0.2em;
  color: #222;
}

h3 {
  font-weight: 400;
  font-size: 1rem;
  color: #666;
  margin-top: 0;
  margin-bottom: 1em;
}

/* Desktop-specific styles for larger screens */
@media (min-width: 1200px) {
  body {
    padding: 16px;
    font-size: 1.4rem;
  }

  #app {
    max-width: 1600px;
    padding: 0 40px;
  }

  h1 {
    font-size: 3rem;
  }

  h3 {
    font-size: 1.6rem;
  }

  #question-box {
    max-width: 900px;
    padding: 40px 60px;
    margin: 2rem auto;
  }

  #question-text {
    font-size: 1.8rem;
    line-height: 1.8;
  }

  .choice-btn {
    padding: 24px 28px;
    font-size: 1.6rem;
    margin-bottom: 20px;
  }

  button {
    padding: 20px 40px;
    font-size: 1.6rem;
  }

  #filters {
    padding: 16px 20px;
    gap: 1.5rem;
    margin-bottom: 2rem;
    max-width: 900px;
  }

  #filters label {
    font-size: 1.6rem;
    min-width: 100px;
  }

  #filters select,
  #filters button {
    font-size: 1.6rem;
    padding: 16px 24px;
    min-width: 220px;
  }

  #user-settings {
    font-size: 1.6rem;
    gap: 2rem;
  }

  #user-settings button {
    padding: 12px 24px;
    font-size: 1.4rem;
  }

  #exam-controls-box {
    width: 380px;
    padding: 28px 32px;
    gap: 24px;
  }

  #exam-timer {
    font-size: 2.6rem;
    margin-bottom: 30px;
  }

  #question-meta-left {
    gap: 25px;
  }

  #question-set,
  #question-number,
  #question-category {
    padding: 10px 20px;
    font-size: 20px;
  }

  #bookmark-btn {
    font-size: 36px;
  }

  /* Progress bar - match filters section width */
  #progress-bar-container {
    max-width: 600px !important;
    margin: 0 auto 2rem auto !important;
  }

  #progress-bar-bg {
    height: 12px !important;
  }

  #progress-bar {
    height: 12px !important;
  }

  #progress-bar-label {
    font-size: 1.1rem !important;
    margin-top: 4px !important;
  }
}

/* Extra large desktop styles */
@media (min-width: 1600px) {
  body {
    padding: 20px;
    font-size: 1.5rem;
  }

  #app {
    max-width: 1800px;
    padding: 0 50px;
  }

  h1 {
    font-size: 3.5rem;
  }

  #question-box {
    max-width: 1000px;
    padding: 50px 80px;
  }

  #question-text {
    font-size: 2rem;
  }

  .choice-btn {
    padding: 28px 32px;
    font-size: 1.8rem;
  }

  button {
    padding: 24px 45px;
    font-size: 1.8rem;
  }

  #filters {
    max-width: 1000px;
    padding: 28px 32px;
  }

  #exam-controls-box {
    width: 420px;
    padding: 32px 36px;
  }

  #exam-timer {
    font-size: 3rem;
  }

  /* Progress bar - match filters section width */
  #progress-bar-container {
    max-width: 900px !important;
  }
}

/* --- UPDATED Filter section --- */
#filters {
  background: #f0f6ff;
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #cce0ff;
  box-shadow: 0 1px 6px rgba(0, 123, 255, 0.15);
}

#filters label {
  font-weight: 600;
  color: #2c3e50;
  margin-right: 6px;
  user-select: none;
  min-width: 65px;
}

#filters select,
#filters button {
  font-family: 'Rubik', sans-serif;
  font-size: 1rem;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid #99c2ff;
  background-color: #eaf4ff;
  color: #1a3e72;
  cursor: pointer;
  min-width: 160px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

#filters select:hover,
#filters button:hover {
  border-color: #3b7ddd;
  background-color: #d4e6ff;
}

#filters button {
  background-color: #3b7ddd;
  color: white;
  font-weight: 600;
  min-width: 120px;
  background-image: none;
}

#filters button:hover {
  background-color: #255fbf;
}

/* Question card */
#question-box {
  max-width: 900px;
  /* wider */
  margin: 2rem auto;
  padding: 30px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#question-box:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Question metadata */
#question-set,
#question-category,
#question-number {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.4em;
  color: #000000;
}

#question-set {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#question-number {
  color: #007bff;
  font-size: 1.1rem;
  position: relative;
}

#question-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1em;
}

/* Bookmark Button */
#bookmark-btn {
  font-size: 1.3rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
  color: #f5b301;
  /* Default gold color */
  transition: color 0.3s ease;
}

#bookmark-btn:hover {
  color: #f5b301;
}

#bookmark-btn.bookmarked {
  color: #f5b301;
}

/* Choices styling */
.choice-btn {
  display: block;
  font-family: inherit;
  text-align: left;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: #fefefe;
  border: 1.2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  color: #333;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.choice-btn:hover {
  background-color: #e6f0ff;
  border-color: #007bff;
}

.choice-btn.not-selected {
  background-color: #ffffff;
  /* keep white after selection */
  color: rgba(0, 0, 0, 0.5);
  border-color: rgba(200, 200, 200, 0.5);
  pointer-events: none;
}

.choice-btn.correct {
  background-color: #a6e3a1;
  border: 2px solid #4caf50;
  color: #1b4721;
}

.choice-btn.incorrect {
  background-color: #f38ba8;
  border: 2px solid #f44336;
  color: #5e1c1c;
}

/* Navigation buttons */
.controls {
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  margin: 0 4px;
  transition: background-color 0.3s ease;
  user-select: none;
}

button:hover {
  background-color: #0056b3;
}

button:disabled {
  background-color: #999;
  cursor: not-allowed;
}

/* Image styling */
#question-box img {
  display: block;
  margin: 1rem auto;
  max-width: 70%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* Footer */
.copyright {
  text-align: center;
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 1.5rem;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  #question-box {
    padding: 16px;
  }

  button {
    display: block;
    width: 100%;
    margin: 8px 0;
  }

  .controls {
    margin-bottom: 1.5rem;
  }

  #filters {
    flex-direction: column;
    align-items: center;
  }
}

/* User Settings Bar */
#user-settings {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  flex-wrap: wrap;
}

#user-settings button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#user-settings button:hover {
  background-color: #0056b3;
}

/* Exam Controls Sidebar */
#exam-controls-box {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 240px;
  background-color: white;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  overflow-x: hidden;

  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 80vh;
  overflow-y: auto;
  font-family: Rubik, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#exam-controls-box button {
  display: block;
  width: 100%;
  font-family: 'Rubik', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#exam-timer {
  font-weight: 700;
  font-size: 1.6rem;
  color: #007bff;
  text-align: center;
  margin-bottom: 15px;
}

#pause-timer-btn {
  background-color: #ffc107;
  color: #333;
}

#pause-timer-btn:hover:not(:disabled) {
  background-color: #e0a800;
}

#stop-timer-btn {
  background-color: #dc3545;
  color: white;
}

#stop-timer-btn:hover:not(:disabled) {
  background-color: #a71d2a;
}

#show-exam-stats-btn {
  background-color: #28a745;
  color: white;
}

#show-exam-stats-btn:hover:not(:disabled) {
  background-color: #19692c;
}

#start-exam-mode {
  background-color: #007bff;
  color: white;
}

#start-exam-mode:hover:not(:disabled) {
  background-color: #0056b3;
}

#exam-controls-box button:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Header container */
#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin: 0 auto 1rem auto;
  padding: 0 10px;
}

/* Left side: title + subtitle */
#header-left {
  display: flex;
  flex-direction: column;
}

/* Subtitle below title, smaller and lighter */
#subtitle {
  font-weight: 400;
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.1rem;
  margin-bottom: 0;
}

/* User settings on top right, horizontal */
#user-settings {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  white-space: nowrap;
}

#user-settings span {
  font-weight: 500;
}

#user-settings strong {
  font-weight: 700;
}

/* Buttons in user-settings */
#user-settings button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.3s ease;
  user-select: none;
}

#user-settings button:hover {
  background-color: #0056b3;
}

#question-set span,
#question-number,
#question-category {
  display: inline-block;
  padding: 4px 8px;
  margin-right: 10px;
  border: 2px solid #1E40AF;
  /* blue box border */
  border-radius: 6px;
  font-weight: 600;
  color: #1E40AF;
  /* text color same as ethology */
  background-color: #DBEAFE;
  /* light blue background */
  user-select: none;
}

#question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

#question-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
}

#question-set,
#question-number,
#question-category {
  background-color: #e3f2fd;
  color: #0d47a1;
  /* similar to ethology text color */
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1.5px solid #0d47a1;
  margin-right: 8px;
  white-space: nowrap;
  font-size: 14px;
}

#bookmark-btn {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 24px;
  color: #f5b301;
  /* always gold */
  transition: color 0.3s;
  flex-shrink: 0;
}

#bookmark-btn:hover {
  color: #f5b301;
}

#bookmark-btn.bookmarked {
  color: #f5b301;
  /* same gold when bookmarked */
}

#restart-questions {
  margin-left: 10px;
}

.fade-in {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}


#question-container {
  opacity: 1;
  transition: opacity 0.3s ease;
}

#question-container:not(.show) {
  opacity: 0;
}

#answer-text {
  margin: 0;
  padding: 0;
  display: none;
  /* hide by default */
}

/* Dropdown styling */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
  min-width: 160px;
  height: 36px;
  /* fixed height to prevent jumps */
}

.dropdown-wrapper select {
  width: 100%;
  height: 36px;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #eaf4ff;
  border: 1.5px solid #99c2ff;
  padding: 7px 40px 7px 12px;
  border-radius: 8px;
  font-size: 1rem;
  color: #1a3e72;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.dropdown-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #719be0;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-arrow span {
  display: inline-block;
  transform-origin: center center;
  transition: transform 0.3s ease;
  transform: translateY(0);
}

.dropdown-wrapper:hover .dropdown-arrow span {
  transform: translateY(4px);
}

@keyframes slide-down {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}
/* Animate only the arrow span on hover */
.dropdown-wrapper:hover .dropdown-arrow span {
  animation-name: slide-rotate;
}

/* Keyframes: small vertical slide down + gentle rotate */
@keyframes slide-rotate {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(3px) rotate(0deg);
  }
}

#question-box.fade {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#question-box.fade.show {
  opacity: 1;
  transform: translateY(0);
}
#header-left {
  display: flex;
  flex-direction: column;
}

#title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  /* space between text and logo */
}

#title-row h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #222;
}

#site-logo {
  width: 32px;
  /* small logo size */
  height: 32px;
  border-radius: 6px;
  /* rounded corners */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

#site-logo:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.6);
}

#subtitle {
  margin: 4px 0 0 0;
  font-weight: 400;
  font-size: 1rem;
  color: #555;
  line-height: 1.2;
}

@media (max-width: 768px) {
  #exam-controls-box {
    position: static;
    width: auto;
    max-width: 600px;
    margin: 16px auto;
    box-shadow: none;
    border: 1px solid #cce0ff;
  }
}