/* ==========================================================================
   aptitude.css — Aptitude Practice Module (unique styles only)
   Depends on: main.css (btn, faq-*), practice.css (mod-*, quick-stats-bar,
               qstat-*, resume-btn, practice-card-icon, practice-premium-badge)
   ========================================================================== */

/* ── PAGE WRAPPER ─────────────────────────────────────────────────────────── */
.aptitude-main {
  position: relative; /* Anchor for sticky side ad columns */
  max-width: 850px;
  margin: 0 auto;
  margin-bottom: var(--space-8);
  padding: var(--space-6) var(--space-4) var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* ── SCREENS (show/hide) ──────────────────────────────────────────────────── */
.apt-screen { display: none; }
.apt-screen.active { display: block; }

/* ── RESUME BANNER (wrapper only — button uses .resume-btn from practice.css) */
.apt-resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.apt-resume-banner-text {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-main);
}
.apt-resume-banner-text svg { width: 18px; height: 18px; color: #6366f1; flex-shrink: 0; }
.apt-resume-banner-text strong { font-weight: var(--fw-semibold); }

/* ── SECTION LABEL ────────────────────────────────────────────────────────── */
.apt-section-label {
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}

/* ── TOPIC GRID ───────────────────────────────────────────────────────────── */
.apt-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.apt-topic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-section);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  cursor: pointer;
  transition: all 0.15s ease-in;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.apt-topic-btn:hover {
  border-color: rgba(59, 130, 249, 0.5);
  background: var(--admin-active-bg);
  transform: translateY(-2px);
}
.apt-topic-btn.selected {
  border-color: var(--accent-primary);
  background: var(--admin-active-bg);
}

/* Locked topic: suppress hover lift, show overlay instead */
.apt-topic-btn[data-locked="1"]:hover {
  transform: none;
  border-color: var(--border-subtle);
  background: var(--bg-section);
}

/* Topic icon — smaller than practice-card-icon (40px vs 48px) */
.apt-topic-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.apt-topic-icon svg { width: 20px; height: 20px; color: #fff; }

.apt-topic-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-main);
  line-height: 1.3;
}

/* Mix Mode icon — brand gradient (no mod-* equivalent) */
.apt-icon-mix { background: var(--accent-gradient); }

/* ── CONTROLS ROW ─────────────────────────────────────────────────────────── */
.apt-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
@media (max-width: 520px) {
  .apt-controls-row { grid-template-columns: 1fr; gap: var(--space-4); }
}
.apt-control-group { display: flex; flex-direction: column; gap: var(--space-2); }
.apt-control-group label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── PILL SELECTORS (difficulty / count) ──────────────────────────────────── */
.apt-pill-group { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.apt-pill {
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--admin-hover-bg);
  color: var(--text-soft);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all 0.15s ease-in;
  white-space: nowrap;
}
.apt-pill:hover { border-color: rgba(59, 130, 249, 0.5); background: var(--admin-active-bg); color: var(--text-main); transform: translateY(-2px);}
.apt-pill.selected { border: none; background: var(--accent-gradient); color: #fff; }

/* ── START BUTTON (extends .btn.btn-gradient from main.css) ───────────────── */
.apt-start-btn {
  width: 100%;
  margin-top: var(--space-2);
  border-radius: var(--radius-lg);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}
.apt-start-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── QUIZ SCREEN ──────────────────────────────────────────────────────────── */
.apt-quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
  flex-wrap: wrap;
}
.apt-progress-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--text-main);
  background: var(--bg-section);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-1) var(--space-4);
  letter-spacing: 0.02em;
}
.apt-timer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-success);
  background: var(--color-success-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: var(--space-1) var(--space-3);
}
.apt-timer svg { width: 14px; height: 14px; color: var(--color-success); }

.apt-progress-bar-wrap {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 100px;
  margin-bottom: var(--space-5);
  overflow: hidden;
}
.apt-progress-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

/* Question card */
.apt-question-card {
  background: var(--bg-section);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  padding-top: calc(var(--space-5) + var(--space-4));
  margin-bottom: var(--space-4);
  position: relative;
  overflow: visible;
}

/* Badge pinned to top-center of question card */
.apt-question-card > .apt-topic-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  border: 1.5px solid rgba(0, 126, 255, 0.2);
  background: var(--bg-section);
}

.apt-topic-badge {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.apt-question-text {
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  color: var(--text-main);
  line-height: var(--lh-relaxed);
}

/* Options */
.apt-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
@media (max-width: 480px) { .apt-options-grid { grid-template-columns: 1fr; } }

.apt-option-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-section);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  text-align: left;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  color: var(--text-main);
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.apt-option-btn:hover:not(:disabled) {
  border-color: rgba(59, 130, 249, 0.5);
  background: var(--admin-active-bg);
}
.apt-option-btn:disabled { cursor: default; }
.apt-option-btn.correct { border-color: var(--color-success); background: var(--color-success-bg); color: var(--color-success); }
.apt-option-btn.wrong   { border-color: var(--color-error);   background: var(--color-error-bg);   color: var(--color-error); }

.apt-option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-section-soft);
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.apt-option-btn.correct .apt-option-letter { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.apt-option-btn.wrong   .apt-option-letter { background: var(--color-error);   border-color: var(--color-error);   color: #fff; }

/* Solution panel */
.apt-solution-panel {
  background: var(--bg-section-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
  display: none;
}
.apt-solution-panel.visible { display: block; }

.apt-solution-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  user-select: none;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-main);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.apt-solution-toggle svg { width: 16px; height: 16px; color: var(--text-soft); transition: transform 0.2s; }
.apt-solution-toggle.open svg { transform: rotate(180deg); }

.apt-solution-body { padding: 0 var(--space-4) var(--space-4); display: none; }
.apt-solution-body.open { display: block; }

.apt-solution-steps { list-style: none; margin: 0; padding: 0; }
.apt-solution-step {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
  color: var(--text-main);
  line-height: var(--lh-relaxed);
}
.apt-solution-step:last-child { border-bottom: none; }
.apt-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-size: 11px;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Quiz actions */
.apt-quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.apt-skip-btn {
  background: none;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.apt-skip-btn:hover { border-color: rgba(59, 130, 249, 0.5); background: var(--admin-active-bg); color: var(--text-main); }
.apt-skip-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.apt-next-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-5);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background 0.15s;
}
.apt-next-btn:hover { background: var(--accent-primary-hover); }
.apt-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.apt-next-btn svg { width: 14px; height: 14px; }

.apt-pause-btn {
  background: var(--admin-hover-bg);
  border: none;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px var(--space-3);
  border-radius: var(--radius-lg);
  transition: color 0.15s;
}
.apt-pause-btn:hover { color: var(--text-main); }
.apt-pause-btn svg { width: 14px; height: 14px; }


.apt-save-status { text-align: center; font-size: var(--fs-sm); color: var(--text-soft); margin-bottom: var(--space-4); transition: opacity 0.5s ease; }
.apt-save-status.saved { color: var(--color-success); }
.apt-save-status.error { color: var(--color-error); }
.apt-save-status.fade-out { opacity: 0; }

/* Review list */
.apt-review-section { margin-top: var(--space-4); }
.apt-review-title { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-main); margin-bottom: var(--space-4); }
.apt-review-list { display: flex; flex-direction: column; gap: var(--space-3); }

.apt-review-item {
  background: var(--bg-section);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border-left: 3px solid var(--border-subtle);
}
.apt-review-item.correct  { border-left-color: var(--color-success); }
.apt-review-item.wrong    { border-left-color: var(--color-error); }
.apt-review-item.skipped  { border-left-color: var(--color-warning); }

.apt-review-q { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-main); margin-bottom: var(--space-2); line-height: var(--lh-relaxed); }
.apt-review-ans-row { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--fs-xs); }
.apt-review-correct-ans   { color: var(--color-success); font-weight: var(--fw-semibold); }
.apt-review-your-ans      { color: var(--color-error);   font-weight: var(--fw-semibold); }
.apt-review-skipped-label { color: var(--color-warning); font-weight: var(--fw-semibold); }
.apt-review-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  padding: 2px 8px;
  border-radius: 100px;
  float: right;
}
.apt-review-status-chip.correct { background: var(--color-success-bg); color: var(--color-success); }
.apt-review-status-chip.wrong   { background: var(--color-error-bg);   color: var(--color-error); }
.apt-review-status-chip.skipped { background: var(--color-warning-bg); color: var(--color-warning); }
.apt-review-status-chip svg { width: 11px; height: 11px; }

/* ── REVIEW SOLUTION & TIME ───────────────────────────────────────────────── */
.apt-review-time {
  font-size: var(--fs-xs);
  color: var(--text-soft);
  margin-top: 3px;
  text-align: right;
}
.apt-review-solution {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.apt-review-solution-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

/* ── SEO / INFO SECTION ───────────────────────────────────────────────────── */
.apt-info-section {
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
}
.apt-info-section h2 { font-size: var(--fs-3xl); font-weight: var(--fw-bold); color: var(--text-main); margin-bottom: var(--space-3); }
.apt-info-section > p { font-size: var(--fs-base); color: var(--text-soft); line-height: var(--lh-relaxed); margin-bottom: var(--space-4); }

.apt-topic-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}
.apt-topic-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-main);
  background: var(--admin-hover-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  transition: all 0.15s ease-in;
  font-weight: var(--fw-medium);
}
.apt-topic-list-item:hover { border-color: rgba(59, 130, 249, 0.5); background: var(--admin-active-bg); transform: translateY(-2px);}
.apt-topic-list-item svg { width: 14px; height: 14px; color: var(--accent-primary); flex-shrink: 0; }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .apt-topic-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (max-width: 380px) {
  .apt-topic-grid { grid-template-columns: 1fr 1fr; }
}

/* ── SPEED SECTION — composition pills ────────────────────────────────────── */
.ss-comp-pills { margin-bottom: var(--space-5); display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center; }
.ss-comp-badge { display: inline-block; padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.ss-comp-badge--info   { background: var(--color-info-bg);    color: var(--color-info); }
.ss-comp-badge--purple { background: var(--color-purple-bg);  color: var(--color-purple); }
.ss-comp-badge--green  { background: var(--color-success-bg); color: var(--color-success); }
.ss-comp-badge--warning{ background: var(--color-warning-bg); color: var(--color-warning); }
.ss-comp-badge--accent { background: rgba(232, 67, 10, 0.12); color: var(--color-accent, #e8430a); }

/* ── SPEED SECTION — countdown timer + section breakdown ──────────────────── */
.apt-timer--countdown { color: var(--color-accent, #e8430a); font-weight: var(--fw-semibold); }
.apt-timer--countdown.ss-timer-warn { color: var(--color-danger, #dc2626); animation: ss-pulse 1s infinite; }
@keyframes ss-pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.ss-breakdown { margin: var(--space-6) 0; }
.ss-breakdown-title { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-main); margin-bottom: var(--space-4); text-align: center; }
.ss-bd-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-3); max-width: 560px; margin: 0 auto; }
.ss-bd-card { background: var(--card-bg); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-3); text-align: center; border-top: 4px solid transparent; box-shadow: 0 1px 4px rgba(0,0,0,.07); display: flex; flex-direction: column; align-items: center; gap: var(--space-1); }
.ss-bd-card--info   { border-top-color: var(--color-info); }
.ss-bd-card--purple { border-top-color: var(--color-purple); }
.ss-bd-card--green  { border-top-color: var(--color-success); }
.ss-bd-card--warning{ border-top-color: var(--color-warning); }
.ss-bd-card--accent { border-top-color: var(--color-accent, #e8430a); }
.ss-bd-card-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-1); }
.ss-bd-card--info   .ss-bd-card-icon { background: var(--color-info-bg); color: var(--color-info); }
.ss-bd-card--purple .ss-bd-card-icon { background: var(--color-purple-bg); color: var(--color-purple); }
.ss-bd-card--green  .ss-bd-card-icon { background: var(--color-success-bg); color: var(--color-success); }
.ss-bd-card--warning .ss-bd-card-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.ss-bd-card--accent  .ss-bd-card-icon { background: rgba(232, 67, 10, 0.12); color: var(--color-accent, #e8430a); }
.ss-bd-card-icon svg { width: 16px; height: 16px; }
.ss-bd-card-label { font-size: var(--fs-xs); color: var(--text-soft); font-weight: var(--fw-medium); }
.ss-bd-card-score { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-main); line-height: 1; margin-top: var(--space-1); }
.ss-bd-card-pct   { font-size: var(--fs-sm); color: var(--text-soft); }

/* 4-card variant (Full Quant Sectional) — 4-up desktop, 2-up tablet wrap */
.ss-bd-grid--4 { grid-template-columns: repeat(4, 1fr); max-width: 760px; }
@media (max-width: 768px) {
  .ss-bd-grid--4 { grid-template-columns: repeat(2, 1fr); max-width: 400px; }
}

@media (max-width: 480px) {
  .ss-bd-grid, .ss-bd-grid--4 { grid-template-columns: 1fr; max-width: 280px; }
  .ss-bd-card { flex-direction: row; text-align: left; gap: var(--space-3); padding: var(--space-3); }
  .ss-bd-card-icon { flex-shrink: 0; }
  .ss-bd-card-score { font-size: var(--fs-base); }
}

