/* =========================================================
   BATCHKOMIK READER
   reader.css
   ========================================================= */

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: #000;
    color: #fff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    overflow-x: hidden;

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}

/* Jangan biarkan link mempunyai warna bawaan browser */
a {
    color: inherit;
}


/* =========================================================
   READER HEADER
   ========================================================= */

.reader-header {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 68px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;

    background: #18191c;
    border-bottom: 1px solid #2c2d31;

    z-index: 9999;

    transition:
        transform 0.35s ease,
        opacity 0.35s ease,
        background-color 0.25s ease;
}


/* =========================================================
   HEADER HIDDEN
   ========================================================= */

.reader-header.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}


/* =========================================================
   HEADER LEFT
   ========================================================= */

.header-left {
    display: flex;
    align-items: center;

    gap: 14px;

    min-width: 0;
}


/* =========================================================
   HEADER RIGHT
   ========================================================= */

.header-right {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


/* =========================================================
   HEADER BUTTON
   ========================================================= */

.header-btn {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border: none;
    border-radius: 10px;

    background: #2a2b2f;
    color: #e6e6e6;

    font-size: 16px;

    cursor: pointer;

    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.header-btn:hover {
    background: #3a3b40;

    transform: translateY(-2px);
}

.header-btn:active {
    transform: translateY(0);
}


/* =========================================================
   COMIC INFO
   ========================================================= */

.comic-info {
    display: flex;
    align-items: center;

    gap: 10px;

    min-width: 0;
}


/* =========================================================
   COMIC COVER
   ========================================================= */

.comic-cover {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    object-fit: cover;

    border-radius: 6px;

    background: #222;
}


/* =========================================================
   COMIC TEXT
   ========================================================= */

.comic-text {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.comic-title {
    margin: 0;

    max-width: 250px;

    font-size: 14px;
    font-weight: 600;

    line-height: 1.3;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comic-chapter {
    display: block;

    margin-top: 3px;

    color: #9a9a9a;

    font-size: 12px;

    line-height: 1.3;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   COMMENT BUTTON
   ========================================================= */

.comment-btn {
    width: auto;

    padding: 0 12px;

    gap: 6px;
}

.comment-count {
    font-size: 13px;
    line-height: 1;
}


/* =========================================================
   NAVBAR
   ========================================================= */

/*
   Navbar dari header_baca.php.
   Dibuat berada di bawah reader header.
*/

.navbar {
    position: relative;

    z-index: 9000;
}


/* =========================================================
   MAIN READER AREA
   ========================================================= */

.reader-content {
    width: 100%;

    padding-top: 68px;
    padding-bottom: 70px;

    background: #000;
}


/* =========================================================
   PREVIEW READER
   ========================================================= */

.preview-reader {
    width: 100%;

    max-width: 720px;

    margin: 0 auto;

    padding: 15px;

    background: #000;
}


/* =========================================================
   READER TOP
   ========================================================= */

.reader-top {
    background: #111;

    color: #ddd;

    padding: 18px 20px;

    border-radius: 8px;

    margin-bottom: 18px;
}


/* =========================================================
   BREADCRUMB
   ========================================================= */

.reader-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    font-size: 13px;

    line-height: 1.5;

    margin-bottom: 8px;
}

.reader-breadcrumb a {
    color: #4da3ff;

    text-decoration: none;

    transition: color 0.2s ease;
}

.reader-breadcrumb a:hover {
    color: #7bbcff;
}

.reader-breadcrumb span {
    margin: 0 6px;

    color: #666;
}

.reader-breadcrumb .active {
    color: #aaa;
}


/* =========================================================
   READER CHAPTER TITLE
   ========================================================= */

.reader-chapter {
    margin: 6px 0;

    color: #fff;

    font-size: 26px;
    font-weight: 700;

    line-height: 1.3;
}


/* =========================================================
   READER META
   ========================================================= */

.reader-meta {
    margin: 0;

    color: #aaa;

    font-size: 14px;

    line-height: 1.5;
}


/* =========================================================
   PREVIEW HEADER
   ========================================================= */

.preview-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-top: 30px;
    margin-bottom: 25px;

    padding-top: 15px;

    text-align: center;
}

.preview-header a {
    min-width: 90px;
}


/* =========================================================
   PREVIEW PAGES
   ========================================================= */

.preview-pages {
    display: flex;

    flex-direction: column;

    width: 100%;

    gap: 0;

    margin: 0;
    padding: 0;

    line-height: 0;
}


/* =========================================================
   PREVIEW IMAGE
   ========================================================= */

.preview-page {
    display: block;

    width: 100%;
    height: auto;

    margin: 0;
    padding: 0;

    background: #000;

    border: none;
    border-radius: 0;

    cursor: pointer;

    user-select: none;

    -webkit-user-drag: none;

    line-height: 0;
}


/* =========================================================
   READER FOOTER
   ========================================================= */

.reader-footer {
    position: fixed;

    bottom: 0;
    left: 0;

    width: 100%;
    height: 68px;

    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    padding: 0 18px;

    background: #18191c;

    border-top: 1px solid #2c2d31;

    z-index: 9999;

    transition:
        transform 0.35s ease,
        opacity 0.35s ease,
        background-color 0.25s ease;
}


/* =========================================================
   FOOTER HIDDEN
   ========================================================= */

.reader-footer.hidden {
    transform: translateY(100%);

    opacity: 0;

    pointer-events: none;
}


/* =========================================================
   FOOTER POSITION
   ========================================================= */

.footer-left {
    justify-self: start;

    min-width: 0;
}

.footer-center {
    justify-self: center;

    min-width: 0;
}

.footer-right {
    justify-self: end;

    min-width: 0;
}


/* =========================================================
   PREVIOUS / NEXT BUTTON
   ========================================================= */

.nav-chapter-btn {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-width: 90px;

    padding: 11px 18px;

    border: none;
    border-radius: 10px;

    background: #5e61fa;
    color: #fff;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    line-height: 1;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.nav-chapter-btn:hover {
    background: #0026ff;

    color: #fff;

    transform: translateY(-2px);
}

.nav-chapter-btn:active {
    transform: translateY(0);
}


/* =========================================================
   CHAPTER SELECT WRAPPER
   ========================================================= */

.chapter-select-wrapper {
    position: relative;

    display: flex;
    justify-content: center;
}


/* =========================================================
   CHAPTER SELECT BUTTON
   ========================================================= */

.chapter-select-btn {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 11px 18px;

    border: none;
    border-radius: 10px;

    background: #2a2b2f;
    color: #fff;

    cursor: pointer;

    font-size: 14px;
    font-weight: 600;

    line-height: 1;

    white-space: nowrap;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.chapter-select-btn:hover {
    background: #36373c;
}

.chapter-select-btn span {
    display: block;
}


/* =========================================================
   CHAPTER DROPDOWN
   ========================================================= */

.chapter-dropdown {
    position: absolute;

    bottom: 55px;
    left: 50%;

    width: 220px;
    max-height: 300px;

    overflow-x: hidden;
    overflow-y: auto;

    transform:
        translateX(-50%)
        translateY(10px);

    background: #222326;

    border: 1px solid #36373c;
    border-radius: 10px;

    padding: 8px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.35);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}

.chapter-dropdown.show {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =========================================================
   CHAPTER OPTION
   ========================================================= */

.chapter-option {
    display: block;

    padding: 10px 12px;

    border-radius: 7px;

    color: #ddd;

    text-decoration: none;

    font-size: 14px;

    line-height: 1.3;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.chapter-option:hover {
    background: #333439;

    color: #fff;
}

.chapter-option.active {
    background: #ff8800;

    color: #fff;
}


/* =========================================================
   CUSTOM SCROLLBAR DROPDOWN
   ========================================================= */

.chapter-dropdown::-webkit-scrollbar {
    width: 6px;
}

.chapter-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.chapter-dropdown::-webkit-scrollbar-thumb {
    background: #555;

    border-radius: 10px;
}

.chapter-dropdown::-webkit-scrollbar-thumb:hover {
    background: #777;
}


/* =========================================================
   FLOATING NAVIGATION
   ========================================================= */

.floating-nav {
    position: fixed;

    right: 35px;
    bottom: 90px;

    display: flex;

    flex-direction: column;

    gap: 12px;

    z-index: 9998;

    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}


/* =========================================================
   FLOATING NAV HIDDEN
   ========================================================= */

.floating-nav.hidden {
    opacity: 0;

    pointer-events: none;

    transform: translateX(50px);
}


/* =========================================================
   SCROLL BUTTON
   ========================================================= */

.scroll-btn {
    width: 45px;
    height: 45px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: none;

    border-radius: 50%;

    background: #7158ff;
    color: #fff;

    cursor: pointer;

    font-size: 16px;

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.4);

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.scroll-btn:hover {
    background: #ff9900;

    transform: scale(1.08);
}

.scroll-btn:active {
    transform: scale(0.98);
}


/* =========================================================
   LIGHT MODE
   ========================================================= */

body.light-mode {
    background: #f2f2f2;

    color: #222;
}


/* =========================================================
   LIGHT MODE HEADER / FOOTER
   ========================================================= */

body.light-mode .reader-header,
body.light-mode .reader-footer {
    background: #fff;

    border-color: #ddd;
}


/* =========================================================
   LIGHT MODE BUTTON
   ========================================================= */

body.light-mode .header-btn,
body.light-mode .chapter-select-btn {
    background: #eee;

    color: #222;
}

body.light-mode .header-btn:hover,
body.light-mode .chapter-select-btn:hover {
    background: #ddd;
}


/* =========================================================
   LIGHT MODE READER
   ========================================================= */

body.light-mode .preview-reader,
body.light-mode .reader-content {
    background: #f2f2f2;
}


/* =========================================================
   LIGHT MODE TOP
   ========================================================= */

body.light-mode .reader-top {
    background: #fff;

    color: #333;

    border: 1px solid #ddd;
}

body.light-mode .reader-chapter {
    color: #222;
}

body.light-mode .reader-meta {
    color: #666;
}

body.light-mode .reader-breadcrumb span {
    color: #999;
}

body.light-mode .reader-breadcrumb .active {
    color: #555;
}


/* =========================================================
   LIGHT MODE DROPDOWN
   ========================================================= */

body.light-mode .chapter-dropdown {
    background: #fff;

    border-color: #ddd;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.15);
}

body.light-mode .chapter-option {
    color: #222;
}

body.light-mode .chapter-option:hover {
    background: #eee;

    color: #111;
}

body.light-mode .chapter-option.active {
    background: #ff8800;

    color: #fff;
}


/* =========================================================
   LIGHT MODE PREVIEW HEADER BUTTON
   ========================================================= */

body.light-mode .preview-header .btn-outline-primary {
    color: #0d6efd;
}

body.light-mode .preview-header .btn-outline-secondary {
    color: #555;
}


/* =========================================================
   MOBILE
   max-width: 768px
   ========================================================= */

@media (max-width: 768px) {

    /* -----------------------------------------------------
       HEADER
       ----------------------------------------------------- */

    .reader-header {
        height: 72px;

        padding: 0 12px;
    }


    .header-left {
        gap: 10px;

        min-width: 0;
    }


    .header-right {
        gap: 6px;
    }


    .header-btn {
        width: 46px;
        height: 46px;

        border-radius: 12px;

        font-size: 18px;
    }


    /* -----------------------------------------------------
       COVER
       ----------------------------------------------------- */

    .comic-cover {
        width: 48px;
        height: 48px;
    }


    /* -----------------------------------------------------
       COMIC INFO
       ----------------------------------------------------- */

    .comic-info {
        gap: 10px;

        min-width: 0;
    }


    .comic-text {
        min-width: 0;
    }


    .comic-title {
        max-width: 150px;

        font-size: 17px;
    }


    .comic-chapter {
        max-width: 150px;

        font-size: 14px;
    }


    /* -----------------------------------------------------
       COMMENT
       ----------------------------------------------------- */

    .comment-count {
        display: none;
    }


    .comment-btn {
        width: 46px;

        padding: 0;
    }


    /* -----------------------------------------------------
       READER
       ----------------------------------------------------- */

    .reader-content {
        padding-top: 72px;

        padding-bottom: 72px;
    }


    .preview-reader {
        max-width: 100%;

        padding: 0;
    }


    .preview-pages {
        width: 100%;
    }


    .preview-page {
        width: 100%;

        margin: 0;
        padding: 0;

        border-radius: 0;
    }


    /* -----------------------------------------------------
       READER TOP
       ----------------------------------------------------- */

    .reader-top {
        padding: 14px;

        margin-bottom: 0;

        border-radius: 0;
    }


    .reader-chapter {
        font-size: 22px;
    }


    .reader-meta {
        font-size: 13px;
    }


    /* -----------------------------------------------------
       PREVIEW HEADER
       ----------------------------------------------------- */

    .preview-header {
        margin-top: 20px;

        margin-bottom: 20px;

        padding: 10px;

        gap: 8px;
    }


    .preview-header a {
        min-width: 0;

        flex: 1;
    }


    /* -----------------------------------------------------
       FOOTER
       ----------------------------------------------------- */

    .reader-footer {
        height: 72px;

        padding: 8px 10px;

        grid-template-columns: 1fr auto 1fr;

        gap: 8px;
    }


    .footer-left,
    .footer-right {
        min-width: 0;
    }


    /* -----------------------------------------------------
       PREV / NEXT
       ----------------------------------------------------- */

    .nav-chapter-btn {
        min-width: 0;

        height: 52px;

        padding: 0 14px;

        border-radius: 10px;

        font-size: 15px;
    }


    /* -----------------------------------------------------
       CHAPTER SELECT
       ----------------------------------------------------- */

    .chapter-select-btn {
        height: 52px;

        padding: 0 14px;

        border-radius: 10px;

        gap: 8px;

        font-size: 15px;

        white-space: nowrap;
    }


    .chapter-select-btn span {
        max-width: 110px;

        overflow: hidden;

        white-space: nowrap;

        text-overflow: ellipsis;
    }


    /* -----------------------------------------------------
       DROPDOWN
       ----------------------------------------------------- */

    .chapter-dropdown {
        width: 210px;

        max-height: 280px;

        bottom: 58px;
    }


    /* -----------------------------------------------------
       FLOATING NAV
       ----------------------------------------------------- */

    .floating-nav {
        right: 16px;

        bottom: 90px;

        gap: 12px;
    }


    .scroll-btn {
        width: 52px;
        height: 52px;

        font-size: 18px;
    }

}


/* =========================================================
   MOBILE SMALL
   max-width: 480px
   ========================================================= */

@media (max-width: 480px) {

    /* -----------------------------------------------------
       HEADER
       ----------------------------------------------------- */

    .reader-header {
        height: 64px;

        padding: 0 8px;
    }


    .header-left {
        gap: 7px;
    }


    .header-right {
        gap: 4px;
    }


    .header-btn {
        width: 40px;
        height: 40px;

        border-radius: 10px;

        font-size: 16px;
    }


    /* -----------------------------------------------------
       COVER
       ----------------------------------------------------- */

    .comic-cover {
        width: 40px;
        height: 40px;
    }


    /* -----------------------------------------------------
       TITLE
       ----------------------------------------------------- */

    .comic-title {
        max-width: 115px;

        font-size: 13px;
    }


    .comic-chapter {
        max-width: 115px;

        font-size: 11px;
    }


    /* -----------------------------------------------------
       READER
       ----------------------------------------------------- */

    .reader-content {
        padding-top: 64px;

        padding-bottom: 64px;
    }


    /* -----------------------------------------------------
       READER TOP
       ----------------------------------------------------- */

    .reader-top {
        padding: 12px;
    }


    .reader-breadcrumb {
        font-size: 12px;
    }


    .reader-chapter {
        font-size: 20px;
    }


    .reader-meta {
        font-size: 12px;
    }


    /* -----------------------------------------------------
       PREVIEW HEADER
       ----------------------------------------------------- */

    .preview-header {
        padding: 8px;

        gap: 5px;
    }


    .preview-header .btn {
        font-size: 12px;

        padding: 6px 8px;
    }


    /* -----------------------------------------------------
       FOOTER
       ----------------------------------------------------- */

    .reader-footer {
        height: 64px;

        padding: 6px 8px;

        grid-template-columns: auto 1fr auto;

        gap: 6px;
    }


    /* -----------------------------------------------------
       PREV / NEXT
       ----------------------------------------------------- */

    .nav-chapter-btn {
        height: 48px;

        min-width: 70px;

        padding: 0 10px;

        border-radius: 9px;

        font-size: 13px;

        gap: 5px;
    }


    /* -----------------------------------------------------
       CHAPTER SELECT
       ----------------------------------------------------- */

    .chapter-select-wrapper {
        width: 100%;
    }


    .chapter-select-btn {
        width: 100%;

        height: 48px;

        padding: 0 10px;

        justify-content: center;

        font-size: 14px;
    }


    .chapter-select-btn span {
        max-width: 120px;
    }


    /* -----------------------------------------------------
       DROPDOWN
       ----------------------------------------------------- */

    .chapter-dropdown {
        width: 190px;

        max-height: 250px;

        bottom: 54px;
    }


    .chapter-option {
        padding: 9px 10px;

        font-size: 13px;
    }


    /* -----------------------------------------------------
       FLOATING BUTTON
       ----------------------------------------------------- */

    .floating-nav {
        right: 12px;

        bottom: 76px;

        gap: 8px;
    }


    .scroll-btn {
        width: 44px;
        height: 44px;

        font-size: 16px;
    }

}


/* =========================================================
   VERY SMALL SCREEN
   max-width: 360px
   ========================================================= */

@media (max-width: 360px) {

    .comic-title {
        max-width: 90px;

        font-size: 12px;
    }


    .comic-chapter {
        max-width: 90px;

        font-size: 10px;
    }


    .header-btn {
        width: 36px;
        height: 36px;

        font-size: 15px;
    }


    .comic-cover {
        width: 36px;
        height: 36px;
    }


    .reader-footer {
        padding-left: 5px;
        padding-right: 5px;

        gap: 4px;
    }


    .nav-chapter-btn {
        min-width: 58px;

        padding: 0 7px;

        font-size: 12px;
    }


    .chapter-select-btn {
        padding: 0 7px;

        font-size: 12px;
    }


    .chapter-select-btn span {
        max-width: 90px;
    }

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

button:focus-visible,
a:focus-visible {
    outline: 2px solid #ff8800;

    outline-offset: 2px;
}


/* =========================================================
   REDUCE MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;
    }

}
html {
    min-height: 100%;
    height: auto;
    overflow-y: auto;
}

body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

.reader-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
}