/* static/css/style.css - MathoPrint.com Distinctive Design System */
:root {
    --mlp-navy: #243B64;
    --mlp-blue: #3978D5;
    --mlp-orange: #FFA94D;
    --mlp-green: #42B883;
    --mlp-bg: #F5F7FB;
    --mlp-white: #FFFFFF;
    --mlp-text: #253248;
    --mlp-muted: #6B7280;
    --mlp-border: #E2E8F0;
    --mlp-radius: 16px;
    --mlp-shadow: 0 10px 30px rgba(36, 59, 100, 0.08);
    --mlp-shadow-hover: 0 16px 36px rgba(57, 120, 213, 0.16);
}

body {
    background-color: var(--mlp-bg);
    color: var(--mlp-text);
    font-family: 'Cairo', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
}

/* Navbar */
.mlp-navbar {
    background-color: var(--mlp-white);
    border-bottom: 1px solid var(--mlp-border);
    box-shadow: 0 4px 16px rgba(36, 59, 100, 0.04);
}

.mlp-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--mlp-navy), var(--mlp-blue));
    color: var(--mlp-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
}

/* Buttons */
.btn-mlp-primary {
    background-color: var(--mlp-blue);
    color: var(--mlp-white);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    transition: all 0.2s ease;
}
.btn-mlp-primary:hover {
    background-color: var(--mlp-navy);
    color: var(--mlp-white);
    transform: translateY(-2px);
}

.btn-mlp-orange {
    background-color: var(--mlp-orange);
    color: var(--mlp-text);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    transition: all 0.2s ease;
}
.btn-mlp-orange:hover {
    background-color: #f59630;
    color: var(--mlp-text);
    transform: translateY(-2px);
}

.btn-mlp-green {
    background-color: var(--mlp-green);
    color: var(--mlp-white);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    transition: all 0.2s ease;
}
.btn-mlp-green:hover {
    background-color: #359c6d;
    color: var(--mlp-white);
    transform: translateY(-2px);
}

/* Hero Section */
.mlp-hero {
    background: linear-gradient(135deg, #243B64 0%, #1B2D4E 100%);
    color: var(--mlp-white);
    padding: 4.5rem 0;
    position: relative;
}

.hero-badge {
    background-color: rgba(255, 169, 77, 0.18);
    color: var(--mlp-orange);
    border: 1px solid rgba(255, 169, 77, 0.4);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-block;
}

.hero-mini-sheet {
    background: var(--mlp-white);
    color: var(--mlp-text);
    border-radius: var(--mlp-radius);
    padding: 1.75rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
    border-top: 6px solid var(--mlp-orange);
}

/* Topic Cards */
.topic-card {
    background: var(--mlp-white);
    border: 2px solid transparent;
    border-radius: var(--mlp-radius);
    padding: 1.4rem;
    box-shadow: var(--mlp-shadow);
    cursor: pointer;
    transition: all 0.22s ease;
    height: 100%;
    position: relative;
}
.topic-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mlp-shadow-hover);
    border-color: rgba(57, 120, 213, 0.4);
}
.topic-card.selected {
    border-color: var(--mlp-blue);
    background-color: #F0F6FF;
}

.topic-icon-box {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--mlp-white);
}

/* Topic Icon Dynamic Brand Colors */
.topic-icon-box[data-bg-color="#3978D5"] { background-color: #3978D5; }
.topic-icon-box[data-bg-color="#FFA94D"] { background-color: #FFA94D; }
.topic-icon-box[data-bg-color="#42B883"] { background-color: #42B883; }
.topic-icon-box[data-bg-color="#243B64"] { background-color: #243B64; }

/* 3-Step Wizard Stepper */
.wizard-stepper {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.wizard-step-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--mlp-white);
    border: 2px solid var(--mlp-border);
    color: var(--mlp-muted);
    padding: 0.65rem 1.35rem;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.wizard-step-pill.active {
    border-color: var(--mlp-blue);
    background-color: var(--mlp-navy);
    color: var(--mlp-white);
}
.wizard-step-pill.completed {
    border-color: var(--mlp-green);
    color: var(--mlp-green);
}

.step-num-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(107, 114, 128, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.wizard-step-pill.active .step-num-circle {
    background: var(--mlp-orange);
    color: var(--mlp-text);
}
.wizard-step-pill.completed .step-num-circle {
    background: var(--mlp-green);
    color: var(--mlp-white);
}

/* Choice Pills in Step 2 */
.choice-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.choice-pill {
    background: var(--mlp-bg);
    border: 2px solid var(--mlp-border);
    border-radius: 12px;
    padding: 0.55rem 1.1rem;
    font-weight: 700;
    color: var(--mlp-text);
    cursor: pointer;
    transition: all 0.15s ease;
}
.choice-pill:hover {
    border-color: var(--mlp-blue);
}
.choice-pill.active {
    background: var(--mlp-blue);
    color: var(--mlp-white);
    border-color: var(--mlp-blue);
}

/* Realistic Printable Worksheet Paper (Step 3) */
.worksheet-paper-wrapper {
    background: #E2E8F0;
    padding: 2rem 1rem;
    border-radius: var(--mlp-radius);
    overflow-x: auto;
}

.worksheet-paper {
    background: var(--mlp-white);
    width: 100%;
    max-width: 794px;
    min-height: 980px;
    margin: 0 auto;
    padding: 2.5rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #111827;
}

.worksheet-paper.template-modern {
    border-top: 10px solid var(--mlp-navy);
}
.worksheet-paper.template-classic {
    border: 2px solid #000000;
}
.worksheet-paper.template-minimal {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.ws-header {
    border-bottom: 2px solid var(--mlp-navy);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.template-classic .ws-header {
    border-bottom-color: #000;
}
.template-minimal .ws-header {
    border-bottom: 1px dashed #9CA3AF;
}

/* Vertical Math Place-Value Alignment Table (Fixed Bottom Line for Preview & Print) */
.math-vertical-box {
    display: inline-table;
    border-collapse: collapse;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    direction: ltr;
    text-align: right;
    min-width: 72px;
}
.math-vertical-row {
    display: table-row;
}
.math-vertical-cell {
    display: table-cell;
    padding: 0 0.25rem;
    text-align: right;
}
.math-vertical-line .math-vertical-cell {
    border-bottom: 2.5px solid #111827 !important;
    padding-bottom: 4px;
}
.math-answer-val {
    color: var(--mlp-green);
    font-weight: 800;
}

/* AdSense Safe Containers */
.adsense-safe-slot {
    background: var(--mlp-white);
    border: 1px dashed #CBD5E1;
    border-radius: 12px;
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mlp-muted);
    font-size: 0.85rem;
    margin: 2rem 0;
}

.adsense-side-slot {
    width: 170px;
    min-height: 600px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}

.adsense-side-placeholder {
    width: 160px;
    height: 600px;
    background: var(--mlp-white);
    border: 1px dashed #CBD5E1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: var(--mlp-muted);
    font-size: 0.8rem;
}

/* Print Rules - Only print actual worksheet pages with zero blank pages */
@media print {
    @page {
        size: auto;
        margin: 10mm;
    }
    body {
        background: #FFFFFF !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    nav,
    footer,
    .mlp-hero,
    .adsense-safe-slot,
    .adsense-side-slot,
    #mlpCookieBanner,
    .modal,
    section:not(#smartBuilderSection),
    #smartBuilderSection > .container > .text-center,
    #smartBuilderSection > .container > .wizard-stepper,
    #stepPane1,
    #stepPane2,
    #stepPane3 > .card {
        display: none !important;
    }
    #smartBuilderSection,
    #smartBuilderSection > .container,
    .worksheet-paper-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        max-width: 100% !important;
        overflow: visible !important;
    }
    #printableWorksheetArea {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
        max-width: 100% !important;
        display: block !important;
    }
    .math-vertical-line .math-vertical-cell {
        border-bottom: 2.5px solid #000000 !important;
    }
}