/*
 * Single-story page styles (Task 3.3 step 4). Two source blocks, both
 * copied verbatim (no hand-retyping, no /img/ references in either so no
 * URL rewrite was needed):
 *
 *   1. The @push('styles') block in
 *      truyenfull/resources/views/story.blade.php (info panel, description
 *      collapse/"Xem thêm", two-column chapter list).
 *   2. The inline <style> block in
 *      resources/views/vendor/pagination/bootstrap-5.blade.php (the site's
 *      own customized Laravel pagination partial — its markup is what
 *      inc/pagination.php renders, so its styles belong here too).
 *
 * Enqueued only on is_singular('story'), same pattern as home.css on the
 * front page (see functions.php).
 */

/* --- 3D Book Cover from TruyenFull --- */

.books {
    text-align: center;
    margin: 15px auto 25px;
    perspective: 300px;
    -webkit-perspective: 300px;
    -moz-perspective: 300px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    display: flex;
    justify-content: center;
}

.books .book {
    position: relative;
    display: inline-block;
    transform: perspective(300px) rotateY(-3deg);
    -webkit-transform: perspective(300px) rotateY(-3deg);
    -moz-transform: rotateY(-3deg);
    outline: 1px solid transparent;
    box-shadow: 5px 5px 20px #333;
    margin: 0;
    border-radius: 2px 0 0 2px;
}

.books .book img {
    position: relative;
    vertical-align: middle;
    border: 1px solid #000;
    border-left: 5px solid #000;
    height: 324px;
    width: 221px;
    max-width: 100%;
    object-fit: cover;
    display: block;
    border-radius: 2px 0 0 2px;
}

.books .book:before,
.books .book:after {
    position: absolute;
    top: 2%;
    height: 96%;
    content: ' ';
    z-index: -1;
}

.books .book:before {
    width: 100%;
    left: 7.5%;
    background-color: #000;
}

.books .book:after {
    width: 5%;
    left: 100%;
    background-color: #EFEFEF;
    box-shadow: inset 0px 0px 5px #aaa;
    transform: perspective(300px) rotateY(20deg);
    -webkit-transform: perspective(300px) rotateY(20deg);
    -moz-transform: rotateY(20deg);
}

@media (max-width: 767px) {
    .books .book img {
        height: auto;
        aspect-ratio: 129 / 192;
        width: 180px;
    }
}

.title-list {
    text-align: left;
    height: 40px;
    text-transform: uppercase;
    border-bottom: 1px solid #CCC;
}

.title-list>h2 {
    font-family: 'Roboto Condensed', Tahoma, sans-serif;
    font-size: 20px;
    height: 40px;
    line-height: 40px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #4E4E4E;
    display: inline-block;
}

.title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    padding: 0 10px 8px;
    text-transform: uppercase;
    font-family: "Roboto Condensed", Tahoma, sans-serif;
    text-align: center;
    color: #333;
    line-height: 1.3;
}

.rate {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.rate-holder {
    font-size: 16px;
    letter-spacing: 2px;
}

.rate-holder .bi-star-fill {
    color: #f1c40f;
}

.rate-info {
    font-size: 13px;
    color: #777;
    margin-top: 4px;
    display: block;
}

#truyen {
    font-size: 14px;
    line-height: 1.6;
}

#truyen > div {
    margin-bottom: 8px;
}

#truyen .info-title,
#truyen h3 {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    margin-right: 4px;
    display: inline;
}

#truyen a {
    text-decoration: none;
    color: #4e4e4e;
}

#truyen a:hover,
#truyen a:focus {
    text-decoration: underline;
    color: #2c5e8a;
}

.showmore a {
    background-color: #f4f4f4;
    margin-top: 5px;
}

.showmore .btn-xs,
.showmore .btn-group-xs>.btn {
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
    color: #333;
    border-color: #ccc;
}

.story-desc {
    font-size: 14.5px;
    line-height: 1.75;
    color: #444;
    text-align: justify;
    overflow: hidden;
    position: relative;
    transition: max-height 300ms ease;
}

.story-desc p {
    margin-bottom: 14px;
}

/* Collapsed state */
.story-desc.is-collapsed {
    max-height: var(--desc-collapsed-height);
}

/* Mobile default (under lg) */
.story-desc {
    --desc-collapsed-height: 12rem;
}

/* Chapter List Toolbar & Quick Actions */
.btn-quick-read {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-quick-read:hover {
    transform: translateY(-1px);
}

.chapter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 15px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 6px;
}

.chapter-toolbar .search-box {
    flex: 1 1 200px;
    max-width: 320px;
    position: relative;
}

.chapter-toolbar .search-box input {
    padding-left: 32px;
    border-radius: 16px;
    font-size: 13px;
    height: 32px;
    border: 1px solid #ced4da;
}

.chapter-toolbar .search-box .search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 13px;
    pointer-events: none;
}

.chapter-toolbar .toolbar-actions #btnSortChapters {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 16px;
}

/* Chapter Modern Grid */
.list-chapter.two-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 18px;
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 10px 0 20px;
}

@media (max-width: 767px) {
    .list-chapter.two-cols {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

.list-chapter .chapter-item {
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: background-color 0.15s ease, transform 0.15s ease;
    border-bottom: 1px dashed #e8e8e8;
    padding: 5px 8px;
}

.list-chapter .chapter-item:hover {
    background-color: #eef3f8;
    border-bottom-color: transparent;
    transform: translateX(3px);
}

.list-chapter .chapter-item a {
    display: flex;
    align-items: center;
    width: 100%;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.45;
}

.list-chapter .chapter-item a:hover {
    color: #1b5a96;
    text-decoration: none;
}

.list-chapter .chapter-icon {
    font-size: 13px;
    color: #9ab0c5;
    margin-right: 8px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.list-chapter .chapter-item:hover .chapter-icon {
    color: #1b5a96;
}

.list-chapter .chapter-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.list-chapter .chapter-read-badge {
    font-size: 12px;
    color: #27ae60;
    margin-left: 6px;
    flex-shrink: 0;
}

.list-chapter .chapter-item.is-read a {
    color: #888;
}

.list-chapter .chapter-item.is-read .chapter-icon {
    color: #bbb;
}

.list-chapter .chapter-item.is-read .chapter-read-badge {
    display: inline-block !important;
}

/* Desktop (lg and up = 992px+) */
@media (min-width: 992px) {
    .order-lg-1 {
        border-right: 1px solid #eee;
        padding-right: 25px;
    }

    .story-desc {
        --desc-collapsed-height: 24rem;
    }
}

/* --- from resources/views/vendor/pagination/bootstrap-5.blade.php --- */

.pagination>li>a,
.pagination>li>span {
    color: #4E4E4E;
    background-color: #F4F4F4;
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid #ddd;
    border-top: 1px solid #ddd;
    border-radius: 0 !important;
    margin-left: 0;
}

.pagination>li.active>span {
    background-color: #34495e;
    border-color: #34495e;
    color: white;
}

.pagination>li>a:hover {
    background-color: #e0e0e0;
}

.page-jump-form {
    display: none;
    align-items: center;
    margin-left: 15px;
    position: relative;
}

.page-jump-form.active {
    display: inline-flex;
}

.page-jump-form input {
    width: 100px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 0;
    margin-right: 5px;
}

.page-jump-form button[type="submit"] {
    padding: 6px 15px;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.page-jump-form button[type="submit"]:hover {
    background-color: #2c3e50;
}

.page-select-btn {
    color: #4E4E4E;
    background-color: #F4F4F4;
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid #ddd;
    border-top: 1px solid #ddd;
    border-radius: 0 !important;
    margin-left: 0;
}

.page-select-btn:hover {
    background-color: #e0e0e0;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination>li>a,
    .pagination>li>span {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 30px;
        text-align: center;
    }

    .page-select-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .page-jump-form input {
        width: 80px;
        padding: 4px 8px;
        font-size: 12px;
    }

    .page-jump-form button[type="submit"] {
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* Dark Theme Styles */
.dark-theme .pagination>li>a,
.dark-theme .pagination>li>span {
    color: #b1b1b1;
    background-color: #2d3741;
    border-bottom: 1px solid #1a1a1a;
    border-top: 1px solid #1a1a1a;
}

.dark-theme .pagination>li.active>span {
    background-color: #92bb35;
    border-color: #92bb35;
    color: #1a1a1a;
    font-weight: bold;
}

.dark-theme .pagination>li>a:hover {
    background-color: #3a4754;
    color: #fff;
}

.dark-theme .page-jump-form input {
    background-color: #1c242d;
    border: 1px solid #192128;
    color: #fff;
    box-shadow: inset 0 0 2px rgba(0, 0, 0, .3);
}

.dark-theme .page-jump-form input::placeholder {
    color: #8a8a8a;
    opacity: 1;
}

.dark-theme .page-jump-form button[type="submit"] {
    background-color: #92bb35;
    color: #1a1a1a;
    font-weight: bold;
}

.dark-theme .page-jump-form button[type="submit"]:hover {
    background-color: #a9cf54;
}

.dark-theme .page-select-btn {
    color: #b1b1b1;
    background-color: #2d3741;
    border-bottom: 1px solid #1a1a1a;
    border-top: 1px solid #1a1a1a;
}

.dark-theme .page-select-btn:hover {
    background-color: #3a4754;
    color: #fff;
}

.dark-theme .small.text-muted {
    color: rgba(255, 255, 255, .5) !important;
}

.dark-theme .title {
    color: #fff;
    border-bottom-color: #333;
}

.dark-theme .rate {
    border-bottom-color: #333;
}

.dark-theme #truyen .info-title,
.dark-theme #truyen h3 {
    color: #eee;
}

.dark-theme #truyen a {
    color: #b1b1b1;
}

.dark-theme #truyen a:hover {
    color: #92bb35;
}

.dark-theme .story-desc {
    color: #b1b1b1;
}

.dark-theme .order-lg-1 {
    border-right-color: #242f39;
}

.dark-theme .chapter-toolbar {
    background-color: #1e262f;
    border-color: #2b3642;
}

.dark-theme .chapter-toolbar .search-box input {
    background-color: #161d24;
    border-color: #2b3642;
    color: #eee;
}

.dark-theme .chapter-toolbar .search-box input::placeholder {
    color: #777;
}

.dark-theme .chapter-toolbar .search-box .search-icon {
    color: #777;
}

.dark-theme .chapter-toolbar .toolbar-actions #btnSortChapters {
    background-color: #161d24;
    border-color: #2b3642;
    color: #b1b1b1;
}

.dark-theme .chapter-toolbar .toolbar-actions #btnSortChapters:hover {
    background-color: #2b3642;
    color: #fff;
}

.dark-theme .list-chapter .chapter-item {
    border-bottom-color: #242f39;
}

.dark-theme .list-chapter .chapter-item:hover {
    background-color: #242f39;
}

.dark-theme .list-chapter .chapter-item a {
    color: #b1b1b1;
}

.dark-theme .list-chapter .chapter-item a:hover {
    color: #92bb35;
}

.dark-theme .list-chapter .chapter-icon {
    color: #556b7d;
}

.dark-theme .list-chapter .chapter-item:hover .chapter-icon {
    color: #92bb35;
}

.dark-theme .list-chapter .chapter-read-badge {
    color: #92bb35;
}

.dark-theme .list-chapter .chapter-item.is-read a {
    color: #666;
}

.dark-theme #noChapterFound {
    background-color: #1e262f;
    border-color: #2b3642;
    color: #aaa;
}

/* Sidebar Styles for Single Story Page */
.col-truyen-side {
    padding-left: 20px;
}

.col-truyen-side .title-list {
    margin-bottom: 12px;
    height: 40px;
    border-bottom: 1px solid #CCC;
}

.col-truyen-side .title-list h4 {
    font-family: 'Roboto Condensed', Tahoma, sans-serif;
    font-size: 18px;
    font-weight: 700;
    height: 40px;
    line-height: 40px;
    margin: 0;
    text-transform: uppercase;
    border-bottom: 1px solid #4E4E4E;
    display: inline-block;
    color: #4e4e4e;
}

/* Truyện cùng tác giả */
.author-story-list {
    background-color: #fcfcfc;
    border: 1px solid #e8e8e8;
    padding: 6px 14px;
    border-radius: 3px;
}

.author-story-item {
    display: flex;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.author-story-item:last-child {
    border-bottom: none;
}

.author-story-item h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.author-story-item h3 a {
    color: #4e4e4e;
    text-decoration: none;
}

.author-story-item h3 a:hover {
    color: #2c5e8a;
    text-decoration: underline;
}

/* Top Hot Stories */
.col-truyen-side .top-nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 12px 0;
    padding: 0;
    gap: 4px;
    width: 100%;
}

.col-truyen-side .top-tab {
    flex: 1 1 0;
    height: 30px;
    line-height: 28px;
    text-align: center;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #AAA;
    border-radius: 15px;
    cursor: pointer;
    margin: 0;
    padding: 0 2px;
    color: #555;
    background-color: #fff;
    white-space: nowrap;
    transition: all 0.2s ease;
    user-select: none;
    box-sizing: border-box;
}

.col-truyen-side .top-tab.active {
    color: #fff;
    background-color: #4E4E4E;
    border-color: #4E4E4E;
}

.top-list-content {
    background-color: transparent;
}

.top-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
    transition: opacity 0.15s ease;
}

.top-item:last-child {
    border-bottom: none;
}

.top-num {
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.top-num.top-1 {
    color: #fff;
    background-color: #e74c3c;
    border: 1px solid #e74c3c;
}

.top-num.top-2 {
    color: #fff;
    background-color: #27ae60;
    border: 1px solid #27ae60;
}

.top-num.top-3 {
    color: #fff;
    background-color: #2980b9;
    border: 1px solid #2980b9;
}

.top-num.top-more {
    color: #666;
    background-color: #fff;
    border: 1px solid #ccc;
}

.top-info {
    flex-grow: 1;
    min-width: 0;
}

.top-info .s-title h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.top-info .s-title a {
    color: #2c3e50;
    text-decoration: none;
}

.top-info .s-title a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.top-info .s-genre {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-info .s-genre a {
    color: #777;
    text-decoration: none;
}

.top-info .s-genre a:hover {
    color: #333;
    text-decoration: underline;
}

/* Dark Theme for Sidebar */
.dark-theme .col-truyen-side .title-list {
    border-bottom-color: #333;
}

.dark-theme .col-truyen-side .title-list h4 {
    color: #fff;
    border-bottom-color: #fff;
}

.dark-theme .author-story-list {
    background-color: #242f39;
    border-color: #333;
}

.dark-theme .author-story-item {
    border-bottom-color: #2d3741;
}

.dark-theme .author-story-item h3 a {
    color: #b1b1b1;
}

.dark-theme .author-story-item h3 a:hover {
    color: #92bb35;
}

.dark-theme .col-truyen-side .top-tab {
    background-color: #242f39;
    border-color: #444;
    color: #aaa;
}

.dark-theme .col-truyen-side .top-tab.active {
    background-color: #92bb35;
    border-color: #92bb35;
    color: #1a1a1a;
}

.dark-theme .top-item {
    border-bottom-color: #242f39;
}

.dark-theme .top-num.top-more {
    background-color: #242f39;
    border-color: #444;
    color: #aaa;
}

.dark-theme .top-info .s-title a {
    color: #b1b1b1;
}

.dark-theme .top-info .s-title a:hover {
    color: #92bb35;
}

.dark-theme .top-info .s-genre a {
    color: #777;
}

@media (max-width: 991px) {
    .col-truyen-side {
        padding-left: 15px;
        margin-top: 30px;
    }
}
