/* ==========================================================================
   1. GLOBAL VARIABLES & BASE
   ========================================================================== */
:root {
    --bg: #f8f9fa;
    --navy: #1a1d23;
    --navy-light: #2c3e50;
    --green: #2ecc71;
    --green-dark: #27ae60;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --border: #e0e6ed;
    --text: #2d3748;
}

* { box-sizing: border-box; }
body { 
    background: var(--bg); 
    font-family: 'Inter', 'Segoe UI', sans-serif; 
    margin: 0; 
    color: var(--text);
    line-height: 1.6;
}

.container { width: 92%; max-width: 1100px; margin: auto; }
.no-scroll { overflow: hidden; }

/* ==========================================================================
   2. NAVIGATION & HEADER
   ========================================================================== */
.navbar { 
    background: var(--navy); 
    padding: 1rem 0; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}
.flex-nav { display: flex; justify-content: space-between; align-items: center; }

.logo { font-size: 1.5rem; color: white; font-weight: 800; text-decoration: none; }
.logo span { color: var(--green); }

nav a { 
    color: #ccc; 
    margin-left: 20px; 
    text-decoration: none; 
    font-size: 0.9rem; 
    transition: 0.3s; 
}
nav a:hover, nav a.active { color: var(--green); }
nav a.active { font-weight: bold; }

.mobile-toggle { 
    display: none; 
    background: none; 
    border: none; 
    color: white; 
    font-size: 1.5rem; 
    cursor: pointer; 
}

/* ==========================================================================
   3. HERO & DASHBOARD (HOME)
   ========================================================================== */
/* --- Hero Section Fix --- */
.hero-modern {
    position: relative;
    padding: 120px 0;
    text-align: center;
    color: white;
    /* Corrected Path: Go up from css folder, then into images */
    background: linear-gradient(rgba(0, 31, 63, 0.8), rgba(0, 31, 63, 0.7)), 
                url('../images/bg.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    margin-bottom: 60px;
}

.hero-modern h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.hero-modern p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* --- Modern Search Bar --- */
.search-bar {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.15); /* Glass effect */
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
}

.search-bar form { width: 100%; display: flex; }

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 25px;
    color: white;
    font-size: 1.1rem;
    outline: none;
}

.search-bar input::placeholder { color: rgba(255, 255, 255, 0.7); }

.search-bar button {
    background: var(--green);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.search-bar button:hover { transform: scale(1.05); background: #2ecc71; }

/* --- Grid & Cards Styling --- */
.hub-sections .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: -100px; /* Overlap effect onto hero */
}

.card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: 0.3s all ease;
    cursor: pointer;
    border-bottom: 4px solid transparent;
}

.card:hover {
    transform: translateY(-10px);
    border-bottom: 4px solid var(--green);
}

.card i {
    font-size: 2.5rem;
    color: var(--navy);
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--navy);
}

.card p { color: #666; line-height: 1.6; }



/* ==========================================================================
   4. SYLLABUS LAYOUT (SINGLE-PAGE VIEW)
   ========================================================================== */
.syllabus-wrapper { display: flex; min-height: calc(100vh - 70px); position: relative; }

.syllabus-sidebar {
    width: 300px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease-in-out;
    z-index: 10;
}

.topic-nav { flex: 1; overflow-y: auto; padding: 15px; }
.topic-link {
    display: flex; padding: 12px 15px; text-decoration: none;
    color: #4a5568; border-radius: 8px; margin-bottom: 4px;
    transition: 0.2s; font-size: 0.95rem;
}
.topic-link:hover { background: #f7fafc; }
.topic-link.active { background: #ebfef2; color: var(--green-dark); font-weight: 600; }
.topic-link .num { width: 45px; font-weight: bold; }

.syllabus-main { flex: 1; background: #fdfdfd; padding: 40px 20px; overflow-y: auto; }
.content-limiter { max-width: 1100px; margin: 0 auto; }

.lesson-entry { 
    background: var(--white); padding: 30px; margin-bottom: 40px; 
    border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); 
    border: 1px solid #f0f0f0; 
}
.lesson-entry h2 { margin-top: 0; color: var(--green-dark); font-size: 1.5rem; border-bottom: 2px solid var(--green); padding-bottom: 10px;}
.lesson-text { font-size: 1.05rem; }

.lesson-figure { 
    margin: 30px 0; text-align: center; background: #fff; 
    padding: 15px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
}
.lesson-figure img { max-width: 100%; height: auto; border-radius: 5px; }
.lesson-figure figcaption { margin-top: 10px; font-style: italic; color: #718096; }

/* ==========================================================================
   5. SQL INTERPRETER TOOL
   ========================================================================== */
.sql-card { background: #1e1e1e; color: #d4d4d4; border-radius: 8px; overflow: hidden; font-family: 'Consolas', monospace; margin-top: 20px;}
.sql-header { background: #333; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-size: 0.9rem; }
.sql-body { padding: 15px; }
#sqlQueryInput { 
    width: 100%; height: 80px; background: #252526; color: #9cdcfe; 
    border: 1px solid #3e3e42; border-radius: 4px; padding: 10px; 
    font-family: inherit; margin-bottom: 10px; resize: none; outline: none;
}
.btn-run { background: var(--green); color: white; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.btn-run:hover { background: var(--green-dark); }

.sql-results { background: white; color: #333; min-height: 100px; padding: 15px; border-top: 4px solid #333; }
.sql-results table { width: 100%; border-collapse: collapse; }
.sql-results th { background: #f4f4f4; text-align: left; padding: 8px; border: 1px solid #ddd; }
.sql-results td { padding: 8px; border: 1px solid #ddd; }
.sql-error { color: #e74c3c; font-weight: bold; }

/* ==========================================================================
   6. LOGIC GATE SIMULATOR (HORIZONTAL LAB)
   ========================================================================== */
.logic-lab.horizontal-layout { display: flex; height: 600px; background: #fff; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }

.lab-sidebar { 
    width: 180px; background: var(--navy-light); color: white; 
    padding: 15px; display: flex; flex-direction: column; border-right: 2px solid #1a252f; 
}
.lab-sidebar h4 { font-size: 0.8rem; margin-bottom: 15px; color: #bdc3c7; text-transform: uppercase; letter-spacing: 1px;}

.tool-buttons button { 
    width: 100%; background: #34495e; color: white; border: none; 
    padding: 10px; margin-bottom: 8px; border-radius: 4px; 
    cursor: pointer; font-size: 0.85rem; transition: 0.2s; 
}
.tool-buttons button:hover { background: var(--green-dark); }
.gate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 10px; }

.lab-main { flex: 1; display: flex; flex-direction: column; position: relative; }
.lab-workspace { 
    flex: 1; position: relative; overflow: hidden;
    background-color: #fdfdfd; 
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px); 
    background-size: 25px 25px; 
}
#wireCanvas { position: absolute; top: 0; left: 0; pointer-events: none; filter: drop-shadow(0 0 2px rgba(46, 204, 113, 0.3)); }

/* Nodes & Components */
.gate-node { position: absolute; width: 75px; background: white; padding: 5px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: grab; text-align: center; z-index: 5;}
.gate-node .label { font-size: 0.7rem; font-weight: bold; display: block; margin-top: 5px; color: #7f8c8d; }
.gate-img { width: 100%; height: auto; pointer-events: none; }

/* Pins */
.pin { width: 12px; height: 12px; background: var(--navy-light); border: 2px solid #fff; border-radius: 50%; position: absolute; cursor: crosshair; transition: 0.2s; z-index: 10; }
.pin:hover { background: var(--green); transform: scale(1.3); }
.out-pin { right: -6px; top: 22px; }
.pins-in-container { position: absolute; left: -8px; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; pointer-events: none; }
.in-pin { position: static; pointer-events: auto; }

/* Interactive States */
.val-toggle { background: var(--navy-light); color: white; border: none; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.val-toggle.active-bg { background: var(--green-dark) !important; box-shadow: 0 0 10px rgba(39, 174, 96, 0.4); }

.status-bulb { width: 35px; height: 35px; background: #444; border-radius: 50%; margin: 5px auto; border: 3px solid #222; transition: 0.3s; }
.status-bulb.on { 
    background: #f1c40f; border-color: #f39c12; 
    box-shadow: 0 0 20px 5px rgba(241, 196, 15, 0.6); 
}

.lab-footer { height: 120px; background: #f8f9fa; border-top: 1px solid #eee; padding: 10px; overflow-y: auto; }
.truth-table-container table { width: 100%; border-collapse: collapse; background: white; font-size: 0.9rem; }
.truth-table-container th, .truth-table-container td { border: 1px solid #ddd; padding: 8px; text-align: center; }

/* ==========================================================================
   7. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

/* Tablet & Mobile Header */
@media (max-width: 768px) {
    .mobile-toggle { display: block; z-index: 1001; }
    #main-nav {
        display: none; position: fixed; top: 0; right: 0;
        width: 70%; height: 100vh; background: var(--navy);
        flex-direction: column; padding-top: 80px; z-index: 1000;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    }
    #main-nav.open { display: flex; }
    #main-nav a { margin: 15px 30px; font-size: 1.2rem; color: white; }
}

/* Tablet & Mobile Syllabus/General Layout */
@media (max-width: 900px) {
    .syllabus-sidebar {
        position: fixed; left: -100%; top: 0; bottom: 0;
        width: 280px; height: 100vh; z-index: 2000;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    .syllabus-sidebar.mobile-active { left: 0; }
    .syllabus-main { width: 100%; padding: 20px 10px; }
    .content-limiter { max-width: 100%; }
    
    .sidebar-toggle-btn {
        display: block; width: 100%; background: var(--green-dark);
        color: white; border: none; padding: 12px; font-size: 1rem; cursor: pointer;
    }
    
    .logic-lab.horizontal-layout { flex-direction: column; height: auto; }
    .lab-sidebar { width: 100%; border-right: none; border-bottom: 2px solid #1a252f; }
    .lab-workspace { height: 400px; }
}

/* Highlight the row matching the current switch states */
.current-state-row {
    background-color: rgba(46, 204, 113, 0.2) !important;
    outline: 2px solid var(--green);
}

.node-rename {
    display: block;
    width: 60px;
    background: transparent;
    border: none;
    border-bottom: 1px dashed #ccc;
    color: #333;
    font-size: 0.7rem;
    text-align: center;
    margin-bottom: 5px;
    outline: none;
}
.node-rename:focus { border-bottom-color: var(--green); }

.res-on { color: var(--green-dark); font-weight: bold; }
.res-off { color: #e74c3c; }

/* Keep the footer table readable */
.truth-table-container table tr { transition: background 0.3s; }

/* Allow the footer to grow with the table */
.lab-footer {
    min-height: 100px; /* Base height */
    height: auto;      /* Remove fixed height */
    background: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 20px;
    overflow: visible; /* Prevent scrollbars */
}

.truth-table-container {
    width: 100%;
}

.truth-table-container table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Ensure table cells don't squash */
.truth-table-container th, 
.truth-table-container td {
    border: 1px solid #dfe6e9;
    padding: 12px 8px;
    text-align: center;
}

/* Header styling */
.truth-table-container thead th {
    background: #f1f2f6;
    color: #2f3542;
    font-weight: 700;
}

.logic-lab.horizontal-layout {
    display: flex;
    height: auto; /* Change from fixed height to auto */
    min-height: 600px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: visible; /* Let the table be seen */
    flex-direction: row; /* Ensure sidebar stays left */
}

/* On mobile, keep things stacked */
@media (max-width: 900px) {
    .logic-lab.horizontal-layout {
        flex-direction: column;
    }
}
.lab-sidebar button i {
    margin-right: 8px;
    font-size: 0.9rem;
}

.lab-sidebar hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 15px 0;
}
/* Task Card Styling */
.task-card {
    border-left: 5px solid var(--navy);
    background: #f0f7ff;
}

.task-card h2 {
    color: var(--navy-light);
    border-bottom: 2px solid var(--navy);
}

.task-card hr {
    border: 0;
    border-top: 1px solid #d0d7de;
    margin: 15px 0;
}

.task-card ol {
    padding-left: 20px;
}

.task-card ol li {
    margin-bottom: 10px;
    font-weight: 500;
}
/* --- Desktop State (Default) --- */
.mobile-toggle, 
.sidebar-toggle-btn, 
.close-sidebar { 
    display: none !important; /* Force hide on desktop */
}

/* Navbar Links (Desktop) */
#main-nav {
    display: flex !important;
    flex-direction: row;
    position: static;
    height: auto;
    width: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

/* --- Mobile View Adjustments --- */
@media (max-width: 900px) {
    /* Show the toggle buttons only now */
    .mobile-toggle, 
    .sidebar-toggle-btn { 
        display: block !important; 
    }

    /* Standardize the Sidebar Toggle for Syllabus */
    .sidebar-toggle-btn {
        margin: 10px;
        width: calc(100% - 20px);
        border-radius: 6px;
    }

    /* Hide the Desktop Nav and prepare the Drawer */
    #main-nav {
        display: none !important; /* Hidden until .open class is added */
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: var(--navy);
        flex-direction: column;
        padding-top: 60px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    }

    #main-nav.open {
        display: flex !important; /* Reveal via JS */
    }

    .close-sidebar {
        display: block !important;
        color: var(--navy);
        padding: 15px;
        text-align: right;
        cursor: pointer;
    }
}

.pseudo-container {
    display: flex;
    height: 500px;
    gap: 15px;
    padding: 15px;
    background: #f1f2f6;
}

.pseudo-editor-pane, .pseudo-visual-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    overflow: hidden;
}

.pane-header {
    background: #2c3e50;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 0.9rem;
}

#pseudoInput {
    flex: 1;
    padding: 15px;
    border: none;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    background: #282c34;
    color: #abb2bf;
}

.trace-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.trace-content table {
    width: 100%;
    border-collapse: collapse;
}

.trace-content th, .trace-content td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-family: monospace;
}

.trace-content th { background: #f8f9fa; }

.trace-content td code {
    color: var(--green-dark);
    font-weight: bold;
}
.res-on { background: #d4edda; }

.output-cell {
    background: #f0f9ff;
    color: #0369a1;
    font-weight: 600;
    text-align: left !important;
    padding-left: 15px !important;
    font-family: 'Consolas', monospace;
}

.instr-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Split the visual pane into Table and Console */
.pseudo-visual-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.trace-wrapper { flex: 2; border-bottom: 2px solid #ddd; overflow: hidden; display: flex; flex-direction: column; }
.console-wrapper { flex: 1; overflow: hidden; display: flex; flex-direction: column; background: #1e1e1e; }

/* Console Styling */
.console-content {
    flex: 1;
    background: #1e1e1e;
    color: #f8f8f2;
    font-family: 'Consolas', monospace;
    padding: 10px;
    font-size: 0.9rem;
    overflow-y: auto;
}

.console-line { margin-bottom: 4px; border-bottom: 1px solid #333; padding-bottom: 2px; }
.console-line span { color: var(--green); margin-right: 8px; font-weight: bold; }

.btn-clear {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    font-size: 0.7rem;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 3px;
}
.btn-clear:hover { background: #444; color: #fff; }

/* Adjust Editor for dark mode feel */
#pseudoInput {
    background: #282c34;
    color: #abb2bf;
    caret-color: var(--green);
}

/* --- SCREEN STYLING (The "Nicer Way") --- */
.exam-paper-wrapper {
    background: #e9ecef; /* Darker background to make paper pop */
    padding: 40px 0;
    display: flex;
    justify-content: center;
}

.a4-paper {
    background: white;
    width: 210mm; /* Exact A4 width */
    min-height: 297mm;
    padding: 25mm;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    font-family: "Inter", "Times New Roman", serif;
    color: #000;
}

.exam-header-block { border-bottom: 2px solid #000; margin-bottom: 30px; padding-bottom: 10px; }
.meta-row { display: flex; justify-content: space-between; font-weight: bold; font-size: 1.1rem; }
.exam-title { text-align: center; text-transform: uppercase; margin: 20px 0; font-size: 1.6rem; }
.info-line { margin: 15px 0; font-family: monospace; }

.q-block { margin-bottom: 35px; page-break-inside: avoid; }
.q-header { display: flex; gap: 10px; line-height: 1.5; }
.q-num { font-weight: bold; min-width: 25px; }
.q-text { flex: 1; }
.q-marks { font-weight: bold; }

.exam-line { height: 32px; border-bottom: 1px solid #ccc; width: 100%; }

.btn-print-main { background: var(--green); color: white; border: none; padding: 12px 25px; border-radius: 6px; cursor: pointer; font-weight: bold; }

/* --- PRINT STYLING (The Cleanup) --- */
@media print {
    /* Hide everything except the exam paper */
    header, footer, .navbar, .lab-sidebar, .exam-controls, .no-print {
        display: none !important;
    }

    body { background: white !important; }
    
    .exam-paper-wrapper { padding: 0; background: transparent; }
    
    .a4-paper {
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
    }

    /* Force the browser to respect the A4 size */
    @page {
        size: A4;
        margin: 15mm;
    }
}
.mark-scheme-item {
    margin-top: 10px;
    padding: 15px;
    background-color: #fff9db; /* Light yellow post-it note feel */
    border-left: 4px solid #fcc419;
    color: #856404;
    font-size: 0.9rem;
    font-style: italic;
    border-radius: 4px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
}

/* Ensure the mark scheme is NEVER printed even if visible on screen */
@media print {
    .mark-scheme-item {
        display: none !important;
    }
}

.pastpapers-hub { background: #f4f7f6; min-height: 100vh; padding-bottom: 50px; }
.hub-header { background: var(--navy); color: white; padding: 40px 0; margin-bottom: 30px; }

.filter-bar { margin-top: 20px; }
#paperSearch {
    width: 100%;
    padding: 15px 25px;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    outline: none;
}

.papers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.paper-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: 0.3s;
    border: 1px solid #eee;
}
.paper-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }

.card-type-tag {
    padding: 8px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    background: #95a5a6;
}
.card-type-tag.qp { background: #3498db; } /* Blue for Question Paper */
.card-type-tag.ms { background: #27ae60; } /* Green for Mark Scheme */
.card-type-tag.gt { background: #e67e22; } /* Orange for Grade Thresholds */

.card-body { padding: 20px; text-align: center; }
.card-body h3 { margin: 0; color: var(--navy); font-size: 1.3rem; }
.card-body .meta { color: #7f8c8d; margin: 10px 0 20px; font-size: 0.9rem; }

.btn-download {
    display: block;
    background: #f8f9fa;
    color: var(--navy);
    text-decoration: none;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-weight: 600;
    transition: 0.2s;
}
.btn-download:hover { background: var(--navy); color: white; }
/* Container Spacing */
.year-section {
    background: white;
    margin-bottom: 40px;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.year-title {
    color: var(--navy);
    font-size: 1.8rem;
    border-bottom: 3px solid var(--green);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.series-block {
    margin-bottom: 30px;
    padding-left: 15px;
    border-left: 3px solid #eee;
}

.series-title {
    color: var(--navy-light);
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Three-Column Type Grid */
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.type-heading {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #7f8c8d;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* List of Papers */
.paper-list {
    list-style: none;
    padding: 0;
}

.paper-item {
    margin-bottom: 8px;
}

.paper-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 4px;
    background: #f8f9fa;
    transition: 0.2s;
}

.paper-item a:hover {
    background: var(--navy);
    color: white;
}

/* Small codes like QP, MS */
.file-tag {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    color: white;
    min-width: 25px;
    text-align: center;
}

.file-tag.qp { background: #3498db; }
.file-tag.ms { background: #27ae60; }
.file-tag.gt { background: #e67e22; }
.file-tag.er { background: #9b59b6; }

.sidebar-link {
    display: flex;
    gap: 10px;
    font-variant-numeric: tabular-nums; /* Keeps numbers aligned */
}
/* --- Enhanced Footer Styling --- */
.footer {
    background: #001226; /* Slightly darker than your navy for depth */
    color: #ffffff;
    padding: 60px 0 30px;
    margin-top: 80px;
    border-top: 4px solid var(--green);
}

.footer-grid {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.footer-info {
    flex: 1;
    min-width: 300px;
}

.footer-info h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--green);
}

.footer-info p {
    opacity: 0.8;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 30px; /* Horizontal spacing between links on desktop */
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: 0.3s;
    white-space: nowrap;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--green);
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* --- Mobile Responsive Adjustment --- */
@media (max-width: 768px) {
    .footer-grid {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
        width: 100%;
        gap: 15px;
        flex-direction: column; /* Stack links on mobile for better tap targets */
    }
    
    .footer-info {
        min-width: 100%;
    }
}

/* --- Collapsible Logic --- */
.lesson-card-collapsible {
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.lesson-header {
    padding: 20px;
    background: #fdfdfd;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

.lesson-header:hover { background: #f0f7ff; }

.lesson-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 15px;
}

.lesson-body {
    display: none; /* Hidden by default */
    padding: 25px;
    border-top: 1px solid #eee;
}

/* Show body when active */
.lesson-card-collapsible.active .lesson-body {
    display: block;
}

.btn-print-mini {
    background: var(--navy);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* --- PRINT OPTIMIZATION --- */
@media print {
    /* Hide everything but the content */
    header, footer, .syllabus-sidebar, .sidebar-toggle-btn, .no-print {
        display: none !important;
    }

    .syllabus-wrapper { display: block; padding: 0; }
    .syllabus-main { width: 100%; padding: 0; }

    /* Hide the body of cards that are NOT active/expanded */
    .lesson-card-collapsible:not(.active) .lesson-body {
        display: none !important;
    }

    /* Keep active bodies visible but remove card borders for a "Paper" look */
    .lesson-card-collapsible {
        border: none;
        box-shadow: none;
        margin-bottom: 30px;
    }

    .lesson-header {
        padding: 0;
        background: transparent;
    }

    /* Hide the chevron icons on the printed page */
    .status-icon { display: none !important; }
	.lesson-card-collapsible {
        border: none;
        box-shadow: none;
        margin-bottom: 0; /* Remove bottom margin to avoid awkward gaps */
    }

    /* Force a new page for every active lesson entry */
    .lesson-card-collapsible.active {
        page-break-before: always;
        padding-top: 20mm; /* Add some top margin on the new page */
    }

    /* Prevent the very first expanded lesson from creating a blank page at the start */
    .lesson-card-collapsible.active:first-of-type {
        page-break-before: avoid;
    }

    /* Ensure images and diagrams don't get cut in half across pages */
    .lesson-figure, .lesson-text img {
        page-break-inside: avoid;
    }

    /* Hide the 'Topic' title if it's sitting alone at the bottom of a page */
    .content-header h1 {
        page-break-after: avoid;
    }
}

.legal-container {
    padding: 60px 0;
    background: #f8f9fa;
}

.legal-card {
    background: white;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.legal-card h1 {
    color: var(--navy);
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.last-updated {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.legal-card section {
    margin-bottom: 30px;
}

.legal-card h3 {
    color: var(--navy-light);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.legal-card p, .legal-card li {
    line-height: 1.7;
    color: #444;
    margin-bottom: 10px;
}

.legal-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    text-align: center;
}

.cookie-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 31, 63, 0.95); /* Your Navy with slight transparency */
    color: white;
    z-index: 9999;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.cookie-content {
    max-width: 900px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cookie-content i {
    font-size: 2rem;
    color: var(--green);
}

.cookie-content h3 { margin: 0; font-size: 1.2rem; }
.cookie-content p { margin: 0; font-size: 0.9rem; opacity: 0.8; flex: 1; }

.btn-accent {
    background: var(--green);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

.btn-accent:hover { background: #2ecc71; }

@media (max-width: 768px) {
    .cookie-content { flex-direction: column; text-align: center; }
}
.generator-form {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    color: white;
}

.generator-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.generator-form select, .generator-form input {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}
/* Better Generator Form Layout */
.generator-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
}

.button-actions {
    display: flex;
    gap: 10px;
}

/* Button Styling to match Site Hub */
.btn-refresh, .btn-scheme, .btn-print-main {
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh { background: var(--navy); color: white; }
.btn-scheme { background: #6c757d; color: white; }
.btn-print-main { background: var(--green); color: white; }

.btn-refresh:hover, .btn-scheme:hover, .btn-print-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Mark Scheme Styling */
.mark-scheme-box {
    margin-top: 15px;
}

.scheme-inner {
    background: #fff9db;
    border-left: 5px solid #fcc419;
    padding: 15px;
    border-radius: 5px;
    color: #856404;
    font-size: 0.95rem;
}

@media print {
    .mark-scheme-box { display: none !important; }
}

/* Specific styling for the total marks display on paper */
.instructions p strong {
    font-size: 1.2rem;
    color: #000;
}

.generator-form-vertical {
    background: rgba(0, 31, 63, 0.05);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.topic-selector-box {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    height: 150px;
    overflow-y: scroll;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 5px;
}

.topic-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.topic-check:hover { background: #f0f7ff; }

.topic-check input { width: auto; }

                ```

.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.mode-btn {
    cursor: pointer;
    flex: 1;
}

.mode-btn input {
    display: none; /* Hide radio button */
}

.mode-btn span {
    display: block;
    text-align: center;
    padding: 12px;
    background: #f1f1f1;
    border-radius: 8px;
    font-weight: bold;
    color: #666;
    transition: 0.3s;
}

.mode-btn input:checked + span {
    background: var(--navy);
    color: white;
}

.full-width {
    flex: 1;
}
.floating-table {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
    width: auto;
    min-width: 200px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-drag-handle {
    padding: 10px;
    background: var(--navy);
    color: white;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: bold;
}

.close-table {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.truth-table-content {
    padding: 15px;
    overflow-y: auto;
    background: white;
}

.truth-table-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
/* Find this section in your CSS and update these properties */
.floating-table {
    min-width: 250px;
    max-height: 85vh; /* Allows the table to grow up to 85% of the screen height */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Keeps the header fixed */
}

.truth-table-content {
    overflow-y: auto; /* Adds a scrollbar ONLY if the table is too long */
    padding: 10px;
    flex-grow: 1; /* Ensures it fills the container */
    background: #fff;
}

/* Ensure the table itself doesn't have a margin that pushes it out */
.truth-table-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 5px; /* Small buffer at the bottom */
}

.truth-table-content th, .truth-table-content td {
    border: 1px solid #eee;
    padding: 6px;
    text-align: center;
}
/* Exam Asset Styling */
.exam-asset-container {
    margin: 20px 0;
    text-align: center;
}

.exam-q-img {
    max-width: 80%;
    height: auto;
    border: 1px solid #eee; /* Light border for contrast on screen */
}

/* Official Cambridge Table Style */
.exam-printable-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.exam-printable-table th, 
.exam-printable-table td {
    border: 1px solid #000; /* Solid black for printing */
    padding: 12px;
    text-align: center;
    height: 35px; /* Ensures empty rows have height */
}

.exam-printable-table th {
    background: #f0f0f0;
    font-weight: bold;
}

/* Ensure lines show up clearly on white paper */
.exam-line {
    height: 32px;
    border-bottom: 1px solid #999;
    width: 100%;
    margin-bottom: 5px;
}
/* Layout for Marks on Right */
.q-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    position: relative;
}

.q-main-content {
    flex: 1;
}

.q-marks-right {
    font-weight: bold;
    font-family: monospace;
    min-width: 30px;
    text-align: right;
    padding-top: 2px;
}

/* Drawing Box Styling */
.drawing-box {
    width: 100%;
    min-height: 250px; /* Adjust based on preference */
    border: 1px solid #000;
    margin: 15px 0;
    position: relative;
    background: #fff;
}

.drawing-hint {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
}

/* Responsive Fix for Mobile View */
@media (max-width: 768px) {
    .q-header-flex {
        flex-direction: column;
    }
    .q-marks-right {
        align-self: flex-end;
    }
}
.drawing-box {
    border: 1.5px solid #000; /* Standard exam thickness */
    min-height: 300px;
    margin: 20px 0;
    background: #fff;
    page-break-inside: avoid; /* Don't split a drawing box across pages */
}
#sandbox-table-output {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.logic-table {
    width: 100%;
    border-collapse: collapse;
}

.logic-table th, .logic-table td {
    padding: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

.logic-table th {
    background: var(--bg);
    position: sticky;
    top: 0;
}
/* Styling for the Manual Sandbox Output Table */
#sandbox-table-output table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden; /* Rounded corners for the table */
}

#sandbox-table-output th, 
#sandbox-table-output td {
    padding: 10px 5px; /* Increased padding for breathing room */
    border: 1px solid var(--border);
    text-align: center;
    font-size: 1.1rem; /* Slightly larger text for readability */
}

#sandbox-table-output th {
    background: #f1f2f6;
    color: var(--navy);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Make the Result (X) column stand out */
#sandbox-table-output td:last-child, 
#sandbox-table-output th:last-child {
    border-left: 3px solid var(--navy);
    background: #fcfcfc;
}

/* Row Hover for easier tracing */
#sandbox-table-output tr:hover {
    background-color: #f8fafc;
}

/* Color coding the 1s and 0s */
.res-on {
    color: var(--green);
    font-weight: bold;
}
.res-off {
    color: #e74c3c;
}

/* --- Enhanced Level Switcher --- */
.level-switcher-container {
    display: flex;
    background: rgba(0, 0, 0, 0.25); /* Deep inset look */
    padding: 6px;
    border-radius: 10px;
    margin: 15px 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.level-btn {
    flex: 1;
    display: flex;
    flex-direction: column; /* Stack Icon and Text */
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.level-btn i {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.level-btn span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Inactive State: Subtle and Integrated */
.level-btn-inactive {
    color: rgba(255, 255, 255, 0.3);
}

.level-btn-inactive:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

/* Active IGCSE: Brand Green */
.btn-igcse-active {
    background: #2ecc71 !important;
    color: #1a1d23 !important;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Active A-Level: Brand Purple */
.btn-alevel-active {
    background: #9b59b6 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Add a small pulse animation for the active level */
.level-btn.active i {
    animation: simple-bounce 2s infinite;
}

@keyframes simple-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}
@keyframes pushIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#infix-input:focus {
    border-color: var(--green) !important;
    outline: none;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}
/* Fix for Topical List Visibility */
.topic-selector-box {
    background: #ffffff !important; /* White background for the list */
    border: 1px solid #ddd;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    padding: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for topics */
    gap: 10px;
}

.topic-check {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #eee;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333 !important; /* Force dark text */
    font-size: 0.85rem;
}

.topic-check:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.topic-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Improve the Mode Buttons (Full Paper / Topical) */
.mode-selector {
    display: flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid #333;
}

.mode-btn {
    flex: 1;
    margin: 0 !important;
    cursor: pointer;
}

.mode-btn span {
    display: block;
    padding: 15px;
    text-align: center;
    background: #1a1d23;
    color: #888;
    font-weight: bold;
    transition: 0.3s;
}

.mode-btn input:checked + span {
    background: #ffffff;
    color: #1a1d23;
}
/* Force high contrast for the topical list */
.topic-selector-box {
    background: #ffffff !important; /* Bright white background */
    color: #1a1d23 !important;      /* Dark near-black text */
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.topic-check span {
    color: #1a1d23 !important; /* Force labels to be visible */
    font-weight: 600;
}
.file-tag.in { background: #9b59b6 !important; color: white !important; } /* Purple for Inserts */
.file-tag.sf { background: #f39c12 !important; color: white !important; } /* Orange for Source Files */

/* MARKING SCHEME OVERLAY STYLES */
.scheme-overlay-container {
    position: relative;
    width: 100%;
}

.answer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Allows clicking through if needed */
    color: #0033cc; /* Classic "Teacher Blue" ink color */
    font-family: 'Kalam', 'cursive', 'Arial'; /* Handwriting-style font if available */
    font-weight: bold;
    padding: 5px 10px;
}

/* Ensure images in the marking scheme fit the provided space */
.answer-overlay img {
    max-width: 100%;
    max-height: 250px; /* Limits height to fit the answer area */
    object-fit: contain;
    opacity: 0.9;
    display: block;
    margin: 0 auto;
}

@media print {
    .no-print { display: none !important; }
    .answer-overlay { color: #000 !important; } /* High contrast for printing */
}

.nav-teaser:hover {
    color: #2ecc71 !important; /* Glow green on hover to show value */
    transition: 0.3s;
}
.nav-teaser i {
    transition: 0.3s;
}
.nav-teaser:hover i {
    transform: translateY(-1px);
    color: #f1c40f; /* Lock turns gold on hover */
}
/* Styling for the locked state */
.mode-selector .level-btn.locked-btn {
    background: #f1f5f9; /* Lighter/Grayer background */
    color: #94a3b8;      /* Muted text */
    border-style: dashed; /* Shows it's an 'incomplete' action */
    cursor: pointer;
}

.mode-selector .level-btn.locked-btn:hover {
    background: #e2e8f0;
    color: #64748b;
    border-color: #cbd5e0;
}

/* Optional: Make the lock icon wiggle slightly on hover to catch the eye */
.mode-selector .level-btn.locked-btn:hover i {
    animation: wiggle 0.3s ease-in-out infinite;
}

@keyframes wiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

.level-badge { padding: 5px 15px; border-radius: 50px; font-size: 0.75rem; font-weight: bold; border: 1px solid; }
.purple { color: #9b59b6; border-color: #9b59b6; background: rgba(155, 89, 182, 0.1); }
.green { color: #2ecc71; border-color: #2ecc71; background: rgba(46, 204, 113, 0.1); }

/* Navigation */
.tool-tabs-container { width: 100%; border-bottom: 2px solid rgba(255,255,255,0.05); margin-bottom: 20px; }
.tool-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.tab-btn { flex: 0 0 auto; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); padding: 12px 25px; border-radius: 8px; color: #adb5bd; cursor: pointer; white-space: nowrap; transition: 0.3s; }
.tab-btn.active { background: var(--green, #2ecc71); color: #1a1d23; font-weight: 800; border-color: white; }

/* Tool Layouts */
.pixel-workspace, .audio-workspace { display: grid; grid-template-columns: 1fr 300px; gap: 20px; width: 100%; }
.canvas-viewport { background: #000; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; width: 100%; border: 1px solid #333; }
.pixel-controls, .audio-controls-container { background: #fdfdfd; padding: 20px; border-radius: 12px; border: 1px solid #ddd; align-self: start; }

/* Conversion Results - PRESERVE COLORS */
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 25px; }
.res-card { background: #f8f9fa; padding: 15px; border-radius: 8px; border-left: 4px solid #1a1d23; }
.res-card label { display: block; font-size: 0.8rem; color: #7f8c8d; text-transform: uppercase; }
.steps-container { background: #2c3e50; color: #ecf0f1; padding: 20px; border-radius: 8px; font-family: monospace; }
.res-card span { 
    color: #1a1d23 !important; /* Dark charcoal for visibility on light gray */
    font-family: monospace; 
    font-weight: bold; 
    font-size: 1.2rem; 
}

/* Misc */
.char-large-input { padding: 20px; font-size: 3rem; text-align: center; background: rgba(0,0,0,0.4); color: #2ecc71; border: 1px solid #444; border-radius: 15px; }
.wave-entry { padding: 15px; border-radius: 10px; margin-bottom: 15px; }
.wave-entry label { display: block; font-size: 0.7rem; font-weight: bold; margin-top: 10px; color: #555; }
/* RPN Tool Visibility Fixes */
#infix-input {
    background: rgba(255, 255, 255, 0.9) !important; /* Light background for the input */
    color: #1a1d23 !important; /* Dark text for the input */
    border: 2px solid var(--green) !important;
}

#stack-instructions {
    color: #ffffff !important; /* Force white for the step-by-step text */
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid rgba(255,255,255,0.1);
}

#rpn-output {
    color: #1a1d23 !important; /* Dark text for the result span inside the light res-card */
    font-weight: 900;
    font-size: 1.4rem;
}

/* Ensure the floating point denary is also visible */
#final-denary-val {
    color: #1a1d23 !important; 
}
/* Fix for Boolean Step Visibility */
#bool-steps-output {
    color: #ffffff !important; /* Base text in white */
    background: #2c3e50; /* Solid dark slate for better grounding */
    border: 1px solid rgba(255,255,255,0.1);
}

/* High-contrast neon green for the Laws */
.bool-law-highlight {
    color: #00ff88 !important; 
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

/* Fix for the initial expression text (the grey on grey issue) */

.bool-step-text {
    color: #ffffff !important;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

.bool-law-highlight {
    color: #00ff88 !important; /* Neon Green from image_fa0d3e */
    font-style: italic;
    margin-left: 10px;
}
