/* ---------- Root & Base ---------- */
:root {
  --bg: linear-gradient(135deg, #1e1b4b, #312e81, #4f46e5);
  --card: rgba(255, 255, 255, 0.15);
  --text: #f9fafb;
  --muted: #a5b4fc;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --danger: #f43f5e;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  --radius: 16px;
  --max-width: 720px;
  --blur: 18px;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  color: var(--text);
  background: var(--bg);
  background-size: 400% 400%;
  animation: bgMove 12s ease infinite;
  -webkit-font-smoothing: antialiased;
}

/* Background animation */
@keyframes bgMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.app-container {
  display: grid;
  place-items: center;
  padding: 24px;
}

/* ---------- Card Styling ---------- */
.card {
  width: 100%;
  max-width: var(--max-width);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.25);
}

.card h2,
.card h3 {
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

/* ---------- Utilities ---------- */
.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.sr-only {
  position: absolute !important;
  left: -9999px !important;
}

/* ---------- Input Grid ---------- */
.input-grid {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.input-grid input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 15px;
  transition: all 0.2s ease;
}

.input-grid input::placeholder {
  color: #c7d2fe;
}

.input-grid input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
  outline: none;
}

/* ---------- Buttons ---------- */
.btn {
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  font-size: 15px;
  
}

.card-actions.Btn1 {
  display: flex !important;
  justify-content: flex-end !important; /* move button to right */
  margin-top: 20px;
}


.btn.primary {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.6);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Start Card ---------- */
.start-card .summary p {
  color: #e0e7ff;
  margin: 6px 0;
}

.start-card .summary strong {
  color: #c7d2fe;
}

/* ---------- Quiz Section ---------- */
.quiz-header {
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.question-text {
  color: #f1f5f9;
  font-weight: 500;
}

.numb {
  color: var(--accent-2);
  font-weight: 700;
}

.options {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.option {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.25s ease;
}

.option:hover,
.option:focus {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.option.correct {
  background: rgba(34, 211, 238, 0.3);
  border-color: #22d3ee;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

.option.wrong {
  background: rgba(244, 63, 94, 0.3);
  border-color: #f43f5e;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.4);
}

.option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ---------- Result Card ---------- */
.result-grid {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.result-stats p {
  margin: 6px 0;
  color: #e0e7ff;
}

.define {
  margin-top: 8px;
  font-weight: 600;
}

.define.pass {
  color: var(--accent-2);
}

.define.fail {
  color: var(--danger);
}
/* ---------- Circular Progress (Fixed) ---------- */
.progress-wrap {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

.circular-progress {
  --value: 0deg; /* dynamic progress value (controlled via JS) */
  height: 130px;
  width: 130px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(
    var(--accent) var(--value),
    rgba(255, 255, 255, 0.15) var(--value)
  );
  position: relative;
  transition: background 0.5s ease-in-out;
}

.circular-progress::after {
  content: "";
  position: absolute;
  height: 100px;
  width: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  backdrop-filter: blur(6px);
}

.progress-value {
  position: relative;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

/* ---------- Header ---------- */
header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-weight: 700;
  font-size: 28px;
  color: #fff;
}

header h3 {
  font-size: 16px;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .card {
    padding: 18px;
  }

  .btn {
    width: 100%;
  }

  .result-grid {
    flex-direction: column;
    align-items: flex-start;
  }
}
