:root {
  /* Premium color scheme with better contrast */
  --bg-1: #0A0F1D;
  --bg-2: #111729;
  --card: #1E293B;
  --muted: #94A3B8;
  --text: #E2E8F0;
  --text-bright: #F8FAFC;
  --accent: #7C7FFF;
  --accent-darker: #6366F1;
  --success: #22C55E;
  --danger: #EF4444;
  --warning: #F59E0B;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-gradient: linear-gradient(180deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.03));
  --radius: 16px;
  --radius-lg: 24px;
  --max-width: 1000px;
  --pad: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 28px -2px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 40px -4px rgba(0, 0, 0, 0.15);

  /* Font settings */
  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Outfit', sans-serif;
}

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

html,
body {
  height: 100%
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  line-height: 1.65;
  letter-spacing: -0.01em;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.intro-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.intro-screen .brand-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.container>section {
  width: 100%;
  margin: 0 auto;
}

/* Keep form and quiz sections centered with max-width */
.container>.formwrapper,
.container>.quizbody {
  max-width: 580px;
}

/* Allow results section to be full width */
.container>.result {
  max-width: 100%;
}

.brand-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), var(--glass));
  padding: var(--pad);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  text-align: center;
  width: 100%;
  max-width: 480px;
}

.card {
  background: var(--glass-gradient);
  padding: var(--pad);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

@media (max-height: 800px) {
  .container {
    align-items: flex-start;
    padding-top: 40px;
  }

  .card {
    padding: 20px;
  }

  .quiz-settings {
    padding: 20px;
  }

  .stat-grid {
    gap: 12px;
  }

  .dashboard-grid {
    gap: 16px;
  }
}

.card {
  background: var(--glass-gradient);
  padding: var(--pad);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.card-header i {
  font-size: 24px;
  color: var(--accent);
  opacity: 0.9;
}

.quiz-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.stat-item i {
  font-size: 18px;
  color: var(--accent);
}

.card h1,
.card h2 {
  color: #eaf6ff;
}

.card p,
.card small {
  color: var(--muted);
}

.formwrapper {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.formwrapper h2 {
  font-size: 20px;
  margin-bottom: 8px
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.input-group {
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  border-radius: 12px;
}

.input-group label {
  color: #c5d5e6;
  font-size: 14px;
  margin-bottom: 6px;
  display: block;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: transparent;
  color: #e6eef6;
  font-size: 15px;
  outline: none;
  transition: box-shadow .15s, border-color .15s, transform .08s;
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.input-group input:focus {
  box-shadow: 0 6px 18px rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.3);
  background: rgba(255, 255, 255, 0.02);
}

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
}

.btn i {
  font-size: 20px;
}

.btn.primary {
  background: linear-gradient(45deg, var(--accent-darker), var(--accent));
  color: var(--text-bright);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  filter: brightness(110%);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.start {
  padding: var(--pad) !important;
}

.welcome-header {
  text-align: center;
  margin-bottom: 32px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.welcome-header i {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.welcome-header h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.user-preview {
  background: var(--glass-gradient);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.user-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent), var(--accent-darker));
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.user-avatar i {
  font-size: 32px;
  color: #fff;
}

.user-info {
  flex: 1;
}

.user-info h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.info-item i {
  color: var(--accent);
}

.quiz-settings {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  padding: 24px;
}

.quiz-settings {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.quiz-settings h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 20px;
  color: var(--text-bright);
}

.quiz-settings h4 i {
  color: var(--accent);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.setting-item label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.setting-value {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--text-bright);
  font-size: 16px;
}

.setting-value i {
  color: var(--accent);
  font-size: 18px;
}

.form-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-bright);
  font-size: 15px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  outline: none;
}

.form-select option {
  background: var(--card);
  color: var(--text);
}

.welcome-footer {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.quizbody {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.quiz-header h2 {
  color: #fff;
  font-size: 20px;
  margin-bottom: 12px;
}

#ques {
  color: #e6eef6;
  font-size: 16px;
  line-height: 1.5;
}

.quiz-header p {
  color: var(--muted);
  margin-top: 6px;
}

#timer {
  display: inline-block;
  min-width: 56px;
  text-align: center;
  color: #e6eef6 !important;
  background: rgba(255, 255, 255, 0.04) !important;
  padding: 6px 8px;
  border-radius: 8px;
  font-weight: 700;
}

.circular-mini {
  height: 44px;
  width: 44px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg, #2b3946 0deg);
  display: inline-grid;
  place-items: center;
  margin-left: 8px;
  transition: background 0.4s linear;
}

.circular-mini::before {
  content: "";
  position: relative;
  height: 34px;
  width: 34px;
  background: var(--card);
  border-radius: 50%;
}

ul {
  list-style: none;
  margin-top: 20px;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 12px;
}

ul li {
  background: rgba(255, 255, 255, 0.05);
  padding: 16px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 15px;
}

ul li:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.correctAns {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08)) !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
  color: var(--text-bright) !important;
}

.wrongAns {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08)) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: var(--text-bright) !important;
}

.disableli {
  pointer-events: none;
  opacity: 0.85
}

.analytics-dashboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 !important;
  max-width: 100% !important;
  margin: 0 auto;
  overflow: hidden;
  /* Prevent content overflow */
}

.dashboard-header {
  background: var(--glass-gradient);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  border-radius: 23px;
  box-sizing: border-box;
}

.header-content h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  margin-bottom: 16px;
}

.header-content h2 i {
  color: var(--accent);
}

.dashboard-grid {
  display: grid;
  gap: 24px;
  padding: 24px;
}

.dashboard-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
  /* Ensure card takes full width of parent */
  box-sizing: border-box;
  /* Include padding in width calculation */
}

.dashboard-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--muted);
}

/* Make left column wider and right column slimmer for a professional layout */
.dashboard-row .dashboard-col:first-child {
  flex: 2;
}

.dashboard-row .dashboard-col:last-child {
  flex: 1;
}

.dashboard-card h3 i {
  color: var(--accent);
}

.performance .stat-grid {
  grid-template-columns: repeat(2, 1fr);
}

.performance .stat-box.highlight {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 23px;
  margin-bottom: 20px;
  padding: 24px;
  background: var(--glass-gradient);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.btn.outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn.outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

.progress-wrapper {
  position: relative;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.progress-circle {
  position: relative;
  width: 100%;
  max-width: 200px;
}

.circular-progress {
  position: relative;
  height: 160px;
  width: 160px;
  background: conic-gradient(var(--accent) 0deg, rgba(255, 255, 255, 0.03) 0deg);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 10px auto;
  transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(76, 175, 80, 0.15);
}

/* Progress Bar Styles */
.progress-bar-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-bar {
  width: 100%;
  height: 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #65d668);
  border-radius: 8px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0%;
}

.progress-bar-text {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.circular-progress::before {
  content: "";
  position: absolute;
  height: 130px;
  width: 130px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-value {
  position: relative;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

/* Stats in result */
.stats {
  background: var(--glass-gradient);
  border-radius: var(--radius);
  padding: 32px;
  margin: 24px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  max-width: 100%;
}

/* Make overall score box take full width */
.stat-box.highlight {
  grid-column: 1 / -1;
}

.stat-box {
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-box:hover {
  transform: translateY(-1px);
}

.stat-box i {
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 2px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-display);
  color: #fff;
}

.stat-value.success {
  color: var(--success);
}

.stat-value.danger {
  color: var(--danger);
}

.stat-value.accent {
  color: var(--accent);
}

.time-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 24px;
  background: var(--glass-gradient);
  border-radius: var(--radius);
  margin: 20px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.time-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.time-item i {
  font-size: 24px;
  color: var(--accent);
  margin-bottom: 4px;
}

.time-item strong {
  color: var(--text-bright);
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-display);
}

.result-message {
  text-align: center;
  font-size: 18px;
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 20px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}


.pass-para {
  color: lightgreen;
  font-weight: 700
}

.fail-para {
  color: var(--danger);
  font-weight: 700
}

.dashboard-row {
  display: flex;
  flex-direction: column;
  /* grid-template-columns: repeat(3, 1fr); */
  gap: 24px;
  padding: 24px;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Make all columns equal width */
.performance-col,
.info-col {
  width: 100%;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.analytic-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.analytic-box i {
  font-size: 20px;
  color: var(--accent);
}

.analytic-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analytic-label {
  color: var(--muted);
  font-size: 13px;
}

.analytic-value {
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 500;
}

/* Make sure boxes are equal on mobile */
@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytic-box {
    padding: 24px;
  }

  .analytic-value {
    font-size: 20px;
  }
}

.info-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.info-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease;
  width: 100%;
  /* Ensure it takes full width */
  box-sizing: border-box;
  /* Include padding in width */
  overflow: hidden;
  /* Prevent content overflow */
}

.info-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.04);
}

.info-item i {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  /* Prevent icon from shrinking */
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  /* Allow content to shrink */
  flex: 1;
}

.info-label {
  color: var(--muted);
  font-size: 12px;
}

.info-value {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Show ... for long text */
}

/* responsive */
@media (max-width: 920px) {
  .container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .dashboard-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .dashboard-col {
    width: 100%;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .time-stats {
    grid-template-columns: 1fr;
  }

  .time-item {
    padding: 20px;
  }

  .time-item strong {
    font-size: 20px;
  }
}