@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

body {
  font-family: 'Inter', sans-serif;
  color: #fff;
  min-height: 100vh;
  background: #0f1b2d;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/public/images/img3.jpeg') center/cover no-repeat fixed;
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, rgba(10, 20, 35, 0.88) 0%, rgba(13, 40, 30, 0.82) 55%, rgba(10, 20, 35, 0.9) 100%);
  z-index: -1;
}

/* ===== Glass base ===== */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
}

.header-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 3px;
}

.header-logo h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.header-logo span {
  font-size: 0.75rem;
  color: #7ee2ab;
  font-weight: 500;
}

.header-nav {
  display: flex;
  gap: 0.4rem;
}

.header-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.5rem 1.1rem;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.25s;
  border: 1px solid transparent;
}

.header-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ===== Containers ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.container-wide {
  max-width: 1050px;
}

/* ===== Cards ===== */
.card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.form-group small {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.25s;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-control:focus {
  outline: none;
  border-color: #10a958;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(16, 169, 88, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.7rem;
  border: none;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #0d6e3e, #10a958);
  color: white;
  box-shadow: 0 4px 18px rgba(16, 169, 88, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 169, 88, 0.5);
}

.btn-danger {
  background: rgba(231, 76, 60, 0.85);
  color: white;
}

.btn-danger:hover {
  background: #e74c3c;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.8rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

th {
  font-weight: 600;
  color: #7ee2ab;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== Quiz top bar ===== */
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 2rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}

.quiz-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.quiz-topbar .brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px;
}

.quiz-topbar .brand span {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.quiz-progress {
  flex: 1;
  max-width: 260px;
  text-align: center;
}

.quiz-progress .label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 5px;
  font-weight: 500;
}

.quiz-progress .bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.quiz-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, #10a958, #7ee2ab);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ===== Circular timer ===== */
.timer-ring {
  position: relative;
  width: 62px;
  height: 62px;
  flex-shrink: 0;
}

.timer-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.timer-ring .track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
}

.timer-ring .arc {
  fill: none;
  stroke: #10a958;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.4s;
}

.timer-ring .num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #10a958;
  transition: color 0.4s;
}

.timer-ring.warning .arc { stroke: #e67e22; }
.timer-ring.warning .num { color: #e67e22; }
.timer-ring.danger .arc { stroke: #e74c3c; }
.timer-ring.danger .num { color: #e74c3c; animation: pulse 0.6s infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ===== Quiz play ===== */
.quiz-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.question-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
  animation: slideUp 0.45s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.q-badge {
  display: inline-block;
  background: rgba(16, 169, 88, 0.22);
  color: #7ee2ab;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 0.8rem;
  letter-spacing: 0.5px;
  border: 1px solid rgba(16, 169, 88, 0.35);
}

.quiz-question {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
}

.quiz-hint {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ===== Options ===== */
.options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  font-size: 0.98rem;
  cursor: pointer;
  transition: all 0.22s;
  text-align: left;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.92);
  animation: slideUp 0.45s ease backwards;
}

.option-btn:nth-child(1) { animation-delay: 0.05s; }
.option-btn:nth-child(2) { animation-delay: 0.1s; }
.option-btn:nth-child(3) { animation-delay: 0.15s; }
.option-btn:nth-child(4) { animation-delay: 0.2s; }
.option-btn:nth-child(5) { animation-delay: 0.25s; }
.option-btn:nth-child(6) { animation-delay: 0.3s; }
.option-btn:nth-child(7) { animation-delay: 0.35s; }

.option-btn:hover:not(.disabled) {
  border-color: rgba(16, 169, 88, 0.6);
  background: rgba(16, 169, 88, 0.12);
  transform: translateY(-2px);
}

.option-btn.selected {
  border-color: #10a958;
  background: rgba(16, 169, 88, 0.2);
  box-shadow: 0 0 0 2px rgba(16, 169, 88, 0.35);
}

.option-btn .option-letter {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  transition: all 0.22s;
}

.option-btn.selected .option-letter {
  background: #10a958;
  color: #fff;
}

.option-btn.correct {
  border-color: rgba(39, 174, 96, 0.7);
  background: rgba(39, 174, 96, 0.28);
  box-shadow: 0 0 22px rgba(39, 174, 96, 0.3);
}

.option-btn.correct .option-letter {
  background: #27ae60;
  color: #fff;
}

.option-btn.wrong {
  border-color: rgba(231, 76, 60, 0.7);
  background: rgba(231, 76, 60, 0.26);
  box-shadow: 0 0 22px rgba(231, 76, 60, 0.28);
}

.option-btn.wrong .option-letter {
  background: #e74c3c;
  color: #fff;
}

.option-btn.disabled {
  cursor: default;
}

.option-btn.dimmed {
  opacity: 0.38;
}

.result-icon {
  margin-left: auto;
  font-size: 1.15rem;
  font-weight: 700;
}

.option-btn.correct .result-icon { color: #7ee2ab; }
.option-btn.wrong .result-icon { color: #ffb3ab; }

/* ===== Feedback ===== */
.feedback-msg {
  text-align: center;
  padding: 0.85rem 1.2rem;
  border-radius: 14px;
  font-weight: 600;
  margin-bottom: 1.2rem;
  font-size: 0.98rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: slideUp 0.35s ease;
}

.feedback-msg.correct {
  background: rgba(39, 174, 96, 0.18);
  color: #7ee2ab;
  border: 1px solid rgba(39, 174, 96, 0.4);
}

.feedback-msg.wrong {
  background: rgba(231, 76, 60, 0.16);
  color: #ffb3ab;
  border: 1px solid rgba(231, 76, 60, 0.4);
}

.feedback-msg.timeout {
  background: rgba(230, 126, 34, 0.16);
  color: #ffd39e;
  border: 1px solid rgba(230, 126, 34, 0.4);
}

/* ===== Register ===== */
.register-card {
  max-width: 460px;
  margin: 3.5rem auto;
  text-align: center;
}

.register-card img.logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
  margin-bottom: 1.2rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.register-card h2 {
  color: #fff;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.register-card p {
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.6rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== Results ===== */
.results-card {
  text-align: center;
  max-width: 500px;
  margin: 3.5rem auto;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6e3e, #10a958);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.6rem auto;
  font-size: 2.2rem;
  font-weight: 800;
  box-shadow: 0 12px 40px rgba(16, 169, 88, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.score-circle small {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.85;
}

.score-label {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.6rem;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.55rem 1.3rem;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.25s;
  font-family: inherit;
}

.tab.active {
  background: linear-gradient(135deg, #0d6e3e, #10a958);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(16, 169, 88, 0.35);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header, .quiz-topbar {
    padding: 0.7rem 1rem;
  }

  .header-logo h1 {
    font-size: 0.92rem;
  }

  .quiz-topbar .brand span {
    display: none;
  }

  .container {
    padding: 1.2rem 0.75rem;
  }

  .card {
    padding: 1.4rem;
    border-radius: 18px;
  }

  .question-card {
    padding: 1.4rem 1.5rem;
  }

  .quiz-question {
    font-size: 1.12rem;
  }

  .options-list {
    grid-template-columns: 1fr;
  }

  .option-btn {
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
  }

  .timer-ring {
    width: 54px;
    height: 54px;
  }

  .timer-ring .num {
    font-size: 1.15rem;
  }
}
