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

html, body {
  font-family: 'Segoe UI', sans-serif;
  background: #f7f7f7;
  color: #333;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

/* Spinner Overlay */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  font-size: 1.5rem;
}

/* Card Container */
.card {
  width: 100%;
  max-width: 500px;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease;
}

h1, h2 {
  text-align: center;
  color: #1976d2;
  margin-bottom: 1rem;
}

/* Button Styling */
button, .quiz-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  margin: 0.5rem 0;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background-color: #1976d2;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background-color: #0d47a1;
}

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

#resultContainer,
#quizContainer,
#progressContainer {
  display: none;
  padding: 1rem;
}

/* Reset Button */
#resetBtn {
  width: fit-content;
  margin: 1em auto;
  background-color: #f44336;
}

/* Quiz content */
label {
  display: block;
  background: #f1f8ff;
  padding: 0.75rem;
  border-radius: 8px;
  margin: 0;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.3s, border 0.3s;
}

input[type="radio"] {
  margin-right: 10px;
}

label:hover {
  background-color: #e3f2fd;
}

input[type="radio"]:checked + label {
  border-color: #1976d2;
}

/* Status */
.correct {
  color: green;
  font-weight: bold;
}
.incorrect {
  color: red;
  font-weight: bold;
}

/* Buttons Group */
.greenBtn { background-color: #30da39; }
.redBtn { background-color: #f44336; }
.yellowBtn { background-color: #d6ca1c; }
.blackBtn { background-color: #2b2b2b; }

.greenBtn:hover { background-color: #28c133; }
.redBtn:hover { background-color: #d32f2f; }
.yellowBtn:hover { background-color: #c9cc35; }
.blackBtn:hover { background-color: #303030; }

/* Tables */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 600px;
}

th, td {
  padding: 0.6rem;
  border: 1px solid #ccc;
  text-align: center;
  vertical-align: top;
  word-wrap: break-word;
}

thead {
  background-color: #e0f7fa;
}

th {
  color: #1976d2;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Progress Bar */
.progress-bar-wrapper {
  background: #ddd;
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
  height: 24px;
}

.progress-bar {
  height: 100%;
  background-color: #42a5f5;
  color: white;
  text-align: center;
  line-height: 24px;
  transition: width 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utility */
.question_label {
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
  color: #e91e63;
  margin-bottom: 0.5rem;
}

.return {
  display: block;
  position: fixed;
  left: 20px;
  top: 10px;
  width: fit-content;
  margin-top: 1rem;
  z-index: 10000;
}

/* Mobile improvements */
@media (max-width: 768px) {
  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.4rem;
  }

  .return {
    font-size: 0.9rem;
    padding: 0.5rem;
  }
}
