/* Shared styles for Connor's SAT prep site — matches vocab.html theme */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: #1a1a2e; color: #eee; min-height: 100vh; padding: 16px; }
.wrap { max-width: 720px; margin: 0 auto; }
a { color: #a78bfa; }

h1 { text-align: center; font-size: 1.5em; color: #a78bfa; margin-bottom: 4px; }
.page-subtitle { text-align: center; font-size: 0.9em; color: #888; margin-bottom: 22px; }

/* top nav */
.topnav { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.topnav a { text-decoration: none; padding: 7px 14px; border-radius: 10px; border: 2px solid #374151; background: #20203a; color: #999; font-size: 0.82em; font-weight: 700; transition: all 0.2s; }
.topnav a:hover { border-color: #7c3aed; color: #a78bfa; }
.topnav a.current { border-color: #7c3aed; background: #2d2d4e; color: #a78bfa; }

/* homepage cards */
.card-grid { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.card { display: block; text-decoration: none; border: 2px solid #374151; border-radius: 16px; background: #20203a; padding: 20px 22px; transition: all 0.2s; }
.card:hover { border-color: #7c3aed; background: #262648; transform: translateY(-2px); }
.card-icon { font-size: 2em; margin-bottom: 8px; }
.card-title { font-size: 1.15em; font-weight: 800; color: #fff; margin-bottom: 4px; }
.card-desc { font-size: 0.88em; color: #aaa; line-height: 1.45; }

/* resources / info boxes */
.info-box { background: #2d2a1a; border: 1px solid #92722a; border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; font-size: 0.85em; color: #e0c87a; line-height: 1.55; }
.info-box strong { color: #f0d98a; }
.res-box { background: #20203a; border: 1px solid #374151; border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.res-box h2 { font-size: 1em; color: #a78bfa; margin-bottom: 10px; }
.res-box ul { list-style: none; }
.res-box li { padding: 7px 0; border-top: 1px solid #2d2d4e; font-size: 0.88em; line-height: 1.5; }
.res-box li:first-child { border-top: none; }
.res-box a { font-weight: 700; text-decoration: none; }
.res-box a:hover { text-decoration: underline; }
.res-note { color: #888; font-size: 0.95em; }

/* practice controls */
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.topic-select { flex: 1; min-width: 150px; padding: 9px 12px; border-radius: 10px; border: 2px solid #374151; background: #1f1f3a; color: #eee; font-size: 0.88em; outline: none; }
.topic-select:focus { border-color: #7c3aed; }
.btn { padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer; font-weight: 700; font-size: 0.88em; transition: all 0.15s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #7c3aed; color: white; }
.btn-primary:hover:not(:disabled) { background: #8b5cf6; }
.btn-ghost { background: transparent; color: #a78bfa; border: 2px solid #7c3aed; }
.btn-ghost:hover:not(:disabled) { background: #2d2d4e; }

/* scoreboard */
.scoreboard { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.score-pill { background: #20203a; border: 1px solid #374151; border-radius: 20px; padding: 6px 16px; font-size: 0.8em; color: #ccc; }
.score-pill b { color: #a78bfa; }
.score-pill.correct b { color: #86efac; }
.score-pill.wrong b { color: #fca5a5; }
.reset-score { background: none; border: none; color: #666; font-size: 0.75em; cursor: pointer; text-decoration: underline; }

/* question card */
.q-card { background: #20203a; border: 2px solid #374151; border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.q-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.q-topic-tag { font-size: 0.7em; font-weight: 700; text-transform: uppercase; padding: 4px 11px; border-radius: 20px; background: #3d2d6e; color: #a78bfa; letter-spacing: 0.5px; }
.q-topic-tag.diff-medium { background: #3a3115; color: #e0c87a; }
.q-topic-tag.diff-hard { background: #4a1a1a; color: #fca5a5; }
.q-passage { background: #1a1a2e; border-left: 3px solid #7c3aed; border-radius: 8px; padding: 13px 15px; margin-bottom: 14px; font-size: 0.92em; line-height: 1.65; color: #d8d8e8; white-space: pre-wrap; }
.q-text { font-size: 1.0em; line-height: 1.6; color: #fff; margin-bottom: 16px; white-space: pre-wrap; }

/* data table / figure for chart-and-graph questions */
.q-data { margin-bottom: 14px; }
.q-datanote { font-size: 0.8em; color: #c4b5fd; font-style: italic; margin-bottom: 12px; }
.q-data-cap { font-size: 0.8em; font-weight: 700; color: #c4b5fd; margin-bottom: 8px; text-align: center; }
.q-data-scroll { overflow-x: auto; border-radius: 10px; border: 1px solid #374151; }
.q-data table { width: 100%; border-collapse: collapse; font-size: 0.86em; min-width: 280px; }
.q-data th, .q-data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #2d2d4e; }
.q-data thead th { background: #2d2d4e; color: #a78bfa; font-weight: 700; border-bottom: 2px solid #7c3aed; white-space: nowrap; }
.q-data tbody tr:last-child td { border-bottom: none; }
.q-data tbody tr:nth-child(even) { background: #1d1d36; }
.q-data td { color: #ddd; }

.choices { display: flex; flex-direction: column; gap: 9px; }
.choice { display: flex; gap: 11px; align-items: flex-start; padding: 12px 15px; border-radius: 11px; border: 2px solid #374151; background: #1f1f3a; color: #ddd; cursor: pointer; text-align: left; font-size: 0.92em; line-height: 1.45; transition: all 0.15s; }
.choice:hover:not(.locked) { border-color: #7c3aed; background: #2d2d4e; }
.choice .letter { font-weight: 800; color: #a78bfa; flex-shrink: 0; }
.choice.selected { border-color: #7c3aed; background: #2d2d4e; }
.choice.correct { border-color: #22c55e; background: #14532d; color: #bbf7d0; }
.choice.correct .letter { color: #86efac; }
.choice.wrong { border-color: #ef4444; background: #450a0a; color: #fca5a5; }
.choice.wrong .letter { color: #fca5a5; }
.choice.locked { cursor: default; }

/* grid-in (student produced response) */
.grid-in { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-input { flex: 1; min-width: 160px; padding: 12px 15px; border-radius: 11px; border: 2px solid #374151; background: #1f1f3a; color: white; font-size: 1.05em; outline: none; }
.grid-input:focus { border-color: #7c3aed; }
.grid-input.correct { border-color: #22c55e; background: #14532d; }
.grid-input.wrong { border-color: #ef4444; background: #450a0a; }

/* feedback + explanation */
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 0.92em; line-height: 1.6; }
.feedback.right { background: #14532d; border: 1px solid #22c55e; color: #bbf7d0; }
.feedback.wrong { background: #3a1212; border: 1px solid #ef4444; color: #fecaca; }
.feedback-head { font-weight: 800; margin-bottom: 8px; font-size: 1.0em; }
.explanation { margin-top: 14px; background: #1a1a2e; border: 1px solid #374151; border-radius: 12px; padding: 14px 16px; }
.explanation h3 { font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.5px; color: #a78bfa; margin-bottom: 8px; }
.explanation p { font-size: 0.92em; line-height: 1.65; color: #d8d8e8; white-space: pre-wrap; }

.action-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.action-row .btn { flex: 1; min-width: 140px; }

.status-msg { text-align: center; color: #888; font-size: 0.88em; padding: 18px 0; line-height: 1.6; }
.status-msg.error { color: #fca5a5; }
.loader { display: inline-block; width: 18px; height: 18px; border: 3px solid #374151; border-top-color: #7c3aed; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.source-tag { text-align: center; font-size: 0.72em; color: #555; margin-top: 4px; }

/* settings (API key) */
.settings-bar { text-align: center; margin-bottom: 16px; }
.settings-bar button { background: none; border: 1px solid #374151; color: #888; border-radius: 20px; padding: 5px 14px; font-size: 0.76em; cursor: pointer; }
.settings-bar button:hover { border-color: #7c3aed; color: #a78bfa; }
.settings-bar button.key-set { border-color: #22c55e; color: #86efac; }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: #20203a; border: 2px solid #7c3aed; border-radius: 16px; padding: 22px; max-width: 460px; width: 100%; }
.modal h2 { color: #a78bfa; font-size: 1.1em; margin-bottom: 10px; }
.modal p { font-size: 0.84em; color: #bbb; line-height: 1.55; margin-bottom: 12px; }
.modal input { width: 100%; padding: 11px 14px; border-radius: 10px; border: 2px solid #374151; background: #1f1f3a; color: white; font-size: 0.9em; outline: none; margin-bottom: 12px; }
.modal input:focus { border-color: #7c3aed; }
.modal .modal-actions { display: flex; gap: 10px; }
.modal .modal-actions .btn { flex: 1; }
.modal .warn { font-size: 0.76em; color: #e0c87a; }

footer { text-align: center; color: #555; font-size: 0.78em; margin-top: 30px; padding-bottom: 20px; }
