:root {
    --accent: #b44cff;
    --dark-bg: #0b0f14;
    --dark-card: #141a22;
    --light-bg: #ffffff;
    --light-text: #000000;
    --dark-text: #ffffff;
}
.reader {
    padding: 60px 60px;
    max-width: 1100px;
    margin: 25px auto;
    margin-bottom: 0px;
    background-color: rgba(0,0,0,0.5);
    gap: 40px;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0px 0px 10px rgba(255, 0, 204, 0.4);
}

/* HEADER */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg,  #ff14b8cb, #4b4bd6);
}

.top-bar h1 {
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.top-bar span{
    color: #fff;
}

.controls {
    display: flex;
    gap: 10px;
    padding: 10px;
}

select, button {
    background: rgba(255,255,255,0.12);
    color: linear-gradient(135deg,  #ff14b8cb, #4b4bd6);
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
}

/* episode dropdown */
.episode-dropdown {
    position: relative;
    font-family: inherit;
}

.dropdown-btn {
    width: 100%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-btn .arrow {
    font-size: 14px;
    margin-left: 5px;
}

.dropdown-menu {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #1b1b22;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
    display: none;
    z-index: 100;
}

.dropdown-menu li {
    list-style: none;
    padding: 10px 14px;
    border-radius: 10px;
    color: #ddd;
    cursor: pointer;
    transition: background 0.25s, color 0.25s;
}

.dropdown-menu li:hover {
    background: linear-gradient(135deg, #6f4bd8, #8b5cf6);
    color: #fff;
}


/* PDF */
.pdf-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

canvas {
    max-width: 100%;
    border-radius: 14px;
    background: white;
    transition: filter 0.25s ease
}


/* NIGHT MODE PDF */
body.dark canvas {
    filter: invert(1) hue-rotate(180deg);
}

/* DAY MODE */
body.light canvas {
    filter: none;
}

/* FOOTER */
.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    margin-top: 20px;
}

.bottom-bar button {
    background: var(--accent);
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
}

.bottom-bar-mb{
    display: none;
}

.episode-bar {
    display: flex;
    justify-content: center ;
    align-items: center;
    color: #fff;
    margin-top: 20px;
    gap: 20px;
}

.episode-bar button {
    background: var(--accent);
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
}

.episode-bar-mb{
    display: none;
}


/* section wrapper */
.single-book {
    padding: 60px 60px;
    max-width: 1100px;
    margin: 25px auto;
    display: grid;
    background-color: rgba(0,0,0,0.5);
    grid-template-columns: 320px 1fr;
    gap: 40px;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0px 0px 10px rgba(255, 0, 204, 0.4);
}


/* book thumbnail */
.book-thumb img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* rating */
.rating {
    margin-top: 14px;
    text-align: center;
}

.rating .stars {
    font-size: 18px;
    color: #f4c150; /* gold */
    letter-spacing: 2px;
    display: block;
}

.rating .score {
    font-size: 13px;
    color: #fff;
    margin-top: 4px;
    display: block;
}   


/* details */
.book-details p {
    font-size: 14px;
    color:  #ff14b8cb;
    margin-bottom: 4px;
}

/* title */
.book-details .title h2 {
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    padding-bottom: 10px;
}

/* author */
.book-details .author h3 {
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    padding-bottom: 10px;
}

/* genre */
.book-details .genre h4 {
    font-size: 15px;
    font-weight: 500;
    color: #6a5acd;
    padding-bottom: 10px;
}

/* synopsis */
.synopsis .desc {
    font-size: 15px;
    line-height: 1.7;
    color: #fff;
    margin-top: 6px;
    padding-bottom: 10px;
}

/* tags */
.tags ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.tags ul li {
    font-size: 13px;
    padding: 6px 14px;
    background: #eef0ff;
    color: #4b4bd6;
    border-radius: 20px;
    text-transform: capitalize;
    cursor: default;
}


@media (max-width: 900px) {
    /* Center PDF wrapper and nav arrows */
    .pdf-wrapper {
        display: flex;
        justify-content: center; /* center horizontally */
        align-items: center;     /* vertical centering for arrows */
        position: relative;
        gap: 10px;               /* space between PDF and nav */
        margin: 15px 0;
        width: 100%;
    }

    canvas {
        display: block;
        max-width: 100%;
        height: auto;
        margin: 0 auto;          /* ensures PDF is centered */
        border-radius: 12px;
    }

    /* Bottom bar centered */
    .bottom-bar{
        display: none;
    }

    .bottom-bar-mb {
        margin-top: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #fff;
    }

    .bottom-bar-mb button {
        background: var(--accent);
        color: white;
        padding: 10px 18px;
        border-radius: 12px;
    }

    .episode-bar{
        display: none;
    }

    .episode-bar-mb {
        margin-top: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #fff;
    }

    .episode-bar-mb button {
        background: var(--accent);
        color: white;
        padding: 10px 18px;
        border-radius: 12px;
    }

    /* Optional: controls at top also centered */
    .top-bar {
        flex-direction: column;
        align-items: center;
    }

    .top-bar h1 {
        text-align: center;
    }

    .controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .single-book {
        margin-top: 10px;
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .book-thumb {
        max-width: 260px;
        margin: auto;
    }

    .book-details{
        justify-content: center;
    }

    .book-details .title h2 {
        font-size: 24px;
    }
}
