/* Modern Bangla ePaper Pro - Stylesheet */

.epaper-app-root {
    font-family: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e293b;
    background: #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* Header Bar */
.epaper-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.epaper-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epaper-toggle-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.epaper-toggle-sidebar-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.epaper-brand-title {
    display: flex;
    flex-direction: column;
}

.epaper-title-text {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.epaper-date-text {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.epaper-header-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.epaper-date-picker-wrap,
.epaper-page-jump-wrap {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px 8px;
}

.epaper-label-icon {
    display: flex;
    align-items: center;
    color: #64748b;
    margin-right: 4px;
}

.epaper-select-control {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    padding: 6px 4px;
    cursor: pointer;
    outline: none;
}

.epaper-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epaper-btn-group {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
}

.epaper-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-right: 1px solid #e2e8f0;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

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

.epaper-icon-btn:hover {
    background: #e2e8f0;
    color: #0284c7;
}

.epaper-page-indicator {
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    border-right: 1px solid #e2e8f0;
}

/* Workspace Layout */
.epaper-main-workspace {
    display: flex;
    height: calc(100vh - 150px);
    min-height: 600px;
    max-height: 900px;
    position: relative;
    background: #cbd5e1;
    overflow: hidden;
}

/* Left Sidebar Thumbnails (Vertical Scroll) */
.epaper-thumbnails-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    z-index: 20;
    transition: transform 0.3s ease;
}

.epaper-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.epaper-sidebar-title {
    padding: 10px 14px;
    background: #0f172a;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #334155;
}

.epaper-thumbs-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.epaper-thumbs-scrollable::-webkit-scrollbar {
    width: 6px;
}
.epaper-thumbs-scrollable::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.epaper-thumb-card {
    background: #334155;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.epaper-thumb-card:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
}

.epaper-thumb-card.active {
    border-color: #0284c7;
    background: #0f172a;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
}

.thumb-img-box {
    width: 100%;
    height: 190px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.thumb-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.thumb-caption {
    text-align: center;
    margin-top: 6px;
}

.badge-page-num {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

.epaper-thumb-card.active .badge-page-num {
    background: #0284c7;
    color: #ffffff;
}

/* Center Viewport */
.epaper-viewport {
    flex: 1;
    overflow: auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px;
    background: #94a3b8;
}

.epaper-viewport::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.epaper-viewport::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}

.epaper-canvas-container {
    display: inline-block;
    margin: auto;
}

.epaper-page-render-stage {
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    background: #ffffff;
    line-height: 0;
    transition: transform 0.2s ease-out;
}

#epaper-main-page-img {
    max-width: 850px;
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.epaper-interactive-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Interactive Clickable Hotspots */
.epaper-clip-hotspot {
    position: absolute;
    box-sizing: border-box;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.epaper-clip-hotspot:hover {
    background: rgba(2, 132, 199, 0.22);
    border: 2px dashed #0284c7;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.3);
}

.clip-pulse-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #0284c7;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.epaper-clip-hotspot:hover .clip-pulse-dot {
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.3);
}

.clip-tooltip {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.epaper-clip-hotspot:hover .clip-tooltip {
    opacity: 1;
}

/* Floating Navigation Arrows */
.epaper-float-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 15;
}

.epaper-float-arrow:hover {
    background: #0284c7;
    transform: translateY(-50%) scale(1.1);
}

.epaper-float-arrow.arrow-left {
    left: 15px;
}

.epaper-float-arrow.arrow-right {
    right: 15px;
}

/* News Modal / Lightbox Popup */
.epaper-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.epaper-modal-dialog {
    width: 100%;
    max-width: 820px;
    height: 90vh;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: epaperModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.epaper-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    flex: 1;
}

@keyframes epaperModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.epaper-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 40px);
}

.modal-category-badge {
    background: #0284c7;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.modal-clip-headline {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epaper-modal-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
}

.epaper-modal-close-btn:hover {
    color: #ef4444;
}

.epaper-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.epaper-modal-body::-webkit-scrollbar {
    width: 8px;
}
.epaper-modal-body::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}
.epaper-modal-body::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
.epaper-modal-body::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.epaper-modal-clip-viewer {
    max-width: 100%;
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    margin-bottom: 10px;
}

.modal-canvas-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
}

/* Zoom toolbar inside modal */
.modal-img-zoom-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.modal-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    color: #475569;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}
.modal-zoom-btn:hover {
    background: #0284c7;
    border-color: #0369a1;
    color: #ffffff;
}

.modal-zoom-level-label {
    font-size: 12px;
    font-weight: 700;
    color: #0284c7;
    min-width: 38px;
    text-align: center;
    background: #e0f2fe;
    border-radius: 4px;
    padding: 2px 6px;
}

.modal-zoom-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-left: auto;
    white-space: nowrap;
}

/* Scroll wrap holds the canvas and clips/overflows when zoomed */
.modal-canvas-scroll-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    background: #0f172a;
    border-radius: 0 0 8px 8px;
    border: 1px solid #e2e8f0;
    border-top: none;
    min-height: 80px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

#epaper-modal-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    transition: transform 0.08s ease-out;
    will-change: transform;
    transform-origin: top center;
}

.epaper-modal-text-content {
    width: 100%;
    margin-top: 15px;
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.article-text-body {
    font-size: 15px;
    line-height: 1.8;
    color: #334155;
}

/* Modal Footer & Actions */
.epaper-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 12px;
}

.epaper-modal-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.epaper-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.epaper-action-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.epaper-action-btn.btn-download {
    background: #0284c7;
    border-color: #0369a1;
    color: #ffffff;
}

.epaper-action-btn.btn-download:hover {
    background: #0369a1;
}

.epaper-modal-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-right: 4px;
}

.social-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.social-share-btn:hover {
    transform: scale(1.1);
}

.social-share-btn.fb { background: #1877f2; }
.social-share-btn.wa { background: #25d366; }
.social-share-btn.x  { background: #000000; }
.social-share-btn.copy-link { background: #64748b; }

/* Toast Notification */
.epaper-toast {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100000;
}

.epaper-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.epaper-modal-open {
    overflow: hidden;
}

/* Mobile & Tablet Responsive */
@media (max-width: 900px) {
    .epaper-thumbnails-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 10px 0 25px rgba(0,0,0,0.3);
    }

    .epaper-thumbnails-sidebar.open {
        transform: translateX(0);
    }
}

@media (max-width: 600px) {
    .epaper-header-bar {
        padding: 10px;
    }
    .epaper-header-left, .epaper-header-center, .epaper-header-right {
        width: 100%;
        justify-content: space-between;
    }
    .epaper-main-workspace {
        height: 70vh;
    }
    .epaper-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .epaper-modal-actions-left, .epaper-modal-actions-right {
        justify-content: center;
    }
}
