/* ======================================================
   Custom E-Paper Viewer Style Sheet
   Branding: Maroon (#821a24) & Gold (#d9a426)
   Theme: Premium Newspaper Editorial Style
   ====================================================== */

:root {
    --primary-color: #821a24;
    --primary-hover: #611219;
    --secondary-color: #d9a426;
    --secondary-hover: #b8861b;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --border-color: #cbd5e1;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --canvas-bg: #cbd5e1; /* Matte gray background for canvas page contrast */
    --text-color: #1e293b;
    --text-muted: #64748b;
}

/* Base Wrapper Container */
.epaper-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-color);
}

/* Premium Newspaper Masthead Header */
.epaper-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px 0;
    border-top: 4px double var(--primary-color);
    border-bottom: 4px double var(--primary-color);
    background: #ffffff;
}

.epaper-brand-title {
    font-family: "Georgia", "Times New Roman", Times, serif;
    font-size: 42px;
    font-weight: 900;
    color: var(--primary-color);
    margin: 0 0 5px 0;
    letter-spacing: -1px;
}

.epaper-brand-tagline {
    font-family: "Georgia", serif;
    font-size: 14px;
    font-style: italic;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.tagline-divider {
    color: var(--secondary-color);
    font-size: 12px;
}

/* Hide standard horizontal rule */
.epaper-container hr {
    display: none;
}

/* Filter Bar Styling */
.epaper-filter {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    margin: 0;
    max-width: 320px;
    width: auto;
    box-sizing: border-box;
}

.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 170px;
}

.calendar-icon {
    position: absolute;
    left: 10px;
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.epaper-filter input[type="date"] {
    width: 100%;
    height: 38px;
    padding: 0 8px 0 32px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background-color: var(--bg-light);
    color: var(--text-color);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.epaper-filter input[type="date"]:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(130, 26, 36, 0.12);
}

.epaper-filter input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

/* Webkit datetime edit placeholder style when no value selected */
.epaper-filter input[type="date"]::-webkit-datetime-edit {
    color: #94a3b8 !important; /* Placeholder color by default */
}

/* Override back to normal text color when value is selected */
.epaper-filter input[type="date"].has-value::-webkit-datetime-edit {
    color: var(--text-color) !important;
}

/* Also style individual datetime field items for different browsers */
.epaper-filter input[type="date"]::-webkit-datetime-edit-text,
.epaper-filter input[type="date"]::-webkit-datetime-edit-month-field,
.epaper-filter input[type="date"]::-webkit-datetime-edit-day-field,
.epaper-filter input[type="date"]::-webkit-datetime-edit-year-field {
    color: #94a3b8 !important;
}

.epaper-filter input[type="date"].has-value::-webkit-datetime-edit-text,
.epaper-filter input[type="date"].has-value::-webkit-datetime-edit-month-field,
.epaper-filter input[type="date"].has-value::-webkit-datetime-edit-day-field,
.epaper-filter input[type="date"].has-value::-webkit-datetime-edit-year-field {
    color: var(--text-color) !important;
}

/* Custom Date Input Placeholder for Mobile Devices */
.date-text-display {
    display: none;
}

.date-input-wrapper.is-mobile {
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-light);
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

.date-input-wrapper.is-mobile:focus-within {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(130, 26, 36, 0.12);
}

.date-input-wrapper.is-mobile .date-text-display {
    display: inline-block;
    padding-left: 32px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8; /* Placeholder color by default */
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    box-sizing: border-box;
}

.date-input-wrapper.is-mobile .date-text-display.has-value {
    color: var(--text-color) !important;
}

.date-input-wrapper.is-mobile input[type="date"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0 !important;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
}

.epaper-filter button {
    position: relative;
    height: 38px;
    padding: 0 20px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(130, 26, 36, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.epaper-filter button:hover:not(:disabled) {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(130, 26, 36, 0.25);
    transform: translateY(-1px);
}

.epaper-filter button:active:not(:disabled) {
    transform: scale(0.97);
}

.epaper-filter button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Loading State Animation */
.epaper-filter button .btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: button-spin 0.8s ease-in-out infinite;
}

.epaper-filter button.loading .btn-text {
    visibility: hidden;
    opacity: 0;
}

.epaper-filter button.loading .btn-loader {
    display: block;
    position: absolute;
}

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

/* Main Viewer Layout */
.epaper-viewer {
    display: flex;
    gap: 0;
    height: 80vh;
    min-height: 600px;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: var(--bg-light);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    position: relative;
}

/* Sidebar Styling: Stays perfectly fixed and handles overflow independently */
.epaper-sidebar {
    width: 220px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--border-color);
    padding: 16px;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: rgba(130, 26, 36, 0.4) #ffffff;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.epaper-sidebar::-webkit-scrollbar {
    width: 6px;
}

.epaper-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.epaper-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(130, 26, 36, 0.3);
    border-radius: 3px;
}

.epaper-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color);
}

/* Sidebar Mobile Overlay backdrop */
.epaper-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 998;
}

.epaper-viewer.sidebar-open .epaper-sidebar-overlay {
    display: block;
}

/* Thumbnail Card Styling */
.thumb {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    outline: none;
}

.thumb:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.thumb.active {
    border-color: var(--primary-color);
    border-left: 4px solid var(--secondary-color); /* Premium gold left tab accent */
    background-color: rgba(130, 26, 36, 0.02);
    box-shadow: 0 4px 12px rgba(130, 26, 36, 0.08);
}

.thumb img,
.thumb canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.thumb span {
    display: block;
    margin-top: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s;
}

.thumb.active span {
    color: var(--primary-color);
}

/* Main Content Column */
.epaper-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--canvas-bg);
    position: relative;
    overflow: hidden;
}

/* Sticky Toolbar: Always remains at the top, does not overlap with image */
.epaper-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    flex-wrap: wrap;
    gap: 16px;
    box-sizing: border-box;
}

/* Navigation Controls inside toolbar */
.epaper-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epaper-navigation button {
    height: 38px;
    padding: 0 16px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.more-controls-btn {
    display: none !important;
}

.epaper-navigation button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(130, 26, 36, 0.02);
}

.epaper-navigation button:active:not(:disabled) {
    transform: scale(0.96);
}

/* Page Pagination Styling */
.epaper-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--card-shadow);
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

.pagination-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(130, 26, 36, 0.04);
    box-shadow: var(--hover-shadow);
}

.pagination-btn:active {
    transform: scale(0.92);
}

.pagination-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(130, 26, 36, 0.25);
}

.pagination-btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    user-select: none;
}

/* Zoom & View Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-controls button {
    min-width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-controls button:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(130, 26, 36, 0.02);
}

.zoom-controls button:active:not(:disabled) {
    transform: scale(0.96);
}

#zoomReset {
    font-size: 13px;
    font-weight: 600;
    padding: 0 12px;
    min-width: 55px;
}

/* Scrollable Canvas for E-Paper Display */
.epaper-canvas {
    flex: 1;
    overflow: auto;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    padding: 30px 40px; /* added spacing around pages */
    display: flex;
    background: var(--canvas-bg);
    scrollbar-width: thin;
    scrollbar-color: rgba(130, 26, 36, 0.4) var(--canvas-bg);
    box-sizing: border-box;
}

.epaper-canvas::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.epaper-canvas::-webkit-scrollbar-track {
    background: var(--canvas-bg);
    border-radius: 4px;
}

.epaper-canvas::-webkit-scrollbar-thumb {
    background-color: rgba(130, 26, 36, 0.3);
    border: 2px solid var(--canvas-bg);
    border-radius: 6px;
}

.epaper-canvas::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-color);
}

.epaper-canvas.dragging {
    cursor: grabbing;
}

.epaper-canvas.dragging * {
    cursor: grabbing !important;
}

/* Main Image / Canvas: Centering + Premium Drop Shadow */
#mainPage {
    max-width: none;
    height: auto;
    display: block;
    margin: auto;
    border-radius: 6px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: width 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #ffffff;
    -webkit-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

/* Floating Navigation Arrows Removed */

/* ======================================================
   State Overrides: Collapses & Hides
   ====================================================== */

/* Collapsed Sidebar */
.epaper-viewer.sidebar-collapsed .epaper-sidebar {
    width: 0;
    padding: 0;
    border-right: none;
}



/* ======================================================
   Reading Mode Theme Overlay Styles
   ====================================================== */
.epaper-container.reading-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10000;
    background: var(--bg-dark);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.epaper-container.reading-mode .epaper-viewer {
    flex: 1;
    height: auto;
    border: none;
    border-radius: 0;
    background: #1e293b;
    box-shadow: none;
}

.epaper-container.reading-mode .epaper-sidebar,
.epaper-container.reading-mode .epaper-sidebar-overlay {
    display: none !important;
}

.epaper-container.reading-mode .epaper-toolbar {
    background: #1e293b;
    border: none;
    border-bottom: 1px solid #334155;
    border-radius: 0;
    color: #f8fafc;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.epaper-container.reading-mode .epaper-toolbar button {
    background: #334155;
    color: #f8fafc;
    border-color: #475569;
}

.epaper-container.reading-mode .epaper-toolbar button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(130, 26, 36, 0.25);
}

.epaper-container.reading-mode .epaper-pagination {
    background-color: #1e293b;
    border-color: #334155;
}

.epaper-container.reading-mode .pagination-btn {
    background-color: #334155;
    color: #f8fafc;
    border-color: #475569;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.epaper-container.reading-mode .pagination-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    color: #ffffff;
}

.epaper-container.reading-mode .pagination-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.epaper-container.reading-mode .pagination-ellipsis {
    color: #94a3b8;
}

.epaper-container.reading-mode .epaper-canvas {
    background: var(--bg-dark);
}

/* ======================================================
   Fullscreen Mode Styles
   ====================================================== */
.epaper-container:fullscreen {
    background: var(--bg-light);
    padding: 30px;
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.epaper-container:fullscreen .epaper-viewer {
    flex: 1;
    height: calc(100vh - 100px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 15px;
}

.epaper-container:fullscreen .epaper-toolbar {
    border-radius: 8px;
}

/* Safari / Webkit Fullscreen support */
.epaper-container:-webkit-full-screen {
    background: var(--bg-light);
    padding: 30px;
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.epaper-container:-webkit-full-screen .epaper-viewer {
    flex: 1;
    height: calc(100vh - 100px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 15px;
}

.epaper-container:-webkit-full-screen .epaper-toolbar {
    border-radius: 8px;
}

/* ======================================================
   Accessibility focus indicators
   ====================================================== */
.epaper-viewer *:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reading mode active state styling */
.reading-mode-btn.active {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-hover) !important;
}



/* ======================================================
   Responsive Design Media Queries
   ====================================================== */

/* Tablets and below */
@media (max-width: 1024px) {
    .epaper-toolbar {
        gap: 12px;
        padding: 10px 15px;
        flex-wrap: wrap;
    }
    
    .epaper-navigation {
        order: 1;
    }

    .epaper-filter {
        order: 2;
    }

    .zoom-controls {
        width: 100%;
        order: 3;
        justify-content: center;
        border-top: 1px solid var(--border-color);
        padding-top: 8px;
    }

    /* Touch targets minimum size */
    .zoom-controls button {
        min-width: 44px;
        height: 44px;
    }

    #zoomReset {
        min-width: 64px !important;
    }

    #toggleSidebar {
        height: 44px;
        min-width: 44px;
    }

    .epaper-filter input[type="date"],
    .date-input-wrapper.is-mobile,
    .epaper-filter button {
        height: 44px;
    }

    .epaper-canvas {
        padding: 30px 20px;
    }
}

/* Small Viewports (drawer trigger) */
@media (max-width: 768px) {
    .epaper-viewer {
        height: 70vh;
        min-height: 500px;
    }

    .epaper-sidebar {
        position: fixed;
        top: 0;
        left: -240px;
        height: 100%;
        width: 220px;
        z-index: 999;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    }

    .epaper-viewer.sidebar-open .epaper-sidebar {
        left: 0;
    }
}

/* Mobile Screens */
@media (max-width: 640px) {
    .epaper-header {
        padding: 10px 0;
    }
    
    .epaper-brand-title {
        font-size: 28px;
    }
    
    .epaper-brand-tagline {
        font-size: 12px;
        flex-direction: column;
        gap: 4px;
    }
    
    .tagline-divider {
        display: none;
    }

    .epaper-viewer {
        height: 80vh !important;
        min-height: 600px !important;
    }

    .epaper-toolbar {
        padding: 12px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .epaper-navigation {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        gap: 12px !important;
        overflow: hidden !important;
    }

    .more-controls-btn {
        display: inline-flex !important;
        height: 44px;
        min-width: 44px;
        padding: 0 16px;
        font-size: 15px;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
        cursor: pointer;
        border: 1px solid var(--border-color);
        background: #ffffff;
        color: var(--text-color);
        border-radius: 6px;
        font-weight: 600;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .more-controls-btn:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    #toggleSidebar {
        height: 44px;
        min-width: 44px;
        padding: 0 16px;
        font-size: 15px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    .epaper-filter {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        width: 100%;
        max-width: 100%;
        margin: 0;
        gap: 10px;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .date-input-wrapper {
        flex: 72 1 0%;
        min-width: 0;
    }

    .calendar-icon {
        left: 10px;
        font-size: 14px;
    }

    .epaper-filter input[type="date"] {
        width: 100%;
        height: 44px;
        padding: 0 8px 0 32px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        font-size: 14px;
        box-sizing: border-box;
    }

    .epaper-filter button {
        flex: 28 1 0%;
        height: 44px;
        padding: 0;
        font-size: 14px;
        min-width: 0 !important;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .zoom-controls {
        display: none !important; /* Hide secondary toolbar controls on mobile */
    }

    .epaper-pagination {
        position: static !important;
        background-color: transparent !important;
        border-top: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        overflow-x: auto;
        white-space: nowrap;
        display: flex !important;
        justify-content: flex-start !important;
        flex: 1;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .epaper-pagination::-webkit-scrollbar {
        display: none;
    }

    .pagination-btn {
        min-width: 44px;
        height: 44px;
        font-size: 15px;
        flex-shrink: 0;
    }

    .pagination-ellipsis {
        width: 30px;
        flex-shrink: 0;
    }
    
    .epaper-canvas {
        padding: 10px !important;
    }
}

/* Extremely Narrow Screens Override */
@media (max-width: 320px) {
    .epaper-filter {
        flex-wrap: wrap !important;
    }
    .date-input-wrapper {
        flex: 0 0 100% !important;
        width: 100% !important;
    }
    .epaper-filter button {
        flex: 0 0 100% !important;
        width: 100% !important;
        height: 44px !important;
    }
}

/* ======================================================
   Mobile Bottom Sheet Styles
   ====================================================== */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    width: 100%;
    background: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 16px 20px calc(24px + env(safe-area-inset-bottom)) 20px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    max-height: 85vh;
    overflow-y: auto;
}

.bottom-sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.bottom-sheet-drag-handle {
    width: 40px;
    height: 4px;
    background-color: #cbd5e1;
    border-radius: 2px;
    margin: 0 auto 16px auto;
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.bottom-sheet-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color); /* Project brand Maroon */
}

.bottom-sheet-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
}

.bottom-sheet-close:hover {
    color: var(--text-color);
}

.bottom-sheet-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Zoom Row styling inside bottom sheet */
.sheet-zoom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 52px;
    padding: 0 12px;
    background-color: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.sheet-zoom-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.sheet-zoom-buttons {
    display: flex;
    gap: 8px;
}

.sheet-zoom-buttons .sheet-btn {
    width: 48px; /* minimum touch target size 48px */
    height: 40px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sheet-zoom-buttons .sheet-btn:active {
    background-color: #f1f5f9;
    transform: scale(0.95);
}

/* Option Item buttons inside bottom sheet */
.sheet-option-btn {
    width: 100%;
    height: 48px; /* Touch target minimum 48px */
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    box-sizing: border-box;
}

.sheet-option-btn .option-icon {
    margin-right: 14px;
    font-size: 18px;
    width: 24px;
    text-align: center;
    display: inline-block;
}

.sheet-option-btn .option-text {
    flex: 1;
}

.sheet-option-btn .option-check {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 700;
}

/* ======================================================
   Professional Empty State Styles
   ====================================================== */
.epaper-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: #ffffff;
    text-align: center;
    padding: 40px;
    box-sizing: border-box;
}

.no-results-content {
    max-width: 400px;
}

.no-results-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
    line-height: 1;
}

.epaper-no-results h2 {
    font-family: "Georgia", serif;
    font-size: 24px;
    color: var(--primary-color);
    margin: 0 0 12px 0;
    font-weight: 700;
}

.epaper-no-results p {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.epaper-no-results p:last-child {
    margin-bottom: 0;
}