/* ============================================================
   ePaper Theme - Main Styles
   Exact replica of Swadesh News ePaper design
   ============================================================ */

/* === TOP HEADER BAR === */
.top-header-bar {
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.main-logo-div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.logo-image {
    max-height: 75px;
    max-width: 210px;
    margin-top: 2px;
    margin-bottom: 2px;
    object-fit: cover;
}

.demo-logo {
    font-size: 32px;
    font-weight: 900;
    color: #ff6c37;
    font-family: 'Poppins', sans-serif;
    padding: 8px 0;
}

.advthead {
    flex: 1;
}

.header-nav-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.header-nav-links a {
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    color: grey;
    fill: grey;
    font-weight: normal;
}

.header-nav-links a:hover {
    color: #ff6c37;
    fill: #ff6c37;
}

.header-nav-links .icon {
    fill: currentColor;
}

/* Mobile hamburger */
#phone_toggle {
    display: none;
    cursor: pointer;
}

#phone_toggle svg {
    fill: #222;
}

/* === SIDEBAR (Mobile) === */
#sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    color: #000;
    transition: left 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
    z-index: 99999999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#sidebar.active {
    left: 0 !important;
}

/* === CITY EDITION BAR === */
.city-edition-bar {
    background-color: #000;
    padding: 0;
    position: relative;
    z-index: 9999;
}

.city-nav-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    white-space: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #000;
    height: 38px;
    min-height: 38px;
}

.nav-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    padding: 6px 8px;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-home-btn:hover {
    color: #ff6c37;
}

.nav-pipe-divider {
    display: inline-block;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    font-weight: 300;
    margin: 0 2px;
    user-select: none;
    pointer-events: none;
    flex-shrink: 0;
}

.city-nav-item {
    position: relative;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.city-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #ffffff;
    font-family: 'Mukta', 'Poppins', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    padding: 6px 7px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
    line-height: 1;
}
.city-nav-link:hover,
.city-nav-item.active-cat > .city-nav-link {
    color: #ff6c37;
}
.dropdown-caret {
    font-size: 8px;
    color: #ffffff;
    opacity: 0.85;
    margin-left: 2px;
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Category dropdown */
.city-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #000;
    border: 1px solid #333;
    border-top: 2px solid #ff6c37;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
    z-index: 999999;
    border-radius: 0 0 4px 4px;
    padding: 2px 0;
    margin: 0;
}

.city-dropdown-sublink {
    display: block;
    color: #f5f5f5;
    padding: 9px 14px;
    font-family: 'Mukta', 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.15s ease;
    white-space: nowrap;
    background: #000;
    text-align: left;
}
.city-dropdown-sublink:last-child {
    border-bottom: none;
}
.city-dropdown-sublink:hover,
.city-dropdown-sublink.is-active {
    background: #ff6c37;
    color: #ffffff;
    padding-left: 18px;
}

.city-nav-item:hover .city-dropdown-menu,
.city-nav-item.is-open .city-dropdown-menu {
    display: block;
}
.city-nav-item:hover .dropdown-caret,
.city-nav-item.is-open .dropdown-caret {
    transform: rotate(180deg);
}

/* === TOOLBAR SECTION === */
.toolbar-section {
    background: #fff;
    padding: 6px 0;
}

.toolbar-bg {
    background: #fff;
}

.toolbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ddd;
    padding: 4px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

/* Page dropdown */
.page-dropdown-wrap {
    width: 200px;
}

.page-select {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 13px;
    color: #555;
    background: #fff;
    cursor: pointer;
}

/* Pagination */
.pagination-list {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 20px;
}

.pagination-btn {
    padding: 3px 7px;
    min-width: 22px;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pagination-btn:hover {
    background: #f4f4f4;
}

.pagination-btn.pg-active {
    background-color: #ff6c37;
    color: #fff;
    border-color: #ff6c37;
}

/* Toolbar action buttons */
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #c7c7c7;
}

.toolbar-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    background: #ffffff;
    color: #5b5858;
    font-weight: bold;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
    gap: 5px;
}

.toolbar-action-btn:hover {
    background: #f4f4f4;
}

.toolbar-action-btn:active {
    transform: scale(0.97);
}

#downloadFullEdtPdf {
    border-right: 1px solid #c7c7c7 !important;
}

/* Archive date button */
.archive-date-btn {
    display: flex;
    align-items: center;
    gap: 0;
    border: none;
    padding: 5px 14px;
    cursor: pointer;
    color: #5b5858;
    font-weight: bold;
    font-size: 14px;
    border-left: 1px solid #c7c7c7;
    white-space: nowrap;
    background: #fff;
}

.archive-date-btn:hover {
    background: #f4f4f4;
}

.archive-date-btn input[type="date"] {
    width: 19px;
    background: #ffffff;
    cursor: pointer;
    color: #000;
    border: none;
    outline: none;
    padding: 0;
    font-size: 14px;
}

.archive-date-btn input[type="date"]:hover {
    background: #f4f4f4;
}

.archive-date-btn input[type="date"]:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

/* === MAIN CONTENT LAYOUT === */
.epaper-content-wrapper {
    display: flex;
    width: 100%;
}

.epaper-main-layout {
    display: flex;
    width: 100%;
    margin-top: 16px;
}

/* === LEFT SIDEBAR === */
.left-sidebar {
    display: block;
    margin-right: 10px;
    margin-bottom: 20px;
}

.thumbnails-list {
    width: 9.5rem;
    margin-right: 10px;
    min-height: calc(100vh);
    background: #fff;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thumb-item {
    cursor: pointer;
}

.thumb-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 4px 0;
    transition: all 0.3s;
}

.thumb-img {
    width: 100%;
    border: 3px solid rgba(50, 50, 50, .1);
    transition: border-color 0.3s;
}

.thumb-img:hover {
    border-color: #ff6c37;
}

.thumb-img.thumb-active {
    border: 3px solid #ff6c37;
}

.thumb-label {
    padding-top: 3px;
    font-size: 12px;
    text-align: center;
    color: #555;
}

/* === MAIN VIEWER === */
.main-viewer-section {
    flex: 1;
    width: 100%;
    font-size: 14px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 6px 2px;
}

.heading-with-line {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    border-left: 4px solid #ff6c37;
    padding-left: 10px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
}

/* Social media buttons */
.social-media-list {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-end;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
    flex: 0 0 auto;
}

.social-btn {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    flex: 0 0 auto;
}

.social-btn:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.social-facebook { background: #0054c3; }
.social-twitter { background: #23bb44; }
.social-linkedin { background: #000; }
.social-messenger { background: #0054c3; }
.social-whatsapp { background: #23bb44; }
.social-download { background: #ff6c37; }

/* Main image container */
.main-image-container {
    position: relative;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

.main-newspaper-img {
    width: 100%;
    background-color: #fff;
    border: 1px solid #c7c7c7;
    cursor: pointer;
    margin: 0;
}

/* === CLIP OVERLAY === */
#clipOverlay {
    position: absolute;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.05);
    user-select: none;
    pointer-events: auto;
}

#main_img_div.overlay-on .absoluteclass {
    pointer-events: none;
}

#cropRect {
    position: absolute;
    top: 60px;
    left: 50px;
    width: 280px;
    height: 180px;
    border: 2px dashed #ff6c37;
    background: rgba(255, 108, 55, 0.08);
    box-sizing: border-box;
    cursor: move;
}

#cropRect .handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #ff6c37;
}

.handle.tl { top: -6px; left: -6px; cursor: nwse-resize; }
.handle.tr { top: -6px; right: -6px; cursor: nesw-resize; }
.handle.bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.handle.br { bottom: -6px; right: -6px; cursor: nwse-resize; }
.handle.tm { top: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.handle.bm { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.handle.ml { left: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.handle.mr { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

#cropButtons {
    position: absolute;
    top: -43px;
    left: 0;
    display: flex;
    margin-top: 10px;
    color: #fff;
    cursor: pointer;
}

#cropButtons span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    font-size: 14px;
    padding: 3px 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    color: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
}

#shareBtn {
    background: #f76935;
    border-right: none;
}

#shareBtn:hover { background: #e05f2d; }

#cancelBtn {
    background: #dc3545;
}

#cancelBtn:hover { background: #b92c38; }

#cropButtons svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* === CLIP SHARE MODAL === */
#clip_modal {
    position: absolute;
    top: 180px;
    left: 50%;
    width: 300px;
    padding: 4px 8px;
    background: #fff;
    transform: translate(-50%, 0);
    display: none;
    z-index: 100000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.clip-modal-header {
    display: flex;
    justify-content: space-between;
    text-align: center;
    background: #000;
    padding: 3px 8px;
    color: #fff;
    cursor: move;
}

#crop_img {
    max-width: 100%;
    border: 1px solid #c7c7c7;
    margin-top: 4px;
    padding: 3px;
    max-height: 300px;
}

#clip_modal .form-control {
    display: block;
    width: 100%;
    padding: .1rem .2rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #1a1d20;
    background-color: #fff;
    border: 1px solid #dee2e6;
    margin-top: 4px;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

#clip_modal .form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #ff6c37;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgb(255 108 55 / 25%);
}

#socialsharer_div {
    width: 100%;
    display: flex;
    gap: 2px;
    margin: 4px 0;
}

#open_url_div {
    display: flex;
    justify-content: center;
}

/* === FOOTER === */
.epaper-footer {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 7px 4px;
    font-size: 12px;
    margin-top: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #phone_toggle {
        display: inline-block;
    }

    .header-nav-links {
        display: none !important;
    }

    .logo-image {
        max-height: 45px !important;
    }

    .demo-logo {
        font-size: 20px;
    }

    .main-logo-div {
        justify-content: center;
    }

    .left-sidebar {
        display: none;
    }

    .page-dropdown-wrap {
        width: 100px;
    }

    .page-pagination-wrap {
        display: none;
    }

    .archive-date-btn {
        padding: 2px 3px;
    }

    .toolbar-action-btn {
        padding: 3px 14px;
        font-size: 12px;
    }

    .page-header {
        padding-bottom: 1px;
        padding-left: 4px;
        color: #000;
    }

    .social-media-list {
        min-width: 20%;
        gap: 5px;
    }

    .heading-with-line {
        font-size: 11px;
        margin-top: 2px;
        padding-bottom: 4px;
    }

    .epaper-footer {
        font-size: 10px;
    }

    .toolbar-inner {
        padding-bottom: 1px;
    }

    .epaper-main-layout {
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .toolbar-actions {
        flex-wrap: wrap;
    }
    
    .social-media-list {
        flex-wrap: wrap;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
