/* ── Deechea Quiz — PYQ Front-end Styles ─────────────────────────────────
   Mirrors booster.css design (.dq-boost → .dq-pyq, .dqb-* → .dqp-*)
   Extra: accordion explanation sections in review screen.
──────────────────────────────────────────────────────────────────────── */

/* ── WRAPPER ─────────────────────────────────────────────────────────────── */
.dq-pyq {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    max-width: 860px;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.11);
    border: 1px solid #e2e8f0;
    background: #fff;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.dqp-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; border: none; transition: all .15s ease;
}
.dqp-btn-start, .dqp-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff;
}
.dqp-btn-start:hover, .dqp-btn-primary:hover { opacity: .9; }
.dqp-btn-outline { background: #fff; color: #475569; border: 1.5px solid #e2e8f0; }
.dqp-btn-outline:hover { border-color: #6366f1; color: #6366f1; }

/* ── START SCREEN ────────────────────────────────────────────────────────── */
.dqp-start { padding: 48px 28px; text-align: center; background: linear-gradient(160deg, #f5f3ff 0%, #fff 60%); }
.dqp-start-card { max-width: 440px; margin: 0 auto; }
.dqp-start-icon { font-size: 52px; margin-bottom: 8px; }
.dqp-start-badge {
    display: inline-block; background: #e0e7ff; color: #4338ca;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: 4px 14px; border-radius: 20px; margin-bottom: 12px;
}
.dqp-exam-title { margin: 0 0 4px; font-size: 24px; color: #1e293b; font-weight: 800; }
.dqp-exam-sub   { margin: 0 0 20px; font-size: 14px; color: #6366f1; font-weight: 600; }
.dqp-start-meta { display: flex; justify-content: center; gap: 22px; margin-bottom: 26px; flex-wrap: wrap; }
.dqp-meta-item  { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #475569; font-weight: 600; }
.dqp-meta-icon  { font-size: 16px; }
.dqp-start-note { margin-top: 16px; font-size: 12px; color: #94a3b8; }

/* ── LOADING ─────────────────────────────────────────────────────────────── */
.dqp-loading     { padding: 80px 28px; text-align: center; color: #6b7280; }
.dqp-loading-inner p { font-size: 14px; margin-top: 14px; }
.dqp-spinner {
    width: 40px; height: 40px; border: 4px solid #e2e8f0;
    border-top-color: #6366f1; border-radius: 50%;
    animation: dqp-spin .7s linear infinite; margin: 0 auto;
}
@keyframes dqp-spin { to { transform: rotate(360deg); } }

/* ── QUIZ HEADER ─────────────────────────────────────────────────────────── */
.dqp-quiz-header {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    padding: 16px 28px;
    display: flex; align-items: center; justify-content: space-between;
}
.dqp-quiz-info     { flex: 1; min-width: 0; }
.dqp-quiz-name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dqp-exam-name     { color: #fff; font-weight: 700; font-size: 14.5px; }
.dqp-badge-pyq {
    background: rgba(99,102,241,.85); color: #fff;
    font-size: 10px; font-weight: 700; letter-spacing: .1em;
    padding: 2px 8px; border-radius: 12px; text-transform: uppercase;
}
.dqp-progress-wrap  { display: flex; align-items: center; gap: 10px; }
.dqp-progress-bar   { flex: 1; height: 5px; background: rgba(255,255,255,.15); border-radius: 4px; overflow: hidden; }
.dqp-progress-fill  { height: 100%; width: 0; background: linear-gradient(90deg,#6366f1,#818cf8); border-radius: 4px; transition: width .3s ease; }
.dqp-progress-label { color: #cbd5e1; font-size: 11.5px; font-weight: 600; white-space: nowrap; }

/* ── QUESTION AREA ───────────────────────────────────────────────────────── */
.dqp-question-area {
    padding: 28px 32px 24px;
    margin-right: 266px;
    min-height: 420px;
    background: #f8fafc;
}
.dqp-qlabel {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: #4f46e5;
    background: #e0e7ff; display: inline-block;
    padding: 4px 12px; border-radius: 20px; margin: 0 0 14px;
}
.dqp-qtext {
    font-size: 15.5px; font-weight: 500; color: #1e293b;
    margin: 0 0 22px; line-height: 1.7;
}

/* ── OPTIONS ─────────────────────────────────────────────────────────────── */
.dqp-opts { display: flex; flex-direction: column; gap: 10px; }
.dqp-opt {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 13px 16px; cursor: pointer; font-size: 14px; color: #334155;
    transition: all .15s ease; line-height: 1.45;
}
.dqp-opt:hover { border-color: #6366f1; background: #eef2ff; }
.dqp-opt-label {
    background: #e2e8f0; color: #475569; font-weight: 700; font-size: 12.5px;
    min-width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s;
}
.dqp-opt.dqp-selected { border-color: #6366f1; background: #eef2ff; }
.dqp-opt.dqp-selected .dqp-opt-label { background: #6366f1; color: #fff; }

/* ── RESULT SCREEN ───────────────────────────────────────────────────────── */
.dqp-result       { padding: 44px 28px; text-align: center; }
.dqp-result-card  { max-width: 480px; margin: 0 auto; }
.dqp-result-emoji { font-size: 52px; margin-bottom: 6px; }
.dqp-result-title { font-size: 22px; color: #1e293b; margin: 0 0 20px; font-weight: 800; }
.dqp-result-ring  { position: relative; width: 132px; height: 132px; margin: 0 auto 24px; }
.dqp-result-ring svg { width: 100%; height: 100%; }
.dqp-ring-text    { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dqp-ring-pct     { font-size: 25px; font-weight: 800; color: #1e293b; }
.dqp-ring-sub     { font-size: 11px; color: #94a3b8; }
.dqp-result-stats { display: flex; justify-content: center; gap: 28px; margin-bottom: 20px; flex-wrap: wrap; }
.dqp-stat         { display: flex; flex-direction: column; align-items: center; }
.dqp-stat-val     { font-size: 24px; font-weight: 800; color: #1e293b; }
.dqp-stat-lbl     { font-size: 11.5px; color: #94a3b8; font-weight: 600; }

.dqp-clat-score {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac; border-radius: 10px;
    padding: 12px 24px; margin-bottom: 22px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
}
.dqp-clat-label { font-size: 12px; font-weight: 600; color: #166534; }
.dqp-clat-val   { font-size: 22px; font-weight: 800; color: #15803d; }

.dqp-result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── REVIEW SCREEN ───────────────────────────────────────────────────────── */
.dqp-review-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 28px; border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.dqp-review-header h2 { margin: 0; font-size: 16px; color: #1e293b; font-weight: 700; }
.dqp-review-list { padding: 8px 28px 32px; }

.dqp-rev-q { padding: 24px 0; border-bottom: 1px solid #f1f5f9; }
.dqp-rev-q:last-child { border-bottom: none; }
.dqp-rev-qnum { background: #0f3460; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 8px; }
.dqp-rev-qtext { font-size: 15px; font-weight: 500; color: #1e293b; margin: 0 0 14px; line-height: 1.65; }

.dqp-opts-review { display: flex; flex-direction: column; gap: 8px; margin-bottom: 0; }
.dqp-opt-static {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border: 1.5px solid #e2e8f0; border-radius: 8px; background: #f8fafc;
    font-size: 13.5px; color: #334155; line-height: 1.4;
}
.dqp-opt-static.dqp-correct        { border-color: #22c55e; background: #f0fdf4; color: #15803d; font-weight: 600; }
.dqp-opt-static.dqp-correct .dqp-opt-label { background: #22c55e; color: #fff; }
.dqp-opt-static.dqp-chosen-wrong   { border-color: #ef4444; background: #fef2f2; color: #b91c1c; }
.dqp-opt-static.dqp-chosen-wrong .dqp-opt-label { background: #ef4444; color: #fff; }

/* ── EXPLANATION ACCORDION ───────────────────────────────────────────────── */
.dqp-exp-wrap    { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.dqp-exp-block   { border-radius: 8px; overflow: hidden; border: 1px solid #e5e7eb; }
.dqp-exp-toggle {
    width: 100%; text-align: left; background: none; border: none;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
    color: #374151; transition: background .12s;
}
.dqp-exp-toggle:hover { background: #f9fafb; }
.dqp-exp-toggle .dqp-exp-icon { font-size: 16px; margin-right: 8px; }
.dqp-exp-toggle .dqp-exp-chevron { font-size: 12px; color: #9ca3af; transition: transform .2s; flex-shrink: 0; }
.dqp-exp-toggle.open .dqp-exp-chevron { transform: rotate(180deg); }
.dqp-exp-body {
    display: none; padding: 10px 14px 14px;
    font-size: 13px; color: #374151; line-height: 1.7;
    border-top: 1px solid #f1f5f9;
}
.dqp-exp-body.open { display: block; }

/* Color variants per section */
.dqp-exp-block[data-exp="short"]    .dqp-exp-toggle { background: #fefce8; border-bottom: 1px solid #fef08a; }
.dqp-exp-block[data-exp="short"]    .dqp-exp-body   { background: #fefce8; }
.dqp-exp-block[data-exp="correct"]  .dqp-exp-toggle { background: #f0fdf4; border-bottom: 1px solid #bbf7d0; }
.dqp-exp-block[data-exp="correct"]  .dqp-exp-body   { background: #f0fdf4; }
.dqp-exp-block[data-exp="wrong"]    .dqp-exp-toggle { background: #fff1f2; border-bottom: 1px solid #fecdd3; }
.dqp-exp-block[data-exp="wrong"]    .dqp-exp-body   { background: #fff1f2; }
.dqp-exp-block[data-exp="strategy"] .dqp-exp-toggle { background: #eff6ff; border-bottom: 1px solid #bfdbfe; }
.dqp-exp-block[data-exp="strategy"] .dqp-exp-body   { background: #eff6ff; }
.dqp-exp-block[data-exp="memory"]   .dqp-exp-toggle { background: #fdf4ff; border-bottom: 1px solid #e9d5ff; }
.dqp-exp-block[data-exp="memory"]   .dqp-exp-body   { background: #fdf4ff; }
.dqp-exp-block[data-exp="ncert"]    .dqp-exp-toggle { background: #fff7ed; border-bottom: 1px solid #fed7aa; }
.dqp-exp-block[data-exp="ncert"]    .dqp-exp-body   { background: #fff7ed; }
.dqp-exp-block[data-exp="code"]     .dqp-exp-toggle { background: #e2e8f0; border-bottom: 1px solid #cbd5e1; }
.dqp-exp-block[data-exp="code"]     .dqp-exp-body   { background: #f8fafc; padding: 0; }

.dqp-code-block {
    margin: 0;
    padding: 14px 16px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre;
    -webkit-overflow-scrolling: touch;
}
.dqp-code-block code { background: none; padding: 0; color: inherit; font-family: inherit; }

/* ── PALETTE — inherits .dq-boost palette, scoped to .dqp-pal ───────────── */
.dqp-pal {
    position: fixed;
    top: 58px; right: 0;
    width: 260px;
    max-height: calc(100vh - 66px);
    background: #fff;
    border-left: 1px solid #c2cfe0;
    border-bottom: 1px solid #c2cfe0;
    border-radius: 0 0 0 10px;
    box-shadow: -3px 4px 24px rgba(0,0,0,.14);
    z-index: 9999999;
    font-family: 'Segoe UI','Trebuchet MS',Arial,sans-serif;
    display: flex; flex-direction: column; overflow: hidden;
}
.dqp-pal .lp-hdr {
    background: linear-gradient(135deg,#1a1a2e,#0f3460);
    padding: 10px 13px;
    display: flex; align-items: center; gap: 9px; flex-shrink: 0;
}
.dqp-pal .lp-av {
    width:36px; height:36px; border-radius:50%;
    background:rgba(255,255,255,.15); border:2px solid rgba(255,255,255,.35);
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.dqp-pal .lp-info { display:flex; flex-direction:column; min-width:0; flex:1; }
.dqp-pal .lp-name { font-size:13px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dqp-pal .lp-subj { font-size:9.5px; color:rgba(255,255,255,.75); text-transform:uppercase; letter-spacing:1px; margin-top:1px; }
.dqp-pal .lp-timer {
    background:rgba(0,0,0,.28); border-radius:5px;
    padding:3px 8px; font-size:13px; font-weight:700; color:#fff;
    font-family:'Courier New',monospace; letter-spacing:1px;
    flex-shrink:0; min-width:62px; text-align:center;
}
.dqp-pal .lp-timer.lp-warn { background:rgba(220,38,38,.85); animation:dqp-blink 1s infinite; }
@keyframes dqp-blink { 0%,100%{opacity:1} 50%{opacity:.42} }

.dqp-pal .lp-legend {
    display:grid; grid-template-columns:1fr 1fr;
    gap:5px 4px; padding:9px 12px 8px;
    background:#f5f8fc; border-bottom:1px solid #dde4ef; flex-shrink:0;
}
.dqp-pal .lp-leg-row { display:flex; align-items:center; gap:6px; font-size:9.5px; color:#374151; font-weight:500; line-height:1.3; }
.dqp-pal .lp-full    { grid-column:1/-1; }
.dqp-pal .lp-lb {
    width:22px; height:22px; min-width:22px;
    display:inline-flex; align-items:center; justify-content:center;
    font-size:10px; font-weight:700; color:#fff;
    flex-shrink:0;
}
.dqp-pal .lp-lb-nv  { background:#94a3b8; border-radius:4px; }
.dqp-pal .lp-lb-na  { background:#dc2626; border-radius:4px; }
.dqp-pal .lp-lb-ans { background:#16a34a; border-radius:4px; }
.dqp-pal .lp-lb-mk  { background:#7c3aed; border-radius:50%; }
.dqp-pal .lp-lb-am  { background:#7c3aed; border-radius:50%; position:relative; }
.dqp-pal .lp-lb-am::after {
    content:''; position:absolute; bottom:-3px; right:-4px;
    width:11px; height:11px; border-radius:2px; border:1.5px solid #fff;
    background:#16a34a; display:block;
}
.dqp-pal .lp-sec {
    background:#1e3f7a; color:#fff;
    font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em;
    padding:5px 12px; flex-shrink:0;
}
.dqp-pal .lp-scroll { flex:1; overflow-y:auto; padding:8px 10px; }
.dqp-pal .lp-grid   { display:grid; grid-template-columns:repeat(5,1fr); gap:5px; }
.dqp-pal .lp-q {
    aspect-ratio:1; display:flex; align-items:center; justify-content:center;
    font-size:11px; font-weight:700; color:#fff; border-radius:4px;
    cursor:pointer; background:#94a3b8; transition:transform .1s;
}
.dqp-pal .lp-q:hover  { transform:scale(1.1); }
.dqp-pal .lp-q.lp-nv  { background:#94a3b8; }
.dqp-pal .lp-q.lp-na  { background:#dc2626; }
.dqp-pal .lp-q.lp-ans { background:#16a34a; }
.dqp-pal .lp-q.lp-mk  { background:#7c3aed; border-radius:50%; }
.dqp-pal .lp-q.lp-am  { background:#7c3aed; border-radius:50%; }
.dqp-pal .lp-q.lp-cur { outline:3px solid #f59e0b; outline-offset:1px; }

.dqp-pal .lp-btns  { padding:8px 10px 10px; display:flex; flex-direction:column; gap:5px; border-top:1px solid #e5e7eb; flex-shrink:0; }
.dqp-pal .lp-btn {
    width:100%; padding:7px 10px; border:none; border-radius:6px;
    font-size:11.5px; font-weight:600; cursor:pointer; transition:opacity .15s;
}
.dqp-pal .lp-btn:hover { opacity:.85; }
.dqp-pal .lp-btn-sm  { background:#fff3cd; color:#92400e; border:1px solid #fde68a; }
.dqp-pal .lp-btn-mk  { background:#ede9fe; color:#6d28d9; border:1px solid #ddd6fe; }
.dqp-pal .lp-btn-cl  { background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; }
.dqp-pal .lp-btn-sn  { background:linear-gradient(135deg,#22c55e,#16a34a); color:#fff; }
.dqp-pal .lp-btn-sub { background:linear-gradient(135deg,#4f46e5,#6366f1); color:#fff; }

/* ── TIME'S UP OVERLAY ───────────────────────────────────────────────────── */
.dqp-timeup-overlay {
    display:none; position:fixed; inset:0;
    background:rgba(0,0,0,.7); z-index:99999999;
    align-items:center; justify-content:center;
}
.dqp-timeup-overlay.show { display:flex; }
.dqp-cup-box {
    background:#fff; border-radius:16px; padding:36px 40px; text-align:center;
    box-shadow:0 8px 40px rgba(0,0,0,.3); max-width:340px;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .dqp-question-area { margin-right: 0; padding: 18px 16px; }
    .dqp-pal { display: none !important; }
    .dqp-start-meta { flex-direction: column; align-items: center; gap: 10px; }
}

/* ── Match-the-Following table (rendered from pipe-table markdown) ── */
.dqp-match-table { width:100%; border-collapse:collapse; margin:10px 0 16px; font-size:14px; border-radius:6px; overflow:hidden; }
.dqp-match-table th { background:#e8edf8; font-weight:600; text-align:left; padding:8px 14px; border:1px solid #c8d3e8; color:#1e293b; }
.dqp-match-table td { padding:7px 14px; border:1px solid #dde4f0; color:#334155; vertical-align:top; }
.dqp-match-table tbody tr:nth-child(even) { background:#f6f8fc; }

/* ── Numbered stem list (Arrange / Choose-correct questions) ── */
.dqp-stem-list { margin:8px 0 10px 18px; padding:0; }
.dqp-stem-list li { color:#334155; font-size:14px; line-height:1.6; margin-bottom:4px; }

/* ── Multi-paragraph question text ── */
.dqp-qpara { margin:0 0 8px; color:#1e293b; font-size:15px; line-height:1.65; }
