/*
 * Practice Maths — Shared Stylesheet
 * Queensland Education System | Grades 7–12
 * Created by Rachel Dudley
 */

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, sans-serif;
    background: #fff8f0;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
    background: linear-gradient(135deg, #9b59b6, #ffd700);
    color: white;
    text-align: center;
    padding: 1.1rem 1rem;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
    z-index: 100;
    position: relative;
}

/* ============================================================
   NAVIGATION  (all grades shown on every page)
   ============================================================ */
body > nav {
    display: flex;
    justify-content: center;
    background: #f8e8b6;
    padding: 0.55rem 0.8rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.09);
    flex-shrink: 0;
    z-index: 99;
}

body > nav a {
    text-decoration: none;
    color: #9b59b6;
    font-weight: bold;
    padding: 0.32rem 0.7rem;
    border: 2px solid #9b59b6;
    border-radius: 8px;
    transition: background 0.25s, color 0.25s;
    font-size: 0.88rem;
    white-space: nowrap;
}

body > nav a:hover,
body > nav a.active {
    background: #9b59b6;
    color: white;
}


/* ============================================================
   FOOTER
   ============================================================ */
footer {
    text-align: center;
    padding: 0.9rem 1rem;
    background: #c690dc;
    font-size: 0.88rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.08);
}

/* ============================================================
   SCROLLABLE CONTENT AREA
   ============================================================ */
.main-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2rem;
    scroll-behavior: smooth;
}

.page-content-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

.page-content-wrapper--wide {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

/* ============================================================
   LOGOUT BUTTON  (injected into header by site.js)
   Sits in the top-right corner of the header banner.
   ============================================================ */
.nav-logout-btn {
    position: absolute;
    top: 50%;
    right: 1.2rem;
    transform: translateY(-50%);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: bold;
    color: white;
    background: rgba(0, 0, 0, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 0.3rem 0.85rem;
    cursor: pointer;
    transition: background 0.22s, border-color 0.22s;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.nav-logout-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: white;
}

/* ============================================================
   TOPIC PAGE — BACK TO GRADE LINK
   Injected by site.js above the page title on topic pages.
   ============================================================ */
.topic-back-link {
    display: inline-block;
    margin-bottom: 0.75em;
    color: #7b5ea7;
    font-size: 0.88em;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.2px;
}
.topic-back-link:hover {
    text-decoration: underline;
}

/* ============================================================
   LOCKED GRADE LINKS  (user has no subscription for that grade)
   Dimmed + padlock icon. Clicking redirects to subscribe page.
   ============================================================ */
body > nav a.nav-grade-locked {
    opacity: 0.42;
}
body > nav a.nav-grade-locked:hover {
    background: transparent;
    color: #9b59b6;
}
body > nav a.nav-grade-locked::after {
    content: " 🔒";
    font-size: 0.7em;
    vertical-align: middle;
}
.card.nav-grade-locked {
    opacity: 0.45;
    cursor: pointer;
}
.card.nav-grade-locked:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    background: #fff !important;
}
.card.nav-grade-locked a::after {
    content: " 🔒";
    font-size: 0.75em;
}

/* ============================================================
   HOME PAGE LAYOUT
   ============================================================ */
.home-content {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero {
    text-align: center;
    max-width: 780px;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.8rem;
    color: #a36eb8;
    margin: 0 0 0.5rem;
}

.hero p {
    font-size: 1.15rem;
    color: #555;
    margin: 0;
}

/* ============================================================
   CARD GRID  (home page grades, topic page lessons)
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    width: 100%;
}

.card {
    background: #fff;
    border: 2px solid #ffd700;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    padding: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}

.card:hover {
    background: #fdf6d6;
    transform: scale(1.025);
    box-shadow: 0 8px 18px rgba(158,100,181,0.22);
}

.card a {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 80px;
}

/* ============================================================
   GRADE / TOPIC INDEX LIST
   ============================================================ */
h1.page-title {
    text-align: center;
    font-size: 2.6rem;
    color: #a36eb8;
    margin: 0 0 2rem;
}

.topic-section { margin-bottom: 2.5rem; }

.topic-section h2 {
    font-size: 1.7rem;
    color: #9b59b6;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 0.45rem;
    margin: 0 0 1.1rem;
}

.topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.3rem;
}

.topic-list li {
    background: #fff;
    border: 2px solid #ffd700;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: box-shadow 0.25s, transform 0.25s, background 0.25s;
    display: flex;
    align-items: stretch;
    min-height: 110px;
}

.topic-list li:hover {
    box-shadow: 0 8px 18px rgba(158,100,181,0.22);
    transform: scale(1.025);
}

.topic-list li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 1.4rem;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 1.2rem;
    text-align: center;
    width: 100%;
    transition: background 0.2s, color 0.2s;
}

.topic-list li a:hover {
    background: #fdf6d6;
    color: #9b59b6;
}

/* Placeholder / coming-soon style */
.topic-list li.coming-soon {
    opacity: 0.5;
}

.topic-list li.coming-soon a {
    color: #aaa;
    cursor: default;
    pointer-events: none;
    font-style: italic;
}

/* ============================================================
   LESSON TITLE
   ============================================================ */
h1.lesson-title {
    text-align: center;
    font-size: 2.1rem;
    color: #a36eb8;
    margin: 0 0 1.2rem;
    line-height: 1.3;
}

/* ============================================================
   LESSON BOX  (tabs: Lesson Guide | Video Tutorial)
   ============================================================ */
.lesson-box {
    background: white;
    border-left: 5px solid #9b59b6;
    border-radius: 4px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.tab-header {
    display: flex;
    background: #f4ecf7;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    flex: 1;
    padding: 0.9rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: #888;
    transition: background 0.25s, color 0.25s;
    outline: none;
}

.tab-button:hover { background: #eaddf0; color: #555; }

.tab-button.active {
    background: white;
    color: #9b59b6;
    border-top: 4px solid #9b59b6;
    border-bottom: 2px solid white;
    margin-bottom: -1px;
}

.tab-content {
    display: none;
    padding: 1.5rem;
    animation: fadeIn 0.4s;
}

.tab-content.active { display: block; }

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

.lesson-box h3 {
    color: #9b59b6;
    margin-top: 0;
    border-bottom: 1px solid #ede;
    padding-bottom: 0.45rem;
}

/* ============================================================
   KEY TERMS
   ============================================================ */
.key-terms {
    background: #f9f0ff;
    border-left: 3px solid #9b59b6;
    border-radius: 6px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    color: #555;
}

.key-terms strong { color: #333; font-style: normal; }

/* ============================================================
   HOT TIP
   ============================================================ */
.hot-tip {
    background: #fdf6d6;
    border: 1px solid #ffd700;
    border-radius: 8px;
    padding: 0.75rem 1rem 0.75rem 2.7rem;
    margin: 1.2rem 0;
    position: relative;
}

.hot-tip::before {
    content: "💡";
    font-size: 1.3rem;
    position: absolute;
    left: 0.65rem;
    top: 0.6rem;
    line-height: 1;
}

.hot-tip strong { color: #b8860b; }

/* ============================================================
   WORKED EXAMPLE  (green box before practice questions)
   ============================================================ */
.worked-example {
    background: #f0fff4;
    border: 1px solid #68c97a;
    border-left: 4px solid #2d7a2d;
    border-radius: 8px;
    padding: 1.1rem 1.4rem;
    margin: 1.3rem 0;
}

.worked-example h4 {
    color: #1e5c1e;
    margin: 0 0 0.8rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.worked-example h4::before { content: "✏️"; }

.we-step {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 0.4rem 0.8rem;
    margin-bottom: 0.5rem;
    align-items: start;
    font-size: 0.96rem;
}

.we-num {
    background: #2d7a2d;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.we-answer {
    background: #d4edda;
    border: 1px solid #b8dabd;
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    font-weight: bold;
    color: #1e5c1e;
    margin-top: 0.5rem;
    display: inline-block;
    grid-column: 2;
}

/* ============================================================
   VIDEO — lesson tutorial embed
   ============================================================ */
.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #111;
    border-radius: 8px;
}

.video-responsive iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* Video coming-soon placeholder */
.video-placeholder {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a1a4e 100%);
    border-radius: 8px;
    overflow: hidden;
}

.video-placeholder-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 1rem;
}

.video-placeholder-inner .play-icon { font-size: 3rem; margin-bottom: 0.5rem; opacity: 0.55; }
.video-placeholder-inner p { margin: 0; font-size: 1rem; }
.video-placeholder-inner small { opacity: 0.6; margin-top: 0.3rem; display: block; }

/* ============================================================
   DIFFICULTY LABELS  (★ Fluency  ★★ Understanding  ★★★ Problem Solving)
   ============================================================ */
.diff {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

.diff-1 { background: #e6f7e6; color: #1e7e1e; }       /* Fluency */
.diff-2 { background: #e3f0fd; color: #1155aa; }       /* Understanding */
.diff-3 { background: #fff2e6; color: #cc5500; }       /* Problem Solving */

/* ============================================================
   QUESTIONS SECTION
   ============================================================ */
h2.questions-header {
    font-size: 1.8rem;
    color: #9b59b6;
    border-bottom: 3px solid #ffd700;
    padding-bottom: 0.45rem;
    margin: 2.5rem 0 1.4rem;
}

.question-list {
    counter-reset: question-counter;
    list-style: none;
    padding: 0;
    margin: 0;
}

.question-item {
    margin-bottom: 1.8rem;
    background: white;
    padding: 1.4rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #eeebf5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.question-item > h4 {
    margin: 0 0 0.7rem;
    color: #333;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.question-item > h4::before {
    counter-increment: question-counter;
    content: counter(question-counter) ".";
    color: #9b59b6;
    font-weight: 900;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* Sub-questions — column layout (worded) */
.sub-questions {
    list-style-type: lower-alpha;
    padding-left: 1.5rem;
    margin: 0.8rem 0 0;
}

.sub-questions li { margin-bottom: 0.7rem; padding-left: 0.3rem; }

/* Word-problem list — numbered items with same spacing as sub-questions */
.worded-list {
    padding-left: 1.5rem;
    margin: 0.8rem 0 0;
}
.worded-list li { margin-bottom: 0.7rem; padding-left: 0.3rem; }

/* Sub-questions — 2-column grid (short numerical) */
.sub-questions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1.5rem;
    list-style-type: lower-alpha;
    padding-left: 1.5rem;
    margin: 0.8rem 0 0;
}

/* ============================================================
   FRACTION DISPLAY  (stacked: numerator / vinculum / denominator)
   ============================================================ */
.frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    font-size: 0.88em;
    line-height: 1;
    margin: 0 0.12em;
    gap: 1px;
}

.frac .num {
    border-bottom: 1.5px solid currentColor;
    padding: 0 4px 2px;
    text-align: center;
    min-width: 1.2em;
}

.frac .den {
    padding: 2px 4px 0;
    text-align: center;
    min-width: 1.2em;
}

/* ============================================================
   MATH TABLE
   ============================================================ */
.math-table {
    width: 100%;
    max-width: 480px;
    margin: 1rem 0;
    border-collapse: collapse;
    border: 2px solid #9b59b6;
    font-size: 0.94rem;
}

.math-table th,
.math-table td {
    border: 1px solid #ddd;
    padding: 7px 12px;
    text-align: left;
}

.math-table th {
    background: #f3e5f5;
    font-weight: 600;
}

/* ============================================================
   FORMULA TABLE (data / results tables used throughout G7–G12)
   ============================================================ */
.formula-table {
    width: 100%;
    max-width: 520px;
    margin: 1rem 0;
    border-collapse: collapse;
    border: 2px solid #4a90d9;
    font-size: 0.94rem;
}

.formula-table th,
.formula-table td {
    border: 1px solid #c4d8f0;
    padding: 7px 12px;
    text-align: left;
}

.formula-table th {
    background: #e8f1fb;
    font-weight: 600;
}

/* ============================================================
   SHAPE GRID (SVG diagram layouts in questions)
   ============================================================ */
.shape-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0.8rem 0 1rem;
    align-items: flex-end;
}
.shape-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.88rem;
    color: #555;
}

/* ============================================================
   SEE ANSWERS BUTTON
   ============================================================ */
.answers-container {
    text-align: center;
    margin-top: 2.5rem;
    margin-bottom: 0.5rem;
}

.btn-answers {
    display: inline-block;
    background: #9b59b6;
    color: white;
    font-size: 1.15rem;
    font-weight: bold;
    text-decoration: none;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(155,89,182,0.3);
    transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.btn-answers:hover {
    background: #8e44ad;
    transform: translateY(-3px);
    box-shadow: 0 7px 18px rgba(155,89,182,0.45);
}

/* ============================================================
   PREV / NEXT LESSON NAVIGATION
   ============================================================ */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0e6f6;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-prev,
.btn-next {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: white;
    color: #9b59b6;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    border: 2px solid #9b59b6;
    transition: background 0.25s, color 0.25s;
}

.btn-prev:hover,
.btn-next:hover {
    background: #9b59b6;
    color: white;
}

.btn-prev.disabled,
.btn-next.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ============================================================
   ANSWER TRIGGER BUTTONS  (solutions pages — individual reveal)
   ============================================================ */
.answer-trigger {
    cursor: default;
    color: #1a1a1a;
    font-weight: bold;
    text-decoration: none;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    padding: 0;
}

.answer-trigger:hover { color: #1a1a1a; }

/* ============================================================
   SHOW ALL ANSWERS BUTTON  (questions + review pages)
   ============================================================ */
.show-all-answers-wrap {
    margin: 1.4rem 0 1rem;
    text-align: center;
}

.show-all-answers-btn {
    display: inline-block;
    background: #9b59b6;
    color: #fff;
    border: none;
    padding: 0.65rem 1.8rem;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background 0.18s, transform 0.1s;
}

.show-all-answers-btn:hover {
    background: #7d3c98;
    transform: translateY(-1px);
}

.show-all-answers-btn:active {
    transform: translateY(0);
}

/* ============================================================
   VIDEO MODAL  (solutions pages)
   ============================================================ */
.video-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0,0,0,0.82);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fefefe;
    margin: auto;
    padding: 20px;
    border-radius: 12px;
    width: 85%;
    max-width: 820px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: modalSlideIn 0.35s ease;
}

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

.close-btn {
    position: absolute;
    top: 10px; right: 18px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.25s;
    background: none;
    border: none;
    padding: 0;
}

.close-btn:hover { color: #9b59b6; }

.modal-header {
    margin-bottom: 14px;
    font-size: 1.05rem;
    color: #333;
    font-weight: bold;
    padding-right: 35px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================================
   SHARED JAVASCRIPT NOTE
   Every questions page uses openTab() — paste this script block:

   <script>
   function openTab(evt, tabName) {
       document.querySelectorAll('.tab-content').forEach(t => {
           t.style.display='none'; t.classList.remove('active');
       });
       document.querySelectorAll('.tab-button').forEach(b => b.classList.remove('active'));
       document.getElementById(tabName).style.display='block';
       document.getElementById(tabName).classList.add('active');
       evt.currentTarget.classList.add('active');
       if (tabName !== 'tab-video') {
           const f = document.getElementById('lessonVideoFrame');
           if (f) { const s=f.src; f.src=''; f.src=s; }
       }
   }
   </script>

   Every solutions page uses modal JS — paste the modal script block.
   ============================================================ */

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

@media (max-width: 600px) {
    header { font-size: 1.35rem; padding: 0.9rem; }
    nav { padding: 0.45rem 0.6rem; gap: 0.35rem; }
    nav a { font-size: 0.8rem; padding: 0.28rem 0.55rem; }
    h1.lesson-title { font-size: 1.6rem; }
    h1.page-title { font-size: 2rem; }
    .hero h1 { font-size: 2rem; }
    .main-scroll-area { padding: 1rem; }
    .card-grid { grid-template-columns: 1fr; }
    .topic-list { grid-template-columns: 1fr; }
    .sub-questions-grid { grid-template-columns: 1fr; }
    .lesson-nav { flex-direction: column; }
    .lesson-nav a { text-align: center; justify-content: center; }
    .modal-content { width: 95%; padding: 14px; }
    .worked-example { padding: 0.9rem 1rem; }
}

@media (min-width: 1200px) {
    .card { min-height: 140px; font-size: 1.5rem; }
    .card-grid { gap: 2rem; max-width: 1200px; }
}

/* ============================================================
   TOPIC REVIEW CARD  (topic pages)
   ============================================================ */
.topic-review-card {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%) !important;
    border-color: #9b59b6 !important;
}

.topic-review-card a {
    color: white !important;
    font-weight: 700 !important;
}

.topic-review-card a:hover {
    background: rgba(255,255,255,0.12) !important;
    color: white !important;
}

/* ============================================================
   BACK TO TOPIC BUTTON  (lesson-nav)
   ============================================================ */
.btn-topic {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #f4ecf7;
    color: #9b59b6;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    border: 2px solid #9b59b6;
    transition: background 0.25s, color 0.25s;
}

.btn-topic:hover {
    background: #9b59b6;
    color: white;
}

/* ============================================================
   REVIEW BANNER  (review pages)
   ============================================================ */
.review-banner {
    background: linear-gradient(135deg, #f4ecf7 0%, #fdf6d6 100%);
    border: 2px solid #9b59b6;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.review-banner p {
    margin: 0.3rem 0 0;
    color: #555;
    font-size: 0.95rem;
}

.review-banner strong {
    color: #9b59b6;
    font-size: 1.05rem;
}

/* ============================================================
   BREADCRUMB NAVIGATION
   ============================================================ */
.breadcrumb {
    font-size: 0.88rem;
    color: #666;
    margin: 0 0 1.2rem 0;
    padding: 0.4em 0;
    border-bottom: 1px solid #e8e8e8;
}

.breadcrumb a {
    color: #4a90c4;
    text-decoration: none;
}

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

.breadcrumb .sep {
    margin: 0 0.4em;
    color: #bbb;
}

/* ============================================================
   VIDEO EMBED (Visual Guide tab)
   ============================================================ */
.video-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-coming-soon {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    color: #888;
}

.video-coming-soon .play-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.video-coming-soon p {
    margin: 0.3rem 0;
}

/* ============================================================
   LESSON GUIDE TAB
   ============================================================ */
.lesson-guide {
    line-height: 1.75;
}

.lesson-guide h3 {
    color: #2c5f8a;
    border-bottom: 2px solid #4a90c4;
    padding-bottom: 0.3em;
    margin-top: 1.5em;
}

.lesson-guide h4 {
    color: #333;
    margin-top: 1.2em;
}

.lesson-guide .guide-example {
    background: #f0f6fb;
    border-left: 4px solid #4a90c4;
    border-radius: 0 6px 6px 0;
    padding: 0.8em 1em;
    margin: 0.8em 0;
}

.lesson-guide .guide-example strong {
    display: block;
    margin-bottom: 0.4em;
    color: #2c5f8a;
}

.lesson-guide .guide-step {
    margin: 0.4em 0;
    padding-left: 1em;
}

.lesson-guide .guide-tip {
    background: #fff8e1;
    border: 2px solid #f9a825;
    border-radius: 6px;
    padding: 0.6em 1em;
    margin: 0.8em 0;
    font-size: 0.95em;
}

/* ============================================================
   ANSWER REVEAL  (shared: solutions + review pages)
   ============================================================ */

/* solution-content and solution-toggle: older G12 toggle pattern.
   JS always shows solution-content and hides solution-toggle. */
.solution-toggle { display: none; }

.solution-content {
    background: #f8f8f8;
    border-left: 3px solid #9b59b6;
    border-radius: 0 6px 6px 0;
    padding: 0.7em 1em;
    margin-top: 0.4em;
    font-size: 0.97em;
    line-height: 1.6;
}

.answer-content {
    background: #f8f8f8;
    border-left: 3px solid #9b59b6;
    border-radius: 0 6px 6px 0;
    padding: 0.7em 1em;
    margin-top: 0.4em;
    font-size: 0.97em;
    line-height: 1.6;
    animation: fadeIn 0.2s ease;
}

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

.answer-content p { margin: 0.3em 0; }

.answer-video-section {
    margin-top: 0.7em;
    padding-top: 0.6em;
    border-top: 1px solid #e0d0e8;
}

.watch-solution-btn {
    background: #e8401a;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.4em 1em;
    font-size: 0.9em;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.watch-solution-btn:hover { background: #c0341a; }

.watch-solution-soon {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.watch-solution-soon:hover { background: #e0e0e0; }

/* ============================================================
   VIEW SOLUTION LINK BUTTON  (solutions + review-solutions pages)
   Replaces the old greyed-out disabled button. Always clickable.
   ============================================================ */
.btn-sol {
    display: inline-block;
    background: #9b59b6;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.18em 0.65em;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    margin-left: 0.55em;
    vertical-align: middle;
    line-height: 1.7;
}

.btn-sol:hover { background: #7d3c98; color: #fff; text-decoration: none; }

/* ============================================================
   YOUTUBE MODAL
   ============================================================ */
.yt-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.yt-modal-box {
    background: #111;
    border-radius: 10px;
    width: 100%;
    max-width: 860px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

.yt-modal-close {
    position: absolute;
    top: 0.4rem;
    right: 0.7rem;
    background: none;
    border: none;
    color: #ccc;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s;
}

.yt-modal-close:hover { color: #fff; }

.yt-modal-header {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    color: #eee;
    font-size: 0.95rem;
    background: #1a1a1a;
}

.yt-modal-body {
    padding: 0;
}
