:root {
    --blue: #2563eb;
    --blue-light: #bfdbfe;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #fbbf24;
    --gray: #e5e7eb;
    --bg: #ffffff;
    --text: #111827;
    --muted: #4b5563;
}

/* SHELL & LAYOUT */
.stdy-quiz-shell {
    margin: 1.5rem 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
}

.stdy-layout {
    display: flex;
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.stdy-main {
    flex: 1 1 0;
    min-width: 0;
}

.stdy-side {
    width: 220px;
    max-width: 100%;
    border-left: 1px solid var(--gray);
    padding-left: 12px;
    font-size: 14px;
}

/* HEADER */
.stdy-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
}
.stdy-timer {
    color: #b91c1c;
}

/* QUESTION CARD */
.stdy-card {
    background: var(--bg);
    border: 1px solid var(--gray);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

.stdy-question {
    margin-bottom: 10px;
}

/* OPTIONS */
.stdy-options {
    margin-bottom: 12px;
}
.stdy-opt {
    border: 1px solid var(--gray);
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: block;
    cursor: pointer;
}
.stdy-opt:hover {
    background: #eff6ff;
}

/* ACTION BUTTONS */
.stdy-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.stdy-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    cursor: pointer;
    font-size: 14px;
}
.stdy-btn-primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #ffffff;
}
.stdy-btn-secondary {
    border-color: #9ca3af;
    background: #e5e7eb;
    color: #111827;
}
.stdy-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* NAVIGATION SIDEBAR */
.stdy-nav-title {
    font-weight: 600;
    margin-bottom: 6px;
}
.stdy-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}
.stdy-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--gray);
    background: #f9fafb;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center; /* center number vertically & horizontally */
}
.stdy-nav-btn.current {
    border-color: var(--blue);
    background: #eff6ff;
}
.stdy-nav-btn.answered {
    background: var(--blue);
}
.stdy-nav-btn.skipped {
    background: var(--yellow);
}

.stdy-nav-legend {
    font-size: 12px;
    color: var(--muted);
}
.legend-box {
    display:inline-block;
    width:12px;
    height:12px;
    border-radius:2px;
    margin-right:4px;
    vertical-align:middle;
}
.legend-box.not-visited { background:#e5e7eb; }
.legend-box.answered { background:var(--blue-light); }
.legend-box.skipped { background:var(--yellow); }

/* FEEDBACK (PRACTICE MODE) */
.stdy-feedback {
    margin: 8px 0 4px;
    padding: 10px;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 14px;
}
.hidden {
    display:none;
}
.txt-correct {
    color: var(--green);
    font-weight: 600;
}
.txt-wrong {
    color: var(--red);
    font-weight: 600;
}
.txt-skipped {
    color: #b45309;
    font-weight: 600;
}

/* EXPLANATION DETAILS */
.stdy-explain summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--blue);
}
.stdy-explain-body {
    margin-top: 4px;
    background: #f3f4f6;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
}

/* RESULT SCREEN */
.stdy-result {
    max-width: 640px;
    margin: 0 auto;
    border: 1px solid var(--gray);
    border-radius: 10px;
    padding: 18px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}
.stdy-score-line {
    font-size: 18px;
    margin-bottom: 4px;
}
.stdy-result-actions {
    margin-top: 12px;
    display:flex;
    justify-content:center;
    gap:10px;
}

/* REVIEW SCREEN */
.stdy-review-page {
    max-width: 900px;
    margin: 0 auto;
}
.stdy-review-list {
    margin-top: 10px;
}
.stdy-review-item {
    border-top: 1px solid var(--gray);
    padding-top: 10px;
    margin-top: 10px;
}
.stdy-review-question {
    margin-bottom: 4px;
}
.stdy-review-status {
    margin-bottom: 4px;
}
.stdy-status.correct { color: var(--green); }
.stdy-status.wrong   { color: var(--red); }
.stdy-status.skipped { color: #b45309; }

.stdy-review-answers {
    font-size: 14px;
    margin-bottom: 4px;
}
.stdy-review-actions {
    margin: 12px 0;
    display:flex;
    justify-content:flex-end;
    gap:8px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .stdy-layout {
        flex-direction: column;
    }
    .stdy-side {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--gray);
        padding-left: 0;
        padding-top: 10px;
    }
    .stdy-nav-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .stdy-result, .stdy-review-page {
        padding: 12px;
    }
}

/* Section label above question */
.stdy-section-label {
    background: #e8efff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2b4bbb;
    display: inline-block;
}

/* Section-wise summary table on result page */
.stdy-section-summary {
    margin-top: 12px;
    text-align: left;
}
.stdy-section-table-wrap {
    overflow-x: auto;
}
.stdy-section-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 14px;
}
.stdy-section-table th,
.stdy-section-table td {
    border: 1px solid #e5e7eb;
    padding: 4px 8px;
    text-align: left;
}
.stdy-section-table th {
    background:#f3f4f6;
}

/* Review section label per question */
.stdy-review-section {
    font-size: 13px;
    color:#6b7280;
    margin-bottom: 2px;
}

.stdy-tabs {
    display:flex;
    gap:6px;
    margin-bottom:10px;
    overflow-x:auto;
    padding-bottom:5px;
}

.stdy-tab-btn {
    padding:6px 14px;
    font-size:14px;
    border:1px solid #d0d7e2;
    border-radius:20px;
    background:#f7f9fc;
    cursor:pointer;
    white-space:nowrap;
}

.stdy-tab-btn.active {
    background:#1d4ed8;
    color:#fff;
    border-color:#1d4ed8;
    font-weight:600;
}

/* ===== REVIEW PAGE STYLES ===== */

.stdy-review {
    max-width: 900px;
    margin: auto;
}

.stdy-review-item {
    background: #fff;
    padding: 16px;
    margin-bottom: 18px;
    border-radius: 8px;
    border: 1px solid #e3e3e3;
    font-size: 17px;
    line-height: 1.5;
}

.stdy-review-item strong {
    color: #222;
}

.stdy-review-section {
    background: #eef4ff;
    color: #3366cc;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Answer states */
.stdy-answer-correct {
    color: #198754;
    font-weight: bold;
}

.stdy-answer-wrong {
    color: #d00000;
    font-weight: bold;
}

.stdy-answer-skipped {
    color: #6c757d;
    font-style: italic;
}

/* Explanation toggle design */
.stdy-review-item details summary {
    font-weight: 600;
    color: #0d6efd;
    margin-top: 10px;
    cursor: pointer;
    padding: 6px 0;
}

.stdy-review-item details summary:hover {
    text-decoration: underline;
}

.stdy-review-item details {
    margin-top: 5px;
    background: #fafaff;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #0d6efd;
}

/* Retry button spacing */
.stdy-review .stdy-btn-retry {
    margin-top: 20px;
    display: block;
}
.stdy-score-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.stdy-score-table th {
    background: #eef4ff;
    padding: 8px;
    text-align: left;
}

.stdy-score-table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.stdy-score-table tr:nth-child(even){
    background: #fafafa;
}

.study-quiz-start {
  max-width: 480px;
  margin: auto;
  padding: 15px;
  font-family: system-ui, sans-serif;
}

.study-quiz-title {
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
}

.study-quiz-box, .study-quiz-pattern {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
  box-shadow: 0px 2px 8px rgba(0,0,0,0.05);
}

.study-quiz-box li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}
.study-quiz-box li:last-child {
  border-bottom: none;
}

.study-quiz-btn {
  width: 100%;
  margin-top: 20px;
  background: #007bff;
  color: white;
  font-size: 18px;
  border-radius: 50px;
  padding: 12px;
  cursor: pointer;
  border: none;
}
.study-quiz-btn:active {
  background: #005fcc;
  transform: scale(0.97);
}

.study-quiz-box ul li {
  padding: 4px 0;
  font-size: 15px;
}

.study-quiz-box h4 {
  margin-bottom: 6px;
  font-weight: 600;
}

.study-quiz-box strong {
  font-weight: 600;
}

