/**
 * KIDDIE BLOCKS PH - 8-PAGE PREVIEW ENGINE & DIGITAL FLIPBOOK CSS
 * Pure Vanilla CSS with Brand Standards (Prussian Blue, Dusty Sky, Cherry Red)
 */

/* Modal Backdrop Overlay */
.wb-preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 25, 81, 0.82);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.wb-preview-modal-overlay.active {
    display: flex;
    animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

/* Modal Dialog Window */
.wb-modal-dialog {
    background: #F8FAFC;
    width: 100%;
    max-width: 900px;
    height: 94vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    border: 2px solid var(--prussian-blue, #091951);
    overflow: hidden;
    position: relative;
}

/* Modal Header */
.wb-modal-header {
    background: var(--prussian-blue, #091951);
    color: #FFFFFF;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.wb-modal-title-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wb-modal-badge {
    font-size: 7.5pt;
    font-weight: 700;
    color: var(--dusty-sky, #9DB6DA);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wb-modal-heading {
    font-family: 'ABeeZee', sans-serif;
    font-size: clamp(10pt, 2vw, 12pt);
    color: #FFFFFF;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wb-btn-mode-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--dusty-sky, #9DB6DA);
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 7.5pt;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Montserrat', sans-serif;
}

.wb-btn-mode-toggle:hover {
    background: var(--dusty-sky, #9DB6DA);
    color: var(--prussian-blue, #091951);
}

.wb-modal-close {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 16pt;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.wb-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Stepper Control Bar */
.wb-stepper-bar {
    background: #FFFFFF;
    border-bottom: 1.5px solid #E2E8F0;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.wb-step-arrow {
    background: #EEF4FC;
    border: 1.5px solid var(--dusty-sky, #9DB6DA);
    color: var(--prussian-blue, #091951);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16pt;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.wb-step-arrow:hover:not(:disabled) {
    background: var(--prussian-blue, #091951);
    color: #FFFFFF;
}

.wb-step-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.wb-step-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wb-step-counter {
    font-family: 'ABeeZee', sans-serif;
    font-size: 9pt;
    font-weight: 700;
    color: var(--prussian-blue, #091951);
}

.wb-step-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wb-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #CBD5E1;
    cursor: pointer;
    transition: all 0.2s;
}

.wb-step-dot.active {
    width: 22px;
    border-radius: 10px;
    background: var(--cherry-red, #F12020);
}

/* Modal Body / Sheet Viewport */
.wb-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #E2E8F0;
    scrollbar-width: thin;
}

.wb-modal-body.mode-continuous {
    gap: 20px;
}

/* Sheet Wrapper (US Letter Ratio: 8.5 x 11) */
.wb-sheet-wrapper {
    width: 100%;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wb-slice-header-tag {
    background: var(--prussian-blue, #091951);
    color: #FFFFFF;
    font-size: 7.5pt;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
    text-transform: uppercase;
}

.wb-sheet-paper {
    width: 100%;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(9, 25, 81, 0.12);
    border: 1px solid #CBD5E1;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

/* Interior Standardized Footer */
.wb-standard-interior-footer {
    border-top: 1.5px solid #0F172A;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 7pt;
    color: #0F172A;
    font-weight: 600;
    background: #FFFFFF;
    margin-top: auto;
    font-family: 'Montserrat', sans-serif;
    gap: 8px;
}

.wb-footer-brand {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wb-footer-logo-bw {
    width: 18px;
    height: 18px;
    filter: grayscale(100%) contrast(200%);
}

.wb-footer-brand-text {
    font-family: 'ABeeZee', sans-serif;
    font-weight: 700;
}

.wb-footer-address {
    text-align: center;
    color: #475569;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-footer-page-num {
    font-weight: 800;
    font-size: 7.5pt;
}

/* ====================================================================
   COVER SHEET STYLING (PAGE 1)
==================================================================== */
.wb-cover-sheet {
    background: linear-gradient(145deg, #091951 0%, #172B70 65%, #243E94 100%);
    color: #FFFFFF;
    padding: 24px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    position: relative;
}

.wb-cover-top-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.wb-cover-logo {
    height: 56px;
    width: auto;
    border-radius: 12px;
    background: white;
    padding: 4px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    border: 2px solid #FCD34D;
    object-fit: contain;
}

.wb-cover-brand-meta {
    text-align: left;
}

.wb-cover-brand-name {
    display: block;
    font-family: 'ABeeZee', sans-serif;
    font-size: 11pt;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.wb-cover-brand-sub {
    display: block;
    font-size: 7pt;
    color: var(--dusty-sky, #9DB6DA);
}

.wb-cover-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.wb-badge-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 7.5pt;
    font-weight: 800;
    text-transform: uppercase;
}

.wb-pill-grade { background: var(--cherry-red, #F12020); color: white; }
.wb-pill-subject { background: var(--dusty-sky, #9DB6DA); color: var(--prussian-blue, #091951); }
.wb-pill-pages { background: rgba(255, 255, 255, 0.15); color: white; border: 1px solid rgba(255, 255, 255, 0.3); }

.wb-cover-hero-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px 14px;
    margin-bottom: 16px;
}

.wb-cover-art-illustration {
    font-size: 38pt;
    line-height: 1;
    margin-bottom: 10px;
}

.wb-cover-title {
    font-family: 'ABeeZee', sans-serif;
    font-size: clamp(14pt, 3.2vw, 19pt);
    line-height: 1.25;
    margin-bottom: 8px;
    color: #FFFFFF;
}

.wb-cover-tagline {
    font-size: 8pt;
    color: var(--dusty-sky, #9DB6DA);
    line-height: 1.4;
}

.wb-cover-features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.wb-feature-tag {
    font-size: 7.5pt;
    font-weight: 700;
    color: #FFFFFF;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 10px;
    border-radius: 6px;
}

.wb-cover-footer-row {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wb-cover-specs {
    font-size: 7pt;
    color: rgba(255, 255, 255, 0.7);
}

.wb-cover-reorder-hook {
    font-size: 8pt;
    color: #FFFFFF;
    background: rgba(241, 32, 32, 0.85);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    margin: 4px auto 0 auto;
}

/* ====================================================================
   INTERIOR SHEET GENERAL STYLING (PAGES 2–8)
==================================================================== */
.wb-interior-sheet {
    padding: 24px 20px 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    color: #0F172A;
}

.wb-sheet-header {
    margin-bottom: 14px;
    border-bottom: 2px solid #0F172A;
    padding-bottom: 8px;
}

.wb-unit-tag {
    font-size: 7pt;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--prussian-blue, #091951);
    text-transform: uppercase;
    display: block;
}

.wb-sheet-title {
    font-family: 'ABeeZee', sans-serif;
    font-size: clamp(12pt, 2.5vw, 15pt);
    color: var(--prussian-blue, #091951);
    margin: 2px 0 2px 0;
}

.wb-sheet-subtitle {
    font-size: 8pt;
    color: #64748B;
    display: block;
}

/* TOC Styling */
.wb-toc-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wb-toc-module {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 10px 12px;
}

.wb-toc-module-header {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 8.5pt;
    color: var(--prussian-blue, #091951);
    border-bottom: 1px dashed #CBD5E1;
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.wb-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 8pt;
}

.wb-toc-list li {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px dotted #F1F5F9;
}

/* Reviewer Box */
.wb-reviewer-box {
    background: #F8FAFC;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    padding: 14px;
    flex: 1;
}

.wb-box-heading {
    font-family: 'ABeeZee', sans-serif;
    font-size: 10pt;
    color: var(--prussian-blue, #091951);
    margin-bottom: 6px;
}

.wb-lesson-text {
    font-size: 8.5pt;
    line-height: 1.5;
    margin-bottom: 12px;
}

.wb-concept-diagram {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.wb-concept-card {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.wb-card-icon {
    font-size: 14pt;
    margin-bottom: 2px;
}

.wb-concept-card h4 {
    font-size: 8pt;
    color: var(--prussian-blue, #091951);
    margin-bottom: 2px;
}

.wb-concept-card p {
    font-size: 7pt;
    color: #64748B;
    line-height: 1.3;
}

.wb-example-block {
    background: #FFFFFF;
    border-left: 3px solid var(--prussian-blue, #091951);
    padding: 8px 12px;
    font-size: 8pt;
    border-radius: 0 6px 6px 0;
}

.wb-example-illustration {
    font-size: 9pt;
    margin-top: 4px;
    color: var(--prussian-blue, #091951);
}

.wb-vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.wb-vocab-item {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 8px;
    font-size: 8pt;
}

.wb-vocab-item strong {
    color: var(--prussian-blue, #091951);
}

.wb-vocab-item p {
    font-size: 7.5pt;
    color: #475569;
    margin-top: 2px;
}

.wb-callout-note {
    background: #EEF4FC;
    border: 1px solid var(--dusty-sky, #9DB6DA);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 7.5pt;
    color: var(--prussian-blue, #091951);
}

/* Exercises Body */
.wb-exercise-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.wb-exercise-item {
    display: flex;
    gap: 10px;
    font-size: 8.5pt;
}

.wb-q-number {
    font-family: 'ABeeZee', sans-serif;
    font-weight: 800;
    font-size: 11pt;
    color: var(--prussian-blue, #091951);
}

.wb-q-content {
    flex: 1;
}

.wb-q-visual {
    margin-top: 6px;
    font-size: 9pt;
    font-weight: 700;
}

.wb-workspace-box {
    border: 1px solid #94A3B8;
    border-radius: 6px;
    padding: 10px;
    margin-top: 6px;
    min-height: 70px;
    font-size: 8pt;
}

.wb-matching-row {
    margin-top: 4px;
    font-size: 8.5pt;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted #CBD5E1;
    padding-bottom: 4px;
}

/* Guide Content */
.wb-guide-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wb-guide-card {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 12px;
}

.wb-guide-checklist {
    margin: 6px 0 0 16px;
    font-size: 8pt;
    line-height: 1.5;
}

.wb-answer-key-sample {
    background: #FFFFFF;
    border: 1.5px solid var(--prussian-blue, #091951);
    border-radius: 8px;
    padding: 10px 12px;
}

.wb-answers-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 6px;
    font-size: 8pt;
}

/* Modal Bottom Buy Now Action Bar */
.wb-modal-footer {
    background: #FFFFFF;
    border-top: 2px solid var(--card-border, #E2E8F0);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.wb-footer-logistics {
    display: flex;
    flex-direction: column;
    font-size: 8pt;
    color: var(--prussian-blue, #091951);
}

.wb-footer-support {
    font-size: 7.5pt;
    color: #64748B;
}

.wb-btn-buy-now {
    background: var(--cherry-red, #F12020);
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(9pt, 2vw, 10.5pt);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(241, 32, 32, 0.35);
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wb-btn-buy-now:hover {
    background: #D01414;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 32, 32, 0.45);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .wb-preview-modal-overlay {
        padding: 0;
    }
    .wb-modal-dialog {
        height: 100vh;
        max-width: 100vw;
        border-radius: 0;
        border: none;
    }
    .wb-modal-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 10px 14px;
    }
    .wb-btn-buy-now {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    .wb-sheet-paper {
        border-radius: 8px;
    }
    .wb-standard-interior-footer {
        flex-wrap: wrap;
        text-align: center;
        justify-content: center;
    }
    .wb-footer-address {
        width: 100%;
    }
}
