body {
    background-color: none;
    background-image: none;
    margin: 0;
    padding: 0;
    font-family: 'Avenir LT Pro';
    overflow: hidden;
    /* Prevent body scroll, let flipbook handle it */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.flipbook-viewport {
    width: 960px;
    height: 680px;
}

.container {
    align-items: center;
    display: flex;
    justify-content: center;
    height: 100%;
}

.flipbook {
    width: 920px;
    height: 650px;
}

.flipbook .page {
    width: 460px;
    height: 650px;
    background-color: #dbc5eb;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    /* Improve font rendering */
    -webkit-font-smoothing: antialiased;
}

.flipbook .page-content {
    padding: 40px;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Vertical Centering for BOM Page */
.flipbook .page-bom-safety .page-content {
    padding: 30px 40px;
    /* Balanced padding */
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.flipbook .hard {
    background: #dbc5eb;
    box-shadow: inset 0 0 5px #666;
}

.flipbook .odd {
    background: linear-gradient(to right, #dbc5eb 95%, #dbc5eb 100%);
}

.flipbook .even {
    background: linear-gradient(to left, #dbc5eb 95%, #dbc5eb 100%);
}

/* --- Cover Page (Geometric Redesign) --- */
.page-cover.geometric-theme {
    background: #fff;
    /* Top left area color */
    overflow: hidden;
    position: relative;
    border: 1px solid #ddd;
}

/* Background Shapes */
.cover-design-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Big dark purple shape */
.shape-main {
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    height: 100%;
    background: #dbc5eb;
    clip-path: polygon(0 20%, 100% 0, 100% 100%, 0% 100%);
}

/* Accent lighter purple shape */
.shape-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 60%;
    background: #6A0DAD;
    clip-path: polygon(100% 30%, 0% 100%, 100% 100%);
    opacity: 0.9;
    display: none;
    /* Simplification for now to match main structure */
}

/* Side Strip */
.cover-side-strip {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: #683695;
    z-index: 10;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-side-strip span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    letter-spacing: 4px;
    font-weight: bold;
    white-space: nowrap;
}

/* Content Layer */
.cover-content-layer {
    position: relative;
    z-index: 5;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cover-top {
    padding: 40px 40px 0 40px;
}

.cover-logo {
    width: 140px;
    margin-bottom: 30px;
}

.geo-title {
    font-size: 36px;
    line-height: 1;
    color: #240E35;
    margin: 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.geo-title .highlight {
    color: #2e7d32;
    /* Green accent from logo? Or keep purple? Let's stick to theme */
    color: #6A0DAD;
}

.geo-subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Hero Image & Masking */
.cover-hero-wrapper {
    position: relative;
    flex-grow: 1;
    margin-top: -20px;
    /* Overlap effect */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 6;
    /* On top of shapes */
}

.hero-img {
    max-width: 90%;
    max-height: 380px;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3));
    transform: translateX(-15px);
    /* Offset for side strip */
}

/* Bottom Banner Removed */

/* Override old stuff to be safe if any leaks */
.cover-illustration img {
    display: none;
}

/* --- BOM Page --- */
.page-bom .bom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    font-size: 12px;
    margin-top: 20px;
}

.bom-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.bom-item span:first-child {
    font-weight: bold;
    width: 20px;
    color: #6A0DAD;
}

.bom-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin: 0 10px;
}

.logo-small {
    width: 100px;
}

/* --- Safety Page --- */
.safety-list {
    list-style: none;
    padding: 0;
}

.safety-list li {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
}

.safety-list img {
    width: auto;
    height: 70px;
    display: block;
    margin: 2px auto;
}

.safety-list p {
    font-size: 14px;
    color: #444;
    margin: 0;
    margin-left: 15px;
}

/* --- Merged BOM & Safety Page --- */
/* --- Merged BOM & Safety Page (Table Version) --- */
/* --- Merged BOM & Safety Page (Table Version) --- */
.tables-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Increased gap to utilize space */
    flex: 1;
    /* Grow to fill space above footer */
    justify-content: center;
    /* Center content vertically */
}

.tables-container .section h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #6A0DAD;
    border-bottom: 2px solid #eee;
}

.tables-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    table-layout: fixed;
}

.tables-container th,
.tables-container td {
    border: 1px solid #eee;
    padding: 1px 2px;
    /* Tighter padding */
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* S. No Column Styling (Box-like) */
.tables-container th:nth-child(1),
.tables-container td:nth-child(1) {
    width: 30px;
    font-weight: bold;
    /* Branded purple removed to match description color */
    background: rgba(106, 13, 173, 0.05);
    /* Very subtle background to give 'box' feel */
}

/* Image/Icon Column Styling (Fixed Width) */
.tables-container th:nth-child(2),
.tables-container td:nth-child(2) {
    width: 60px;
    /* Constrain image column to limit whitespace */
}

.tables-container th {
    background: rgba(255, 255, 255, 0.4);
    font-weight: bold;
    color: #333;
    font-size: 9px;
    height: 18px;
    /* Fixed small header height */
}

.tables-container tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.2);
}

/* Improved Hover Effect for Rows */
.tables-container tr:hover td {
    background: rgba(106, 13, 173, 0.1);
    /* Subtle purple highlight */
    cursor: default;
}

/* Icon Sizing for Safety (Accessibility) */
#safetySection img {
    height: 50px;
    /* Base size */
    min-width: 50px;
    /* Touch target size assurance */
    object-fit: contain;
}

/* Base icon sizing */
.tables-container img {
    height: 30px !important;
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* --- Step Pages --- */
.step-header {
    font-size: 24px;
    font-weight: bold;
    color: #6A0DAD;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.step-visual {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.step-visual img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.step-text {
    font-size: 16px;
    line-height: 1.5;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 15px;
    /* Added spacing from visual */
}

/* --- Back Cover --- */
.page-back {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #dbc5eb !important;
}

.back-content {
    text-align: center;
}

.brand {
    font-size: 24px;
    font-weight: bold;
    color: #6A0DAD;
    margin-bottom: 20px;
}

.final-visual img {
    max-width: 80%;
    max-height: 250px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.website {
    margin-bottom: 40px;
}

.website a {
    color: #8A8A8A;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.website a:hover {
    text-decoration: underline;
    color: #2a4073;
}

.thank-you {
    font-style: italic;
    color: #777;
}

/* --- Common --- */
.page-number {
    /* margin-top: auto; Removed to prevent splitting free space with footer */
    text-align: center;
    font-size: 12px;
    color: #999;
    /* order: 10; Removed as it's now in DOM order */
    margin: 0;
    /* Reset margins */
}

/* --- Footer (New) --- */
/* --- Footer (New) --- */
.footer {
    margin-top: auto;
    /* Push to bottom of flex container */
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    /* Align to baseline as requested */
    font-size: 0.8em;
    color: #8A8A8A;
    /* Medium grey for 'Crafted by' */
    width: 100%;
}

.footer-left-brand {
    color: #683695;
    /* Richer purple */
    font-weight: 500;
    /* Match others */
}

.company-link {
    color: #8A8A8A;
    /* Matched to 'Crafted by' grey */
    /* Softer blue-violet */
    text-decoration: none;
    font-weight: 500;
}

.company-link:hover {
    text-decoration: underline;
}


/* --- Advanced UI Controls --- */

/* Side Arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 1000;
    transition: background 0.3s, transform 0.2s;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.prev-arrow {
    left: 20px;
}

.next-arrow {
    right: 20px;
}

/* Bottom Toolbar */
.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    /* Reduced from 60px */
    background: rgba(30, 30, 30, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    /* Reduced from 30px */
    z-index: 2000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    padding: 0 10px;
    /* Reduced padding */
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    pointer-events: none;
    /* Let clicks pass through background to book corners */
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Reduced from 15px */
    pointer-events: auto;
    /* Re-enable clicks on actual buttons */
}

.bottom-toolbar button {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 14px;
    /* Reduced from 18px */
    cursor: pointer;
    padding: 5px;
    /* Reduced from 8px */
    border-radius: 4px;
    /* Slightly tighter radius */
    transition: color 0.2s, background 0.2s;
}

.bottom-toolbar button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.slider-group {
    color: #ccc;
    font-size: 14px;
    font-family: sans-serif;
    min-width: 250px;
}

#page-slider {
    flex-grow: 1;
    margin: 0 10px;
    cursor: pointer;
    accent-color: #6A0DAD;
    /* Purple brand color */
}

/* Hide old controls if any remain */
#controls {
    display: none;
}

/* --- Shadows for depth --- */
.turn-page-wrapper {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* --- Loader --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #240E35;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #6A0DAD;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 18px;
    letter-spacing: 1px;
}

/* --- Help Overlay --- */
#help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 5000;
    display: flex;
    /* Hidden via JS later or styled interactions */
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#help-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.help-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    color: #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.help-content i.fa-hand-pointer {
    font-size: 50px;
    color: #6A0DAD;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.help-content h3 {
    margin: 0 0 15px 0;
    color: #222;
}

.help-content p {
    font-size: 16px;
    color: #555;
    margin: 10px 0;
}

#close-help {
    margin-top: 25px;
    padding: 10px 30px;
    background: #6A0DAD;
    color: white;
    border: none;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
}

#close-help:hover {
    background: #580b94;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Print Styles --- */
@media print {

    /* Reset layout */
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
        background: #ffffff !important;
    }

    /* One page per sheet, full width */
    .flipbook-viewport,
    .container,
    .flipbook,
    .flipbook .page {
        width: 100% !important;
        /* fill printable width */
        height: auto !important;
        margin: 0 !important;
        box-shadow: none !important;
        display: block !important;
    }

    .flipbook .page {
        page-break-after: always;
        border: 1px solid #ddd;
        background: #ffffff !important;
    }

    /* Cover behaves like normal page, not small card */
    .page-cover.geometric-theme {
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
        overflow: hidden !important;
    }

    /* Hide only UI (keep .hard pages visible) */
    .nav-arrow,
    .bottom-toolbar,
    #loader,
    #help-overlay,
    .ignore-print {
        display: none !important;
    }
}


/* --- Responsive Adjustments --- */
@media screen and (max-width: 1024px) {
    .flipbook-viewport {
        transform: scale(0.8);
    }
}

@media screen and (max-width: 768px) {
    .flipbook-viewport {
        width: 100% !important;
        height: auto !important;
        transform: none !important;
        /* Handle scaling via JS or native resize */
        overflow: visible;
    }

    .container {
        overflow: visible;
        height: auto;
        padding-top: 20px;
        padding-bottom: 80px;
        /* Space for toolbar */
    }

    .flipbook {
        width: 100% !important;
        height: auto !important;
        margin: 0 auto;
    }

    .flipbook .page {
        width: 100% !important;
        /* Make page take full width */
        height: auto !important;
        /* Auto height to fit content */
        min-height: 500px;
    }

    .nav-arrow {
        display: none;
        /* Hide side arrows on mobile, rely on swipe/toolbar */
    }

    .bottom-toolbar {
        padding: 0 5px;
        gap: 5px;
    }

    .slider-group {
        display: none;
        /* Hide slider on very small screens to save space */
    }

    /* Optimize font sizes for mobile */
    .cover-title {
        font-size: 24px;
    }

    .cover-subtitle {
        font-size: 14px;
    }

    .step-text {
        font-size: 14px;
    }
}