/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-app: #090d16;
    --bg-sidebar: #0f1626;
    --bg-card: rgba(20, 30, 50, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --bg-viewport: #0f172a;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent: #6366f1; /* Indigo */
    --accent-hover: #4f46e5;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --success: #10b981;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    
    --paper-bg: #fdfbf7;
    --paper-text: #1c1917;
    --paper-border: #e7e5e4;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    
    --font-ui: 'Outfit', sans-serif;
    --font-serif: 'Lora', Georgia, serif;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a, a:link, a:visited, a:hover, a:active {
    text-decoration: none;
    color: inherit;
}


body {
    font-family: var(--font-ui);
    background-color: #030712; /* Dark outer margins on desktop */
    color: var(--text-primary);
    overflow-y: auto;
    min-height: 100vh;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 0;
}

.site-wrapper {
    width: 100%;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-app);
    overflow: visible;
    position: relative;
}

@media (min-width: 1281px) {
    .site-wrapper {
        width: 80%;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Header Logo Banner */
.app-header {
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0;
    z-index: 100;
    box-sizing: border-box;
}

html:not(.light) .app-header {
    background: #0f172a;
}

.logo-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem;
    background: radial-gradient(circle, #f8fafc 0%, #f1f5f9 100%); /* gradient backplate for logo */
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

html:not(.light) .logo-row {
    background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
}

/* App Controls Bar below Navigation */
.app-controls-bar {
    width: 100%;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
    z-index: 90;
}

html:not(.light) .app-controls-bar {
    background: #0f172a;
}

.controls-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(15, 22, 38, 0.03);
    box-sizing: border-box;
}

html:not(.light) .controls-row {
    background: rgba(255, 255, 255, 0.02);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-img-large {
    max-height: 120px; /* Big logo size matching image */
    max-width: 90%;
    width: auto;
    object-fit: contain;
    display: block;
}

.brand-logo-large {
    background: var(--accent-gradient);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.8rem;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.brand-name-large {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 1rem;
}

html.light .brand-name-large {
    background: linear-gradient(to right, #0f172a, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navigation-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem;
}

.select-input, .date-input {
    background: transparent;
    color: var(--text-primary);
    border: none;
    outline: none;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    color-scheme: dark;
}

.select-input option {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 0.5rem;
}

html.light .select-input option {
    background-color: #ffffff;
    color: #0f172a;
}

.date-input {
    color-scheme: dark;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-ui);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-danger {
    background: var(--danger) !important;
    color: white !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-ui);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: var(--transition);
}

.btn-danger:hover {
    background: var(--danger-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* App Layout */
.app-container {
    display: flex;
    flex: 1;
    overflow: visible;
    position: relative;
}

/* Sidebar for Pages */
.sidebar-pages {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 90;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-pages.collapsed {
    margin-left: -260px;
}

.sidebar-title {
    padding: 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.thumbnails-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.thumbnail-item {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.thumbnail-item:hover {
    border-color: var(--text-muted);
}

.thumbnail-item.active {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.12);
}

.thumbnail-canvas-container {
    width: 100%;
    height: auto;
    background: transparent;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    margin: 0;
}

.thumbnail-canvas-container canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    display: block;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.thumbnail-label {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.thumbnail-item.active .thumbnail-label {
    color: var(--text-primary);
    font-weight: 600;
}

/* Main Viewport */
.main-viewport {
    flex: 1;
    background: var(--bg-viewport);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
    position: relative;
    padding: 1.25rem;
}

/* Paper Wrapper */
.paper-wrapper {
    position: relative;
    background: var(--paper-bg);
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    margin: 0 auto 1rem auto;
    transition: transform 0.1s ease-out;
    max-width: none !important;
}

#pdf-canvas {
    display: block;
    max-width: none !important;
    height: auto;
}



/* Floating Toolbar */
.floating-toolbar {
    display: none !important; /* Hide floating toolbar as requested */
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 22, 38, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 95;
    transition: var(--transition);
    white-space: nowrap !important;
}

#page-indicator {
    white-space: nowrap !important;
}

.toolbar-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.toolbar-btn.active {
    background: var(--accent);
    color: white;
}

.toolbar-divider {
    width: 1px;
    height: 1.25rem;
    background: var(--border-color);
    margin: 0 0.25rem;
}

/* Page Navigation Arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 22, 38, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    color: white;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 80;
}

.nav-arrow:hover {
    background: var(--accent-gradient);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.nav-arrow-left {
    left: 1.5rem;
}

.nav-arrow-right {
    right: 1.5rem;
}



/* Empty State / Welcome Screen */
.empty-state {
    text-align: center;
    padding: 3rem;
    max-width: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Header Actions Desktop Container */
.header-actions-desktop {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Mobile Bottom Bar Container */
.mobile-bottom-bar {
    display: none;
}

/* Responsive */
@media (max-width: 1280px) {
    .app-header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .brand {
        justify-content: center;
    }
    
    .brand-name {
        font-size: 1.1rem;
    }

    .header-actions-desktop {
        display: none !important; /* Hide Theme Toggle & Admin Login from top header on mobile */
    }

    .navigation-controls {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.4rem !important;
        align-items: center;
        justify-content: space-between;
    }

    .navigation-controls form {
        flex: 1;
        min-width: 0;
        margin: 0;
    }

    .navigation-controls .control-group {
        width: 100%;
        min-width: 0;
        padding: 0.15rem 0.25rem;
    }

    .navigation-controls .select-input,
    .navigation-controls .date-input {
        width: 100%;
        min-width: 0;
        font-size: 0.8rem;
        padding: 0.35rem 0.25rem;
        text-overflow: ellipsis;
    }

    .navigation-controls .btn-clear-date span {
        display: none !important;
    }
    
    .navigation-controls .btn-clear-date {
        padding: 0.4rem 0.6rem !important;
    }

    .logo-row {
        padding: 0.75rem 0.5rem !important;
    }

    .mobile-bottom-bar {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 54px !important;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        padding: 0.4rem 1rem;
        background: rgba(15, 22, 38, 0.95) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
        z-index: 9999 !important;
    }

    html.light .mobile-bottom-bar {
        background: rgba(255, 255, 255, 0.95) !important;
        border-top-color: #cbd5e1;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    }

    .main-viewport {
        padding: 0.5rem;
        padding-bottom: 65px !important;
    }

    .floating-toolbar {
        bottom: 4.5rem !important;
        z-index: 9990 !important;
        white-space: nowrap !important;
        max-width: 95vw !important;
        padding: 0.4rem 0.6rem !important;
        gap: 0.35rem !important;
    }

    .sidebar-pages {
        display: none !important;
    }

    #toggle-sidebar,
    #toggle-sidebar + .toolbar-divider {
        display: none !important;
    }

    .nav-arrow {
        width: 2.75rem;
        height: 2.75rem;
    }

    .nav-arrow-left {
        left: 0.5rem;
    }

    .nav-arrow-right {
        right: 0.5rem;
    }

    .front-page-landing {
        padding: 1.25rem 1rem 85px 1rem !important;
    }
}

@media (max-width: 1280px) {
        .editions-cards-grid {
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 0.75rem !important;
            width: 100% !important;
        }

        .edition-card {
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            border-radius: 8px !important;
        }

        .edition-card-header {
            padding: 0.5rem 0.75rem !important;
            font-size: 0.95rem !important;
        }

        .edition-card-body {
            height: auto !important;
            aspect-ratio: 1 / 1.414 !important;
            min-height: 0 !important;
            background: #ffffff !important;
        }
        
        html:not(.light) .edition-card-body {
            background: #0f172a !important;
        }

        .edition-card-img, .edition-card-canvas {
            object-fit: contain !important;
            height: 100% !important;
            width: 100% !important;
        }

        .edition-card-footer {
            padding: 0.4rem 0.75rem !important;
            font-size: 0.8rem !important;
        }
    }

/* PDF Page Navigator Bar Redesign */
.pdf-navigator-bar {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1.25rem auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border-radius: 4px;
    flex-shrink: 0;
    box-sizing: border-box;
}

html:not(.light) .pdf-navigator-bar {
    background: #1e293b;
    border-color: #334155;
}

.nav-left-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-center-group {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-right-group {
    display: flex;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #0f4c9c;
}

.pdf-download-btn-red {
    background: #dc2626;
    color: #ffffff;
    padding: 0.45rem 1.2rem;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    font-family: var(--font-ui);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.pdf-download-btn-red:hover {
    background: #b91c1c;
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-action-btn {
    border: none;
    background: #0f4c9c;
    color: #ffffff;
    font-weight: 600;
    padding: 0.45rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-ui);
    transition: all 0.2s ease;
}

.btn-clip {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-action-btn:hover {
    background: #0d3d7c;
    color: #ffffff;
}

.nav-select-wrapper {
    flex-shrink: 0;
}

.nav-page-select {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.45rem 0.8rem;
    font-size: 0.95rem;
    color: #1e3a8a;
    background-color: #ffffff;
    width: 200px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: var(--transition);
}

html:not(.light) .nav-page-select {
    background-color: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

.nav-page-select:focus {
    border-color: #ea580c;
}

.nav-pages-list {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    background-color: #ffffff;
}

html:not(.light) .nav-pages-list {
    border-color: #475569;
    background-color: #1e293b;
}

.nav-page-btn {
    border: none;
    background: #ffffff;
    color: #dc2626;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-right: 1px solid #e2e8f0;
    font-family: var(--font-ui);
}

html:not(.light) .nav-page-btn {
    background: #1e293b;
    border-right-color: #475569;
    color: #ef4444;
}

.nav-page-btn:last-child {
    border-right: none;
}

.nav-page-btn:hover {
    background: rgba(220, 38, 38, 0.05);
}

html:not(.light) .nav-page-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.nav-page-btn.active {
    background: #dc2626;
    color: #ffffff;
    font-weight: 600;
    border-right: 1px solid #dc2626;
}

.nav-page-btn.fast-forward {
    color: #dc2626;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1280px) {
    .pdf-navigator-bar {
        max-width: 100%;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .nav-page-select {
        width: 100%;
    }
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* Toggle icon display states based on active theme class */
html.light .theme-toggle-btn {
    background: #e2e8f0;
}
html.light .theme-toggle-btn:hover {
    background: #cbd5e1;
}

html.light .theme-toggle-btn .sun-icon {
    display: none;
}
html:not(.light) .theme-toggle-btn .moon-icon {
    display: none;
}

/* Light Theme Variables Override */
html.light {
    --bg-app: #f1f5f9; /* Slate 100 */
    --bg-sidebar: #ffffff; /* White */
    --bg-card: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.08);
    --bg-viewport: #e2e8f0; /* Light viewport background around page */
    
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94a3b8; /* Slate 400 */
}

html.light body {
    background-color: #cbd5e1; /* Centered layout outer margin background */
}

/* Fix any header button visibility or styling in light mode */
html.light .btn-primary {
    color: white !important;
}
html.light .brand-logo {
    background: var(--accent-gradient);
    color: white;
}
html.light .select-input, 
html.light .date-input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}
html.light .app-header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border-color);
}
html.light .brand-name {
    background: linear-gradient(to right, #0f172a, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
html.light .control-group {
    background: #ffffff;
    border-color: #cbd5e1;
}
html.light .date-input {
    color-scheme: light;
}
html.light .floating-toolbar {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
html.light .toolbar-btn {
    background: #0f4c9c !important;
    color: #ffffff !important;
}
html.light .toolbar-btn:hover {
    background: #0d3d7c !important;
    color: #ffffff !important;
}
html.light .toolbar-btn.active {
    background: #dc2626 !important;
    color: #ffffff !important;
}
html.light .theme-toggle-btn {
    background: #0f4c9c !important;
    color: #ffffff !important;
    border-color: #0b3d7e !important;
}
html.light .theme-toggle-btn:hover {
    background: #0d3d7c !important;
    color: #ffffff !important;
}
html.light .pdf-download-btn-red {
    color: #ffffff !important;
}

/* ==========================================
   EXACT BOXED ZOOMER MODAL POPUP
   ========================================== */
.zoomer-modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    user-select: none;
    -webkit-user-select: none;
}

.zoomer-modal.active {
    display: flex !important;
}

.zoomer-card-modern {
    background-color: #ffffff;
    border: 3px solid #334155;
    border-radius: 10px;
    width: 90vw;
    max-width: 850px;
    height: 90vh;
    max-height: 90vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomer-pop 0.2s ease-out;
}

.zoomer-close-btn-round {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #0f4c9c;
    color: #ffffff !important;
    border: 2px solid #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10010;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}
.zoomer-close-btn-round:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.zoomer-card-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* 1. Sharing Row inside Zoomer */
.zoomer-sharing-row {
    display: flex;
    flex-shrink: 0;
    width: calc(100% - 45px);
    height: 38px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(0,0,0,0.08);
}

.zoomer-sharing-row .share-btn {
    height: 100%;
    padding: 0;
}

/* 2. Tabs Bar styling */
.zoomer-tabs-bar {
    display: flex;
    border-bottom: 1px solid #cbd5e1;
    margin-bottom: 1.5rem;
}
.zoomer-tab-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: -1px;
    position: relative;
    z-index: 2;
    cursor: default;
}

/* 3. Logo Centered Big styling */
.zoomer-logo-centered-big {
    text-align: center;
    margin-bottom: 0.85rem;
}
.zoomer-big-logo-img {
    max-height: 120px;
    max-width: 80%;
    object-fit: contain;
    display: inline-block;
}
.zoomer-big-logo-text {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* 4. Meta info */
.zoomer-meta-info {
    text-align: center;
    margin-bottom: 1rem;
    font-family: var(--font-ui);
}
.zoomer-meta-date-page {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}
.zoomer-meta-domains {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* 5. Divider Line */
.zoomer-divider-line {
    width: 100%;
    height: 1px;
    background-color: #cbd5e1;
    margin-bottom: 1.5rem;
}

/* 6. Body Content */
.zoomer-body-content {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: visible !important;
    background: #ffffff !important;
}

.zoomer-canvas-centered-wrapper {
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    top: unset !important;
    left: unset !important;
    position: relative !important;
    text-align: center;
}
#zoomer-canvas {
    display: inline-block;
    max-width: 100% !important;
    height: auto !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
}

/* Navigation Arrows Inside Zoomer */
.zoomer-prev-next-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    padding: 0 1rem;
    z-index: 10;
}
.zoomer-nav-arrow-btn {
    pointer-events: auto;
    background: rgba(15, 22, 38, 0.75);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}
.zoomer-nav-arrow-btn:hover {
    background: #0f4c9c;
    transform: scale(1.08);
}

.zoomer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #1e293b;
    z-index: 5;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem 2.5rem;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    box-shadow: var(--shadow-lg);
}

.zoomer-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(99, 102, 241, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: zoomer-spin 0.8s linear infinite;
}

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

/* Mobile Boxed Sizing & Layout */
@media (max-width: 1280px) {
    .zoomer-modal {
        padding: 0.75rem;
    }
    .zoomer-card {
        width: 92vw;
        height: 85vh;
        max-width: 92vw;
        max-height: 85vh;
        border-radius: 8px;
        border-width: 2px;
    }
    .zoomer-close-btn {
        top: 8px;
        right: 8px;
        width: 2rem;
        height: 2rem;
    }
}

/* Brand Logo Image */
.brand-logo-img {
    max-height: 42px;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

/* Edition Cards Gallery Bar */
.editions-gallery-wrapper {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    width: 100%;
}

html.light .editions-gallery-wrapper {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.editions-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.editions-gallery-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

html.light .editions-gallery-title {
    color: #475569;
}

.editions-cards-row {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.editions-cards-row::-webkit-scrollbar {
    height: 5px;
}

.editions-cards-row::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

/* Edition Card */
.edition-card {
    display: flex;
    flex-direction: column;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    min-width: 0;
    max-width: 380px;
    width: 360px;
    flex: 0 0 auto;
    text-decoration: none !important;
    color: #f8fafc !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    cursor: pointer;
}

html.light .edition-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

:root:not(.light) .edition-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc !important;
}

.edition-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -10px rgba(99, 102, 241, 0.35), 0 10px 15px -5px rgba(0, 0, 0, 0.5);
    border-color: var(--accent) !important;
}

html.light .edition-card:hover {
    box-shadow: 0 20px 35px -10px rgba(99, 102, 241, 0.2);
    border-color: var(--accent) !important;
}

.edition-card.active {
    border: 2px solid var(--accent) !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

/* Card Header */
.edition-card-header {
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-ui);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

html.light .edition-card-header {
    color: #0f172a !important;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

:root:not(.light) .edition-card-header {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.edition-card:hover .edition-card-header {
    color: var(--accent) !important;
}

/* Card Body Thumbnail */
.edition-card-body {
    padding: 0;
    background: #090d16;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 420px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

html.light .edition-card-body {
    background: #f1f5f9;
}

.edition-card-canvas, .edition-card-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #ffffff;
    opacity: 1;
    transition: transform 0.3s ease;
}

.edition-card:hover .edition-card-img,
.edition-card:hover .edition-card-canvas {
    transform: scale(1.03);
}

.edition-card-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #94a3b8;
    text-align: center;
    font-size: 0.95rem;
    height: 100%;
    width: 100%;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
}

html.light .edition-card-empty {
    background: #f8fafc;
    color: #64748b;
}

.edition-card-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}

html.light .edition-card-empty-icon {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.edition-card-empty-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

html.light .edition-card-empty-title {
    color: #1e293b;
}

.edition-card-empty-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 220px;
}

/* Card Footer */
.edition-card-footer {
    padding: 0.75rem 1.25rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

html.light .edition-card-footer {
    color: #475569 !important;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

:root:not(.light) .edition-card-footer {
    color: #cbd5e1 !important;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Front Page Landing View */
.front-page-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2.5rem 1.5rem;
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.editions-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 360px));
    gap: 2rem;
    justify-content: center;
    max-width: 1350px;
    width: 100%;
    margin-top: 1rem;
}

/* Front Page Date Bar & Chips */
.front-page-date-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
    max-width: 850px;
    width: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

html.light .front-page-date-bar {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.front-date-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.front-date-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.front-date-group {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.2rem 0.5rem;
    display: flex;
    align-items: center;
}

html.light .front-date-group {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-clear-date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none !important;
    transition: var(--transition);
}

.btn-clear-date:hover {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

html.light .btn-clear-date {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

html.light .btn-clear-date:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.front-date-chips {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    overflow: hidden;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

html.light .front-date-chips {
    border-top-color: #e2e8f0;
}

.chips-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.chips-scroll {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.chips-scroll::-webkit-scrollbar {
    height: 4px;
}

.chips-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    white-space: nowrap;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.date-chip:hover {
    color: var(--text-primary) !important;
    background: rgba(99, 102, 241, 0.18);
    border-color: var(--accent);
}

.date-chip.active {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

html.light .date-chip {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569 !important;
}

html.light .date-chip:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent) !important;
    border-color: var(--accent);
}

html.light .date-chip.active {
    background: var(--accent) !important;
    color: #ffffff !important;
}

.today-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.25);
    padding: 0.15rem 0.35rem;
    border-radius: 10px;
    line-height: 1;
}

/* Frontend Hotspots Overlay */
.paper-wrapper {
    position: relative;
    display: inline-block;
}

.paper-hotspots-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.frontend-hotspot-box {
    position: absolute;
    border: 2px solid transparent;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.18s ease;
    box-sizing: border-box;
}

.frontend-hotspot-box:hover {
    border-color: #ef4444;
    background: rgba(220, 220, 220, 0.15);
    box-shadow: none;
    z-index: 20;
}

.frontend-hotspot-badge {
    display: none !important;
}

/* High Quality Cropped News Article Zoomer Header & Controls */
.zoomer-header-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 1000;
    color: #ffffff;
}

html.light .zoomer-header-bar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: #e2e8f0;
    color: #0f172a;
}

.zoomer-article-title {
    display: none !important;
}

.zoomer-nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zoomer-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: inherit;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.zoomer-action-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

html.light .zoomer-action-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

html.light .zoomer-action-btn:hover {
    background: var(--accent);
    color: #ffffff;
}

/* Page Header & Red Line */
.viewport-page-header {
    width: 100%;
    margin-bottom: 1.25rem;
    text-align: left;
}

.viewport-page-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

.red-line {
    width: 100%;
    height: 3px;
    background-color: #dc2626;
    margin-bottom: 0.85rem;
}

/* Sharing Buttons Row */
.sharing-row {
    display: flex;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.share-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0;
    color: #ffffff !important;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.share-btn:last-child {
    border-right: none;
}

.share-btn:hover {
    opacity: 0.85;
    color: #ffffff !important;
}

.share-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: #ffffff !important;
    display: block;
}

.share-btn svg.stroke-icon {
    fill: none !important;
    stroke: #ffffff !important;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.share-facebook { background-color: #1877f2; }
.share-twitter { background-color: #000000; }
.share-whatsapp { background-color: #25d366; }
.share-linkedin { background-color: #0077b5; }
.share-telegram { background-color: #24a1de; }
.share-print { background-color: #b91c1c; }
.share-email { background-color: #475569; }

/* Clip Screenshot Selector */
.clip-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    cursor: crosshair;
}

.clip-box {
    position: absolute;
    border: 2px dashed #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
}

.clip-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border: 1px solid #ffffff;
    border-radius: 50%;
}
.clip-handle-tl { top: -5px; left: -5px; cursor: nwse-resize; }
.clip-handle-tr { top: -5px; right: -5px; cursor: nesw-resize; }
.clip-handle-bl { bottom: -5px; left: -5px; cursor: nesw-resize; }
.clip-handle-br { bottom: -5px; right: -5px; cursor: nwse-resize; }

.clip-actions-bar {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    background: #0f172a;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #334155;
    z-index: 105;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
}

.clip-btn-save {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.clip-btn-save:hover { background: #059669; }

.clip-btn-cancel {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.clip-btn-cancel:hover { background: #dc2626; }

/* Archive Calendar Modal */
.archive-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.archive-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.archive-modal-content {
    background: #ffffff;
    color: #1e293b;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.archive-modal.active .archive-modal-content {
    transform: scale(1);
}

.archive-modal-header {
    background: #0f4c9c;
    color: #ffffff;
    padding: 0.95rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.archive-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.archive-modal-close {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.archive-modal-close:hover {
    opacity: 1;
}

.archive-modal-body {
    padding: 1.25rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.calendar-nav-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: #e2e8f0;
}

.calendar-month-year {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
}

.calendar-grid-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.calendar-grid-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.5rem 0;
    text-transform: uppercase;
}

.calendar-grid-table td {
    padding: 0.35rem 0;
}

.calendar-day-btn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #334155;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-day-btn:hover:not(:disabled) {
    background: #f1f5f9;
}

.calendar-day-btn.has-issue {
    background: rgba(15, 76, 156, 0.1);
    color: #0f4c9c;
    font-weight: 700;
    border: 1px solid rgba(15, 76, 156, 0.3);
}

.calendar-day-btn.has-issue:hover {
    background: #0f4c9c;
    color: #ffffff !important;
}

.calendar-day-btn.selected-day {
    background: #dc2626 !important;
    color: #ffffff !important;
    font-weight: 700;
}

.calendar-day-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.4;
}

/* Dark mode overrides for Archive Modal */
html:not(.light) .archive-modal-content {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
}

html:not(.light) .calendar-month-year {
    color: #f8fafc;
}

html:not(.light) .calendar-nav-btn {
    background: #334155;
    border-color: #475569;
    color: #f8fafc;
}

html:not(.light) .calendar-nav-btn:hover {
    background: #475569;
}

html:not(.light) .calendar-day-btn {
    color: #cbd5e1;
}

html:not(.light) .calendar-day-btn:hover:not(:disabled) {
    background: #334155;
}

html:not(.light) .calendar-day-btn.has-issue {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
    border-color: rgba(129, 140, 248, 0.3);
}

html:not(.light) .calendar-day-btn.has-issue:hover {
    background: #818cf8;
    color: #0f172a !important;
}

html:not(.light) .calendar-day-btn:disabled {
    color: #475569;
}

/* Site Navigation Menu Bar */
.site-nav {
    background-color: #b91c1c; /* Crimson Red as in screenshot */
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.site-nav .nav-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    height: 44px;
}

.site-nav .nav-home-btn {
    background-color: #0f172a; /* Dark home button background */
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    transition: background-color 0.2s;
    cursor: pointer;
}

.site-nav .nav-home-btn:hover {
    background-color: #1e293b;
}

.site-nav .nav-menu-scroll {
    display: flex;
    align-items: center;
    overflow-x: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.site-nav .nav-menu-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.site-nav .nav-menu-item {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    transition: background-color 0.2s;
    cursor: pointer;
}

/* Active highlight style similar to Maharashtra tab in screenshot */
.site-nav .nav-menu-item:first-of-type {
    background-color: #475569; /* Highlight active tab as dark grey/slate in design */
    border-bottom: 3px solid #ffffff; /* underline */
}

.site-nav .nav-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

/* Breaking News Ticker */
.news-ticker-bar {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    height: 38px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 95;
}

html:not(.light) .news-ticker-bar {
    background-color: #0f172a;
    border-bottom-color: #334155;
}

.news-ticker-bar .ticker-badge {
    background-color: #dc2626; /* Bright Red badge as in screenshot */
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 0.85rem;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.15);
}

.news-ticker-bar .ticker-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 0.75rem;
}

.news-ticker-bar marquee {
    color: #1d4ed8; /* Blue text color as in screenshot */
    font-weight: 600;
    font-size: 0.9rem;
}

html:not(.light) .news-ticker-bar marquee {
    color: #60a5fa; /* Lighter blue in dark mode */
}

.news-ticker-bar .ticker-link {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.news-ticker-bar .ticker-link:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.news-ticker-bar .ticker-separator {
    color: var(--text-secondary);
    margin: 0 1rem;
    font-weight: normal;
}

/* Advertisement Banner Container */
.ad-banner-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.ad-banner-img {
    width: 100%;
    max-width: 728px;
    height: auto;
    max-height: 90px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Inline next page button */
.nav-next-page-btn-inline {
    display: none; /* hidden by default on desktop */
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #2563eb;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}
.nav-next-page-btn-inline:hover {
    background-color: #f1f5f9;
}
html:not(.light) .nav-next-page-btn-inline {
    background-color: #334155;
    border-color: #475569;
    color: #60a5fa;
}
html:not(.light) .nav-next-page-btn-inline:hover {
    background-color: #475569;
}

/* Navigation buttons combined right group */
.nav-right-group-combined {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-combined-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    height: 38px;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: var(--font-ui);
    transition: all 0.2s ease;
    color: #ffffff !important;
}

.nav-combined-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-pdf {
    background-color: #dc2626; /* Red background */
}

.btn-clip {
    background-color: #2563eb; /* Blue background */
}

.btn-archive {
    background-color: #0f172a; /* Dark/Navy background */
}
html.light .btn-archive {
    background-color: #1e293b;
}

@media (max-width: 1280px) {
    /* Header Logo scaling */
    .app-header .brand-logo-img-large {
        max-height: 80px !important;
        max-width: 95% !important;
        width: auto !important;
        margin: 0.25rem auto !important;
    }
    
    .brand-name-large {
        font-size: 1.6rem !important; /* Larger text if logo image is not set */
    }
    
    .controls-row {
        padding: 0.5rem 0.75rem !important;
    }
    
    .navigation-controls {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 0.4rem !important;
        justify-content: space-between !important;
    }

    /* PDF Navigator bar mobile redesign */
    .pdf-navigator-bar {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding: 0.5rem 0.25rem !important;
    }
    
    .nav-left-group {
        display: flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        flex: 1 !important;
        min-width: 0;
    }
    
    .nav-select-wrapper {
        flex: 1 !important;
        min-width: 0;
    }
    
    .nav-page-select {
        width: 100% !important;
        font-size: 0.9rem !important;
        padding: 0.45rem 0.5rem !important;
        text-overflow: ellipsis;
    }
    
    .nav-next-page-btn-inline {
        display: flex !important; /* show inline chevron-right next button on mobile */
    }
    
    .nav-pages-list {
        display: none !important; /* Hide long list of pages on mobile */
    }
    
    /* Right action buttons styling */
    .nav-right-group-combined {
        display: flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        border: none !important;
    }
    
    .nav-combined-btn {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 4px !important;
        flex: 0 0 auto !important;
    }
    
    .nav-combined-btn .btn-text {
        display: none !important; /* hide button label texts on mobile */
    }
    
    .btn-pdf {
        background-color: #dc2626 !important; /* Red */
    }
    
    .btn-clip {
        background-color: #1d4ed8 !important; /* Blue */
    }
    
    .btn-archive {
        background-color: #0f172a !important; /* Navy Blue */
    }
    
    html:not(.light) .btn-archive {
        background-color: #1e293b !important;
    }

    /* Sharing buttons - single horizontal row */
    .sharing-row {
        flex-wrap: nowrap !important;
        border-radius: 4px !important;
        overflow: hidden !important;
    }
    
    .share-btn {
        flex: 1 !important;
        width: auto !important;
        border: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .share-btn:last-child {
        border-right: none !important;
    }

    /* Navigation chevron panels on mobile */
    .nav-arrow {
        width: 32px !important;
        height: 100px !important;
        border-radius: 4px !important;
        background: rgba(0, 0, 0, 0.35) !important;
        border: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        display: flex !important;
    }
    .nav-arrow-left {
        left: 0.25rem !important;
    }
    .nav-arrow-right {
        right: 0.25rem !important;
    }
    .nav-arrow svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
        color: #ffffff !important;
    }
}

/* ePaper Print Styles */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .site-wrapper, .app-header, .sidebar-pages, .nav-arrow, .pdf-navigator-bar, .viewport-page-header, .floating-toolbar, .paper-hotspots-overlay {
        display: none !important;
    }
    .app-container {
        padding: 0 !important;
        margin: 0 !important;
    }
    .main-viewport {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .paper-wrapper {
        box-shadow: none !important;
        margin: 0 !important;
        border: none !important;
        width: 100% !important;
        height: auto !important;
    }
    #pdf-canvas {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        page-break-inside: avoid;
    }
}

/* Landing Page Scroll & Pull-to-Refresh Fix */
body.landing-mode {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    align-items: flex-start !important;
}

body.landing-mode .site-wrapper {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
}

body.landing-mode .front-page-landing {
    overflow-y: visible !important;
    flex: none !important;
    padding-bottom: 80px !important; /* Space for fixed mobile bottom bar */
}

/* Global Footer Styles */
.site-global-footer {
    background-color: #09090b !important; /* Premium black background */
    color: #94a3b8;
    padding: 1.25rem 1rem 5.5rem 1rem;
    width: 100%;
    border-top: 1px solid var(--border-color);
    margin-top: 0 !important; /* Remove spacing before footer */
    flex-shrink: 0;
    box-sizing: border-box;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}
.footer-social-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
}
.social-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    text-decoration: none;
}
.social-circle-btn:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}
.social-circle-btn svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
    display: block;
}
.social-circle-btn svg.stroke-icon {
    fill: none !important;
    stroke: #ffffff !important;
    stroke-width: 2.25;
}
.social-txt-g {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: #ffffff;
}
.social-facebook { background-color: #3b5998; }
.social-youtube { background-color: #ff0000; }
.social-pinterest { background-color: #bd081c; }
.social-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-telegram { background-color: #0088cc; }
.social-whatsapp { background-color: #25d366; }
.social-linkedin { background-color: #0077b5; }

.footer-copyright {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    text-align: center;
    font-family: var(--font-ui);
    letter-spacing: 0.025em;
    margin-top: 0.25rem;
}

/* Index Page Landing Footer Edge-to-Edge Alignment */
body.landing-mode .front-page-landing {
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden;
}
/* Ensure index main landing page content elements keep their side paddings */
body.landing-mode .front-page-landing > div:not(.site-global-footer),
body.landing-mode .front-page-landing > h2,
body.landing-mode .front-page-landing > p {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    box-sizing: border-box;
    width: 100%;
}
body.landing-mode .editions-cards-grid {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    box-sizing: border-box;
    width: 100%;
}
body.landing-mode .site-global-footer {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    body.landing-mode .front-page-landing {
        padding-top: 1.25rem !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    body.landing-mode .front-page-landing > div:not(.site-global-footer),
    body.landing-mode .front-page-landing > h2,
    body.landing-mode .front-page-landing > p {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    body.landing-mode .editions-cards-grid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Reader Viewer Mode Footer Edge-to-Edge Alignment */
body.viewer-mode .main-viewport {
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
/* Ensure index main reader view content elements keep their side paddings */
body.viewer-mode .main-viewport > div:not(.site-global-footer):not(.paper-wrapper),
body.viewer-mode .main-viewport > .pdf-navigator-bar,
body.viewer-mode .main-viewport > .viewport-page-header,
body.viewer-mode .main-viewport > .ad-banner-container {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    box-sizing: border-box;
    width: 100%;
}
body.viewer-mode .site-global-footer {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
}

@media (max-width: 768px) {
    body.viewer-mode .main-viewport {
        padding-top: 1.25rem !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    body.viewer-mode .main-viewport > div:not(.site-global-footer):not(.paper-wrapper),
    body.viewer-mode .main-viewport > .pdf-navigator-bar,
    body.viewer-mode .main-viewport > .viewport-page-header,
    body.viewer-mode .main-viewport > .ad-banner-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}




