:root {
    --bg-primary: #0f1419;
    --bg-secondary: #192734;
    --bg-card: #22303c;
    --text-primary: #f7f9f9;
    --text-secondary: #8899a6;
    --accent: #1da1f2;
    --accent-hover: #1a91da;
    --success: #17bf63;
    --warning: #ffad1f;
    --error: #e0245e;
    --border: #38444d;
    --shadow: rgba(0, 0, 0, 0.3);
}

:root.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f8fa;
    --bg-card: #ffffff;
    --text-primary: #14171a;
    --text-secondary: #657786;
    --accent: #1da1f2;
    --accent-hover: #1a91da;
    --border: #e1e8ed;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--accent);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.theme-btn, .mobile-menu-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

.mobile-menu-btn {
    display: none;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 200;
    transition: right 0.3s;
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-links {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 8px;
}

.mobile-nav-links a:hover {
    background: var(--bg-card);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hero */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.search-box {
    max-width: 500px;
    margin: 0 auto 2rem;
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.search-box button {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.search-box button:hover {
    background: var(--accent-hover);
}

/* Autocomplete dropdown attached to .search-box */
.search-box {
    position: relative;
}

.autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px var(--shadow);
    max-height: 350px;
    overflow-y: auto;
    text-align: left;
}

.autocomplete[hidden] {
    display: none;
}

.autocomplete-option {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.autocomplete-option:last-child {
    border-bottom: none;
}

.autocomplete-option:hover,
.autocomplete-option.active {
    background: var(--bg-secondary);
}

.autocomplete-option .opt-type {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.autocomplete-option .opt-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.quick-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Exam Boards */
.exam-boards {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.exam-boards h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.board-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.board-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.board-card h3 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.board-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.subject-count {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

/* Subjects */
.subjects {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.subjects h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.category-tab {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.category-tab:hover {
    border-color: var(--accent);
}

.category-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.subject-category {
    width: 100%;
}

.category-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    text-transform: capitalize;
    grid-column: 1 / -1;
}

.category-subjects {
    display: contents;
}

.subject-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subject-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.subject-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.subject-link:hover .subject-name {
    color: var(--accent);
}

.subject-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s;
}

.subject-papers {
    margin-top: auto;
}

.past-papers-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.past-papers-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.subject-card h3 {
    margin-bottom: 0.5rem;
}

.subject-category {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.board-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.board-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.paper-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Search results (subjects grid) */
.search-section-header {
    grid-column: 1 / -1;
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.search-section-header:first-child {
    margin-top: 0;
}

.subject-card.topic-result {
    border-left: 3px solid var(--accent);
}

.topic-id-mini {
    display: inline-block;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--bg-secondary);
    color: var(--accent);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* About */
.about {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.about h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.about-text ul {
    list-style: none;
    margin-top: 1rem;
}

.about-text li {
    padding: 0.5rem 0;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.feature {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.feature h4 {
    margin-bottom: 0.25rem;
}

.feature p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Topic & Landing Page Styles */


.ad-right {
position: fixed;
top: 60px;
right: 0;
width: 300px;
height: calc(100vh - 60px);
overflow-y: auto;
overflow-x: hidden;
z-index: 10;
padding: 0.75rem;
display: flex;
flex-direction: column;
gap: 0;
}

.ad-right .ad-unit {
min-height: 250px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg-card);
display: flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
color: var(--text-secondary);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Board/tier selector */
.selector-bar {
display: flex;
gap: 1rem;
align-items: center;
flex-wrap: wrap;
margin-bottom: 1.5rem;
}

.selector-group label {
font-size: 0.85rem;
color: var(--text-secondary);
margin-right: 0.4rem;
}

.selector-group select {
background: var(--bg-card);
color: var(--text-primary);
border: 1px solid var(--border);
border-radius: 6px;
padding: 0.4rem 0.6rem;
font-size: 0.85rem;
}

.sidebar {
width: 220px;
position: fixed;
top: 60px;
left: 0;
height: calc(100vh - 60px);
overflow-y: auto;
background: var(--bg-secondary);
border-right: 1px solid var(--border);
padding: 0.75rem 0;
z-index: 50;
}

.sidebar h3 {
font-size: 0.8rem;
text-transform: uppercase;
color: var(--text-secondary);
padding: 0.5rem 0.75rem;
margin: 0;
letter-spacing: 0.05em;
}

.sidebar ul {
list-style: none;
padding: 0;
margin: 0;
}

.sidebar li a {
display: block;
padding: 0.4rem 0.75rem;
color: var(--text-secondary);
text-decoration: none;
font-size: 0.85rem;
transition: all 0.15s;
border-left: 3px solid transparent;
}

.sidebar li a:hover {
color: var(--accent);
background: rgba(29, 161, 242, 0.08);
border-left-color: var(--accent);
}

.sidebar li a.active {
color: var(--accent);
font-weight: 600;
border-left-color: var(--accent);
background: rgba(29, 161, 242, 0.1);
}

.sidebar-toggle {
display: none;
position: fixed;
bottom: 1rem;
right: 1rem;
z-index: 200;
width: 48px;
height: 48px;
border-radius: 50%;
background: var(--accent);
color: #fff;
border: none;
font-size: 1.3rem;
cursor: pointer;
box-shadow: 0 2px 8px var(--shadow);
}

.topic-content {
padding: 1.5rem 1rem 3rem;
padding-left: 240px;
padding-right: 320px;
min-height: 100vh;
}

@media (max-width: 900px) {
.topic-content {
    padding-left: 1rem;
    padding-right: 1rem;
}
}

@media (max-width: 1280px) {
.ad-right {
display: none;
}
.topic-content {
padding-right: 1rem;
}
}

@media (max-width: 900px) {
.sidebar {
display: none;
width: 280px;
height: 100vh;
z-index: 150;
border-radius: 0;
}

.sidebar.open {
display: block;
}

.sidebar-toggle {
display: flex;
align-items: center;
justify-content: center;
}

.topic-content {
padding-left: 1rem;
padding-right: 1rem;
}
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.25rem;
}

.topic-header {
  margin-bottom: 2rem;
}

.topic-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge.foundation {
  background: rgba(23, 191, 99, 0.15);
  color: var(--success);
  border-color: var(--success);
}

.badge.higher {
  background: rgba(29, 161, 242, 0.15);
  color: var(--accent);
  border-color: var(--accent);
}

.topic-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.section {
  margin-bottom: 2rem;
}

.section h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem;
}

.section ul {
  margin: 0.5rem 0 1rem 1.5rem;
}

.section li {
  margin-bottom: 0.3rem;
}

.key-point {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 0 8px 8px 0;
}

.example {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.example-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.formula-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.05rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.comparison-table th,
.comparison-table td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.comparison-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comparison-table a {
  color: var(--accent);
  text-decoration: none;
}

.comparison-table a:hover {
  text-decoration: underline;
}

.practice-questions {
  margin: 1rem 0;
}

.question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.section ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.section ol li {
  margin-bottom: 0.4rem;
}

/* Topics Grid (Landing Pages) */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.topic-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
  border-color: var(--accent);
}

.topic-card.higher-only {
  border-left: 3px solid var(--accent);
}

.topic-id {
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-name {
  font-size: 0.9rem;
  line-height: 1.3;
}

.topic-card .badge.higher {
  flex-shrink: 0;
  margin-left: auto;
}

/* Topic Navigation */
.topic-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.topic-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
}

.topic-nav a:hover {
  text-decoration: underline;
}

/* Responsive Topic Pages */
@media (max-width: 768px) {
  .topic-header h1 {
    font-size: 1.5rem;
  }

  .section h2 {
    font-size: 1.2rem;
  }

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

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.site-footer p {
    margin: 0.5rem 0;
}

.site-footer a {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .quick-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-features {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
  .about-features {
    grid-template-columns: 1fr;
  }
}

.required-practical {
  background: #e3f2fd;
  border: 2px solid #1565c0;
  border-radius: 6px;
  padding: 18px;
  margin: 20px 0;
}

.required-practical h3 {
  color: #1565c0;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.maths-skill {
  background: #f3e5f5;
  border-left: 4px solid #7b1fa2;
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 4px;
}

.maths-skill h3 {
  color: #7b1fa2;
  margin-bottom: 8px;
  font-size: 1.05em;
}

.misconception {
  background: #fce4ec;
  border-left: 4px solid #c62828;
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 4px;
}

.misconception h3 {
  color: #c62828;
  margin-bottom: 8px;
  font-size: 1.05em;
}

.misconception .wrong {
  color: #c62828;
  text-decoration: line-through;
  font-weight: bold;
}

.misconception .right {
  color: #2e7d32;
  font-weight: bold;
}

.extended-question {
  background: #fff8e1;
  border: 2px solid #f57f17;
  padding: 18px;
  margin: 20px 0;
  border-radius: 6px;
}

.extended-question h3 {
  color: #f57f17;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.extended-question .model-answer {
  display: none;
  margin-top: 10px;
  padding: 12px 16px;
  background: #e8f5e9;
  border-radius: 4px;
  border-left: 3px solid #2e7d32;
}

.extended-question.show-answer .model-answer {
  display: block;
}

.ao3-section {
  background: #e0f2f1;
  border-left: 4px solid #00695c;
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 4px;
}

.ao3-section h3 {
  color: #00695c;
  margin-bottom: 8px;
  font-size: 1.05em;
}

:root.light-mode .required-practical { background: #e3f2fd; }
:root.light-mode .maths-skill { background: #f3e5f5; }
:root.light-mode .misconception { background: #fce4ec; }
:root.light-mode .extended-question { background: #fff8e1; }
:root.light-mode .ao3-section { background: #e0f2f1; }

:root:not(.light-mode) .required-practical { background: #1a2940; border-color: #42a5f5; }
:root:not(.light-mode) .required-practical h3 { color: #42a5f5; }
:root:not(.light-mode) .maths-skill { background: #2a1a30; border-color: #ab47bc; }
:root:not(.light-mode) .maths-skill h3 { color: #ab47bc; }
:root:not(.light-mode) .misconception { background: #301a1e; border-color: #ef5350; }
:root:not(.light-mode) .misconception h3 { color: #ef5350; }
:root:not(.light-mode) .misconception .wrong { color: #ef5350; }
:root:not(.light-mode) .misconception .right { color: #66bb6a; }
:root:not(.light-mode) .extended-question { background: #2a2510; border-color: #ffb300; }
:root:not(.light-mode) .extended-question h3 { color: #ffb300; }
:root:not(.light-mode) .extended-question .model-answer { background: #1a2e1a; border-color: #66bb6a; }
:root:not(.light-mode) .ao3-section { background: #1a2a28; border-color: #26a69a; }
:root:not(.light-mode) .ao3-section h3 { color: #26a69a; }

.disclaimer-banner {
  background: var(--bg-card);
  border: 1px solid var(--warning);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.disclaimer-banner a {
  color: var(--accent);
  text-decoration: underline;
}

.affiliate-section {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
.affiliate-section h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}
.affiliate-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}
.affiliate-card {
  display: block;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border);
  border-left: 3px solid #FF9900;
  border-radius: 8px;
  padding: 0.8rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.affiliate-card:hover {
  border-color: #FF9900;
  box-shadow: 0 4px 16px rgba(255, 153, 0, 0.2);
}
.affiliate-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.affiliate-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.affiliate-card-store {
  font-size: 0.75rem;
  color: #FF9900;
  margin-top: 0.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.affiliate-card-store img {
  height: 14px;
  width: auto;
  vertical-align: middle;
}
.affiliate-card-urgency {
  font-size: 0.65rem;
  color: #e0245e;
  margin-top: 0.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.affiliate-card[data-fastmail] .affiliate-card-icon {
  float: right;
  margin-left: 0.6rem;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  flex-shrink: 0;
}
 .fastmail-topbar {
   display: block;
   margin-bottom: 12px;
   text-decoration: none;
 }
 .fastmail-topbar[hidden] {
   display: none !important;
 }
  .fastmail-topbar img {
    display: block;
    width: 100%;
    max-width: 970px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
    transition: box-shadow 0.2s, transform 0.15s;
  }
 .fastmail-topbar:hover img {
   box-shadow: 0 4px 16px rgba(139,92,246,0.35);
   transform: translateY(-1px);
 }
 .fastmail-topbar-icon {
   width: 20px;
   height: 20px;
   vertical-align: middle;
 }
 .fastmail-topbar-text {
   color: #e0e7ff;
   font-weight: 600;
 }
 .fastmail-topbar-cta {
   color: #a78bfa;
   font-size: 0.75rem;
 }
.fastmail-trademark {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
  line-height: 1.3;
}
.ad-right .affiliate-card {
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border);
  border-left: 3px solid #FF9900;
  border-radius: 8px;
  padding: 0.8rem;
  display: block;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.ad-right .affiliate-card:hover {
  border-color: #FF9900;
  box-shadow: 0 4px 16px rgba(255, 153, 0, 0.2);
  transform: translateY(-1px);
}
.ad-right .affiliate-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}
.ad-right .affiliate-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}
.ad-right .affiliate-card-store {
  font-size: 0.7rem;
  color: #FF9900;
  margin-top: 0.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.ad-right .affiliate-card-store img {
  height: 12px;
  width: auto;
  vertical-align: middle;
}
.ad-right .affiliate-card-urgency {
  font-size: 0.65rem;
  color: #e0245e;
  margin-top: 0.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.affiliate-disclaimer {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.6rem;
  line-height: 1.4;
}
.affiliate-cta-end {
  margin: 2rem 0 1rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.affiliate-cta-end h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.affiliate-cta-end p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.affiliate-cta-end .cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.affiliate-cta-end .cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #FF9900, #e68a00);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}
.affiliate-cta-end .cta-link:hover {
  box-shadow: 0 4px 16px rgba(255, 153, 0, 0.4);
  transform: translateY(-1px);
}
.share-section {
  text-align: center;
}
.share-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.share-btn {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; }
.share-twitter { background: #1DA1F2; }
.share-facebook { background: #1877F2; }
.share-linkedin { background: #0A66C2; }
.share-whatsapp { background: #25D366; color: #fff; }
.share-copy {
  background: var(--bg-card, #22303c);
  border: 1px solid var(--border, #38444d);
  cursor: pointer;
}
.related-topics .related-group {
  margin-bottom: 1rem;
}
.related-topics h4 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--text-secondary, #8899a6);
}
.related-topics ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.related-topics li a {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--bg-card, #22303c);
  border: 1px solid var(--border, #38444d);
  border-radius: 4px;
  color: var(--text-primary, #f7f9f9);
  text-decoration: none;
  font-size: 0.8rem;
  transition: border-color 0.2s;
}
.related-topics li a:hover {
  border-color: var(--primary, #4A90D9);
}

/* ========================================
   FLASHCARD SYSTEM STYLES
   ======================================== */

.flashcard-system {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.flashcard-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  flex-wrap: wrap;
}

.flashcard-stats .stat {
  flex: 1;
  min-width: 80px;
  text-align: center;
}

.flashcard-stats .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.flashcard-stats .stat.due .stat-value { color: var(--warning); }
.flashcard-stats .stat.learned .stat-value { color: var(--success); }
.flashcard-stats .stat.new .stat-value { color: var(--accent); }
.flashcard-stats .stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.flashcard-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.flashcard-display {
  display: none;
}

.flashcard {
  perspective: 1000px;
  width: 100%;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  cursor: pointer;
  user-select: none;
}

.flashcard:focus {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  min-height: 300px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: 12px;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
}

.flashcard-back {
  transform: rotateY(180deg);
}

.flashcard-content {
  font-size: 1.25rem;
  line-height: 1.7;
  text-align: center;
  max-width: 100%;
  word-wrap: break-word;
}

.flashcard-hint {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

.flashcard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.flashcard-progress {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0 1rem;
}

.flashcard-ratings {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.rating-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 100px;
}

.rating-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rating-again {
  background: var(--error);
  color: white;
}

.rating-again:hover:not(:disabled) {
  background: #ff4444;
  transform: translateY(-2px);
}

.rating-hard {
  background: var(--warning);
  color: var(--bg-primary);
}

.rating-hard:hover:not(:disabled) {
  background: #ffcc00;
  transform: translateY(-2px);
}

.rating-good {
  background: var(--accent);
  color: white;
}

.rating-good:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.rating-easy {
  background: var(--success);
  color: white;
}

.rating-easy:hover:not(:disabled) {
  background: #2ed47a;
  transform: translateY(-2px);
}

.flashcard-progress-info {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: 6px;
}

.flashcard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flashcard-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.flashcard-list-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.flashcard-list-item.due {
  border-left: 3px solid var(--warning);
}

.flashcard-list-item.new {
  border-left: 3px solid var(--accent);
}

.flashcard-list-item .fc-item-question {
  flex: 1;
  font-size: 0.95rem;
  text-align: left;
}

.flashcard-list-item .fc-item-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: 1rem;
}

.flashcard-list-item.due .fc-item-status {
  background: rgba(255, 173, 31, 0.2);
  color: var(--warning);
}

.flashcard-list-item.new .fc-item-status {
  background: rgba(29, 161, 242, 0.2);
  color: var(--accent);
}

.flashcard-list-item:not(.due):not(.new) .fc-item-status {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.flashcard-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.flashcard-empty::before {
  content: "📇";
  display: block;
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

@media (max-width: 600px) {
  .flashcard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .flashcard-controls {
    flex-direction: column;
  }
  
  .flashcard-controls button {
    width: 100%;
  }
  
  .flashcard-inner {
    min-height: 250px;
    padding: 1rem;
  }
  
  .flashcard-content {
    font-size: 1.1rem;
  }
  
  .rating-btn {
    padding: 0.5rem 1rem;
    min-width: 80px;
    font-size: 0.8rem;
  }
}

/* ========================================
   EXAM QUESTIONS STYLES
   ======================================== */

.exam-questions-system {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.exam-header {
  margin-bottom: 1.5rem;
}

.exam-header h2 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.exam-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.exam-stats .stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.exam-stats .stat.completed {
  color: var(--success);
}

.exam-stats .stat.progress {
  color: var(--accent);
  font-size: 0.8rem;
}

.exam-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.exam-display {
  display: none;
}

.exam-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.question-number {
  font-weight: 600;
  color: var(--accent);
}

.question-marks {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.question-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.ao-badge { background: var(--accent); color: white; }
.command-badge { background: var(--warning); color: var(--bg-primary); }
.type-badge { background: var(--success); color: white; }
.year-badge { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }

.question-text {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.option:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(29, 161, 242, 0.1);
}

.option:disabled {
  cursor: default;
}

.option.correct {
  border-color: var(--success);
  background: rgba(23, 191, 99, 0.15);
}

.option.incorrect {
  border-color: var(--error);
  background: rgba(224, 36, 94, 0.15);
}

.option.selected {
  border-color: var(--accent);
  background: rgba(29, 161, 242, 0.2);
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}

.option.correct .option-letter { background: var(--success); }
.option.incorrect .option-letter { background: var(--error); }

.option-text { flex: 1; }

.checkmark { color: var(--success); font-weight: bold; }
.crossmark { color: var(--error); font-weight: bold; }

.text-answer-area {
  margin-top: 1rem;
}

.text-answer-area textarea {
  width: 100%;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
}

.text-answer-area textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.user-answer {
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.exam-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.exam-progress {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.mark-scheme {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mark-scheme.correct { border-color: var(--success); }
.mark-scheme.incorrect { border-color: var(--error); }

.ms-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.ms-header h4 {
  color: var(--text-primary);
}

.ms-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ms-points {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.ms-points li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.ms-points li:last-child { border-bottom: none; }

.ms-point-text { flex: 1; }
.ms-point-marks {
  background: var(--accent);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.ms-guidance {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.25rem;
}

.ms-exemplar {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
}

.ms-exemplar pre {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ms-errors {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(224, 36, 94, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--error);
}

.ms-errors ul {
  margin: 0.5rem 0 0;
  padding-left: 1.5rem;
}

.ms-errors li { margin-bottom: 0.25rem; }

.exam-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exam-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.exam-list-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.exam-list-item.correct {
  border-left: 3px solid var(--success);
}

.exam-list-item.incorrect {
  border-left: 3px solid var(--error);
}

.exam-list-item .eq-item-q {
  flex: 1;
  font-size: 0.9rem;
}

.exam-list-item .eq-item-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: 1rem;
}

.exam-list-item.correct .eq-item-status {
  background: rgba(23, 191, 99, 0.2);
  color: var(--success);
}

.exam-list-item.incorrect .eq-item-status {
  background: rgba(224, 36, 94, 0.2);
  color: var(--error);
}

.exam-list-item:not(.correct):not(.incorrect) .eq-item-status {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.exam-empty, .exam-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.exam-empty::before {
  content: "📝";
  display: block;
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

@media (max-width: 600px) {
  .exam-controls {
    flex-direction: column;
  }
  .exam-controls button {
    width: 100%;
  }
  .exam-nav {
    flex-direction: column;
  }
  .option {
    padding: 0.75rem;
  }
  .question-text {
    font-size: 1rem;
  }
}

/* ========================================
   TARGET TESTS STYLES
   ======================================== */

.target-tests-system {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.target-header {
  margin-bottom: 1.5rem;
}

.target-header h2 {
  margin-bottom: 0.5rem;
}

.target-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.target-test-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.target-test-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.target-test-card.passed {
  border-left: 4px solid var(--success);
}

.target-test-card.failed {
  border-left: 4px solid var(--error);
}

.target-test-card.not-attempted {
  border-left: 4px solid var(--accent);
}

.test-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.test-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.test-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.test-status.passed { background: rgba(23, 191, 99, 0.2); color: var(--success); }
.test-status.failed { background: rgba(224, 36, 94, 0.2); color: var(--error); }
.test-status.not-attempted { background: rgba(29, 161, 242, 0.2); color: var(--accent); }

.test-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.test-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.test-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
}

.pass-mark {
  background: var(--accent) !important;
  color: white !important;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.test-attempts {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.target-test-card .btn {
  width: 100%;
  margin-bottom: 0.5rem;
}

.target-test-card .btn-outline {
  width: 100%;
}

/* Active Test View */
.target-test-active {
  animation: fadeIn 0.3s ease;
}

.test-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.test-info h3 { margin: 0; }
.test-progress { font-size: 0.9rem; color: var(--text-secondary); }

.test-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-weight: 600;
}

.timer-value {
  font-family: monospace;
  font-size: 1.2rem;
  color: var(--accent);
  transition: color 0.3s;
}

.test-question-area {
  min-height: 300px;
}

.test-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.question-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.q-number { font-weight: 700; color: var(--accent); }
.q-marks { background: var(--warning); color: var(--bg-primary); padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
.q-ao { background: var(--accent); color: white; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }

.question-text {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.options { display: flex; flex-direction: column; gap: 0.5rem; }

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.option:hover:not(:disabled) { border-color: var(--accent); background: rgba(29, 161, 242, 0.1); }
.option:disabled { cursor: default; }
.option.correct { border-color: var(--success); background: rgba(23, 191, 99, 0.15); }
.option.incorrect { border-color: var(--error); background: rgba(224, 36, 94, 0.15); }
.option.selected { border-color: var(--accent); background: rgba(29, 161, 242, 0.2); }

.option-letter {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--accent); color: white;
  border-radius: 50%; font-weight: 700; flex-shrink: 0;
}
.option.correct .option-letter { background: var(--success); }
.option.incorrect .option-letter { background: var(--error); }
.option-text { flex: 1; }

.text-input-area, .textarea-area {
  display: flex; flex-direction: column; gap: 0.75rem;
}

.text-input-area input, .textarea-area textarea {
  width: 100%; padding: 1rem;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-family: inherit; font-size: 1rem;
}
.text-input-area input:focus, .textarea-area textarea:focus {
  outline: none; border-color: var(--accent);
}
.textarea-area textarea { min-height: 120px; resize: vertical; }

.user-answer-display {
  padding: 1rem; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: 6px;
  font-family: monospace;
}

.test-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 0.5rem;
}

.question-dots {
  display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center;
}

.dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); border: 2px solid var(--border);
  cursor: pointer; font-size: 0.8rem; font-weight: 600;
  transition: all 0.2s;
}
.dot:hover { border-color: var(--accent); }
.dot.active { background: var(--accent); color: white; border-color: var(--accent); }
.dot.answered { border-color: var(--success); background: rgba(23, 191, 99, 0.2); }
.dot.answered.active { background: var(--success); color: white; }

.review-notice {
  text-align: center; padding: 0.5rem;
  background: rgba(255, 173, 31, 0.2); color: var(--warning);
  border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem;
}

/* Feedback */
.question-feedback {
  margin-top: 1rem; padding: 1rem;
  background: var(--bg-secondary); border-radius: 8px;
  border-left: 3px solid var(--text-secondary);
}
.question-feedback.correct { border-color: var(--success); }
.question-feedback.incorrect { border-color: var(--error); }

.feedback-correct { color: var(--success); font-weight: 600; margin-bottom: 0.5rem; }
.feedback-incorrect { color: var(--error); font-weight: 600; margin-bottom: 0.5rem; }
.feedback-explanation { font-size: 0.9rem; color: var(--text-secondary); }
.feedback-manual { color: var(--warning); font-style: italic; }

/* Results */
.target-test-results {
  animation: fadeIn 0.3s ease;
}

.results-header {
  text-align: center; padding: 2rem 1rem; margin-bottom: 1.5rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
}
.results-header.passed { border-color: var(--success); }
.results-header.failed { border-color: var(--error); }

.results-header h2 { margin-bottom: 1rem; }
.results-header.passed h2 { color: var(--success); }
.results-header.failed h2 { color: var(--error); }

.score-circle {
  width: 140px; height: 140px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 1rem; border: 6px solid;
}
.score-circle.pass { border-color: var(--success); background: rgba(23, 191, 99, 0.1); }
.score-circle.fail { border-color: var(--error); background: rgba(224, 36, 94, 0.1); }
.score-value { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.score-circle.pass .score-value { color: var(--success); }
.score-circle.fail .score-value { color: var(--error); }
.score-detail { font-size: 0.9rem; color: var(--text-secondary); margin-top: 0.25rem; }

.results-meta { display: flex; justify-content: center; gap: 1.5rem; font-size: 0.9rem; color: var(--text-secondary); }
.auto-submit { color: var(--warning); font-weight: 600; }

.results-actions { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap; }

.question-review { display: flex; flex-direction: column; gap: 1rem; }

.review-item {
  padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; border-left: 4px solid var(--text-secondary);
}
.review-item.correct { border-color: var(--success); }
.review-item.incorrect { border-color: var(--error); }
.review-item.pending { border-color: var(--warning); }
.review-item.unanswered { border-color: var(--text-secondary); opacity: 0.6; }

.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.review-number { font-weight: 600; color: var(--accent); }
.review-status { font-weight: 600; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
.review-status.correct { background: rgba(23, 191, 99, 0.2); color: var(--success); }
.review-status.incorrect { background: rgba(224, 36, 94, 0.2); color: var(--error); }
.review-status.pending { background: rgba(255, 173, 31, 0.2); color: var(--warning); }
.review-status.unanswered { background: var(--bg-secondary); color: var(--text-secondary); }

.review-question { margin-bottom: 0.75rem; font-size: 1rem; }
.review-answer { margin-bottom: 0.5rem; }
.review-correct { margin-bottom: 0.5rem; color: var(--success); }
.review-explanation { font-size: 0.9rem; color: var(--text-secondary); font-style: italic; }

.target-empty { text-align: center; padding: 3rem; color: var(--text-secondary); }
.target-empty::before { content: "🎯"; display: block; font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

@media (max-width: 600px) {
  .tests-grid { grid-template-columns: 1fr; }
  .test-header-bar { flex-direction: column; align-items: flex-start; }
  .test-nav { flex-direction: column; }
  .question-dots { order: -1; margin-bottom: 1rem; }
  .score-circle { width: 120px; height: 120px; }
  .score-value { font-size: 2rem; }
  .results-actions { flex-direction: column; }
}
