/* Book Library Public Styles */

/* Layout Container */
.uhbook-container {
    display: flex;
    gap: 30px;
    margin: 20px 0;
}

.uhbook-container.no-sidebar {
    display: block;
}

.uhbook-main {
    flex: 1;
    min-width: 0;
    order: 1;
}

.uhbook-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* Page Title */
.uhbook-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #ec5e69;
    margin: 0 0 20px;
}

/* Search Box - New 2-Row Layout */
.uhbook-search-box {
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    background: #F3F6FB;
}

.uhbook-search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Title */
.uhbook-search-title {
    margin-bottom: 0;
}

.uhbook-search-label {
    font-size: 15px;
    font-weight: 600;
    color: #ec5e69;
}

/* Search Text: Input + Button container */
.uhbook-search-text {
    display: flex;
    gap: 12px;
    align-items: center;
}

.uhbook-search-textbox {
    flex: 1;
}

.uhbook-search-textbox input[type="text"],
.uhbook-search-input {
    width: 100%;
    height: 48px !important;
    padding: 12px 20px !important;
    border: 1px solid #ec5e69 !important;
    border-radius: 100px !important;
    font-size: 14px !important;
    background: #fff !important;
    outline: none !important;
    transition: box-shadow 0.2s ease !important;
}

.uhbook-search-input:focus {
    box-shadow: 0 0 0 3px rgba(236, 94, 105, 0.15);
}

.uhbook-search-input::placeholder {
    color: #999;
}

/* Search Button */
.uhbook-search-btn {
    flex-shrink: 0;
}

.uhbook-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    background: #ec5e69;
    border: 1px solid #ec5e69;
    border-radius: 100px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.uhbook-search-submit:hover {
    background: #d94d58;
    color: #fff;
}

.uhbook-search-submit svg {
    width: 18px;
    height: 18px;
}

/* Filter Dropdowns */
.uhbook-filter-field {
    flex: 1;
    min-width: 150px;
}

.uhbook-filter-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.uhbook-filter-field select {
    width: 100%;
    height: 44px;
    padding: 8px 36px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff url('../assets/images/chevron-down.png') no-repeat right 12px center;
    background-size: 14px 14px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.uhbook-filter-field select:focus {
    border-color: #ec5e69;
}

/* Advanced Options Toggle */
.uhbook-advanced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ec5e69;
    font-weight: 600;
    width: fit-content;
    user-select: none;
}

.uhbook-toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.uhbook-advanced-toggle[aria-expanded="true"] .uhbook-toggle-icon {
    transform: rotate(180deg);
}

/* Advanced Options Container (Collapsible) */
.uhbook-advanced-options {
    display: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.uhbook-advanced-options.is-open {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    opacity: 1;
    max-height: 500px;
}

/* Mobile Responsive - Search Box */
@media (max-width: 768px) {

    /* Stack input and button on mobile */
    .uhbook-search-text {
        flex-direction: column;
        align-items: stretch;
    }

    .uhbook-search-btn {
        display: flex;
        justify-content: center;
    }

    /* When advanced options is open, flatten the search-text container */
    .uhbook-search-form:has(.uhbook-advanced-options.is-open) .uhbook-search-text {
        display: contents;
    }

    /* Set order for all direct children when advanced options is open */
    .uhbook-search-form:has(.uhbook-advanced-options.is-open) .uhbook-search-title {
        order: 1;
    }

    .uhbook-search-form:has(.uhbook-advanced-options.is-open) .uhbook-search-textbox {
        order: 2;
    }

    .uhbook-search-form:has(.uhbook-advanced-options.is-open) .uhbook-advanced-toggle {
        order: 3;
    }

    .uhbook-search-form:has(.uhbook-advanced-options.is-open) .uhbook-advanced-options {
        order: 4;
    }

    /* Move submit button to the end */
    .uhbook-search-form:has(.uhbook-advanced-options.is-open) .uhbook-search-btn {
        order: 5;
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .uhbook-card {
        padding: 0px !important;
    }
}

/* List Header */
.uhbook-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.uhbook-list__title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* Sort Dropdown */
.uhbook-sort {
    position: relative;
    flex-shrink: 0;
}

.uhbook-sort__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1.5px solid #3b82f6;
    border-radius: 100px;
    background: #fff;
    color: #3b82f6;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.uhbook-sort__toggle:hover {
    background: #eff6ff;
}

.uhbook-sort__toggle svg {
    flex-shrink: 0;
}

.uhbook-sort__chevron {
    transition: transform 0.2s ease;
}

.uhbook-sort.is-open .uhbook-sort__chevron {
    transform: rotate(180deg);
}

.uhbook-sort__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    padding: 6px 0;
    animation: uhbook-dropdown-in 0.15s ease;
}

.uhbook-sort.is-open .uhbook-sort__dropdown {
    display: block;
}

@keyframes uhbook-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.uhbook-sort__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s ease;
}

.uhbook-sort__option:hover {
    background: #f3f4f6;
    color: #333;
}

.uhbook-sort__option.is-active {
    color: #3b82f6;
    font-weight: 600;
}

/* Book Grid */
.uhbook-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Book Card */
.uhbook-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: solid 1px #ec5e69;
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.uhbook-card:hover {
    transform: translateY(-4px);
    background: #ec5e69;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.uhbook-card:hover .uhbook-card__title,
.uhbook-card__title:hover a {
    color: #fff173 !important;
}

.uhbook-card:hover .uhbook-card__author {
    color: #fff;
}

.uhbook-card__cover {
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    position: relative;
}

.uhbook-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uhbook-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.uhbook-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.uhbook-card__title a {
    color: inherit;
    text-decoration: none;
}

.uhbook-card__title a:hover {
    color: #ec5e69;
}

.uhbook-card__author {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
}

/* Card Stats Row (views + likes) */
.uhbook-card__stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
}

.uhbook-card__stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.uhbook-card__stat svg {
    flex-shrink: 0;
}

.uhbook-card:hover .uhbook-card__stat svg {
    color: #fff;
}

.uhbook-card__views svg {
    color: #888;
}

.uhbook-card__views svg:hover {
    color: #fff;
}

.uhbook-card__likes svg {
    color: #ec5e69;
}

.uhbook-card:hover .uhbook-card__stat {
    color: rgba(255, 255, 255, 0.85);
}

.uhbook-card:hover .uhbook-card__likes svg {
    color: #fff173;
}


/* Sidebar */
.uhbook-widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.uhbook-widget__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ec5e69;
    color: #333;
}

/* Category Tree */
.uhbook-cat-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.uhbook-cat-tree li {
    margin: 0;
    padding: 0;
}

.uhbook-cat-tree>li {
    margin-bottom: 8px;
}

.uhbook-cat-tree a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.uhbook-cat-tree a:hover {
    background: #efefef;
    color: #333;
}

.uhbook-cat-tree a.active {
    background: #ec5e69;
    color: #fff;
}

.uhbook-cat-tree .count {
    margin-left: auto;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.uhbook-cat-tree a:hover .count,
.uhbook-cat-tree a.active .count {
    background: rgba(255, 255, 255, 0.2);

}

.uhbook-cat-tree .children {
    list-style: none;
    margin: 0;
    padding: 0 0 0 20px;
}

.uhbook-cat-tree .children.hidden {
    display: none;
}

/* Category Toggle Button */
.uhbook-cat-tree li.has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.uhbook-cat-tree li.has-children>a {
    flex: 1;
}

.uhbook-cat-tree li.has-children>.children {
    flex-basis: 100%;
}

.uhbook-cat-toggle {
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    transition: transform 0.2s ease;
}

.uhbook-cat-toggle:hover {
    transform: scale(1.1);
}

.uhbook-cat-toggle .toggle-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Author Dropdown */
.uhbook-author-select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

/* Pagination */
.uhbook-pagination {
    margin-top: 30px;
    text-align: center;
}

.uhbook-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
}

.uhbook-pagination .page-numbers:hover,
.uhbook-pagination .page-numbers.current {
    background: #ec5e69;
    border-color: #ec5e69;
    color: #fff;
}

/* Single Book */
.uhbook-single {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.uhbook-single__header {
    display: flex;
    gap: 30px;
    margin-bottom: 24px;
}

.uhbook-single__cover {
    width: 280px;
    flex-shrink: 0;
}

.uhbook-single__cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.uhbook-single__info {
    flex: 1;
}

.uhbook-single__title {
    font-size: 28px;
    font-weight: 700;
    color: #ec5e69;
    margin: 0 0 12px;
    line-height: 1.3;
}

.uhbook-single__meta {
    margin-bottom: 20px;
}

.uhbook-single__meta-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

.uhbook-single__meta-label {
    width: 140px;
    font-weight: 600;
    color: #666;
}

.uhbook-single__meta-value {
    flex: 1;
    color: #333;
}

.uhbook-single__actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.uhbook-single__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.uhbook-single__actions .btn-primary {
    background: #ec5e69;
    color: #fff;
}

.uhbook-single__actions .btn-primary:hover {
    background: #d94d58;
}

.uhbook-single__actions .btn-secondary {
    background: #F3F6FB;
    color: #333;
}

.uhbook-single__actions .btn-secondary:hover {
    background: #e0e5eb;
}

.uhbook-single__summary {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.uhbook-single__summary h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #333;
}

.uhbook-single__summary-content {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}

/* Book Detail Page - New Layout */
.uhbook-detail {
    padding: 20px 0;
}

.uhbook-detail__grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
}

/* Left Column: Cover & Actions */
.uhbook-detail__left {
    position: sticky;
    top: 20px;
}

.uhbook-detail__cover {
    margin-bottom: 20px;
}

.uhbook-detail__cover img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.uhbook-detail__cover-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f0f0f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.uhbook-detail__cover-placeholder .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
}

.uhbook-detail__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uhbook-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uhbook-btn:hover {
    transform: scale(1.02);
}

.uhbook-btn--primary {
    background: #ec5e69;
    color: #fff;
}

.uhbook-btn--primary:hover {
    background: #d94d58;
    color: #fff;
}

.uhbook-btn--secondary {
    background: #F3F6FB;
    color: #333;
    border: 1px solid #e0e5eb;
}

.uhbook-btn--secondary:hover {
    background: #e0e5eb;
    color: #333;
}

/* Right Column: Details */
.uhbook-detail__right {
    min-width: 0;
}

.uhbook-detail__header {
    margin-bottom: 16px;
}

.uhbook-detail__title {
    font-size: 32px;
    font-weight: 800;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.2;
}

.uhbook-detail__author {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.uhbook-detail__author a {
    color: #ec5e69;
    text-decoration: none;
}

.uhbook-detail__author a:hover {
    text-decoration: underline;
}

/* View & Like Stats - Detail Page */
.uhbook-detail__stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 12px 0 8px;
}

.uhbook-detail__stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #666;
    background: none;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: default;
    transition: all 0.2s ease;
}

.uhbook-detail__stat svg {
    flex-shrink: 0;
}

.uhbook-detail__stat-count {
    font-weight: 700;
    color: #333;
}

.uhbook-detail__stat-label {
    font-weight: 400;
    color: #888;
    font-size: 14px;
}

.uhbook-detail__stat--views svg {
    color: #888;
}

.uhbook-detail__stat--likes {
    cursor: pointer;
    user-select: none;
}

.uhbook-detail__stat--likes:hover {
    background: #fef2f2;
}

.uhbook-detail__stat--likes svg {
    color: #ccc;
    transition: color 0.2s ease, transform 0.2s ease;
}

.uhbook-detail__stat--likes.is-liked svg {
    color: #ec5e69;
}

.uhbook-detail__stat--likes.is-liked .uhbook-detail__stat-count {
    color: #ec5e69;
}

.uhbook-detail__stat--likes.is-liked {
    background: #fef2f2;
}

/* Heart pop animation */
.uhbook-like-pop svg {
    animation: uhbook-heart-pop 0.4s ease;
}

@keyframes uhbook-heart-pop {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.35);
    }

    60% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.uhbook-detail__stat--likes.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Tags */
.uhbook-detail__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.uhbook-tag {
    display: inline-block;
    background: rgba(236, 94, 105, 0.15);
    color: #ec5e69;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.uhbook-tag:hover {
    background: rgba(236, 94, 105, 0.25);
    color: #ec5e69;
}

/* Sections */
.uhbook-detail__section {
    margin-bottom: 32px;
}

.uhbook-detail__section-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
}

.uhbook-detail__description {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

.uhbook-detail__description p {
    margin: 0 0 12px;
}

/* Info Table */
.uhbook-detail__info-table {
    border-top: 1px solid #eee;
}

.uhbook-detail__info-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

.uhbook-detail__info-label {
    color: #888;
    font-weight: 500;
}

.uhbook-detail__info-value {
    color: #333;
}

/* Content */
.uhbook-detail__content {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

.uhbook-detail__content p {
    margin: 0 0 16px;
}

/* Breadcrumbs */
.uhbook-breadcrumbs {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.uhbook-breadcrumbs a {
    color: #888;
    text-decoration: none;
}

.uhbook-breadcrumbs a:hover {
    color: #ec5e69;
}

.uhbook-breadcrumbs span {
    color: #333;
}

/* Sidebar Mobile Toggle Button - hidden on desktop */
.uhbook-sidebar__toggle {
    display: none;
}

/* Sidebar Mobile Header - hidden on desktop */
.uhbook-sidebar__mobile-header {
    display: none;
}

/* Sidebar Overlay - hidden on desktop */
.uhbook-sidebar__overlay {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .uhbook-container {
        flex-direction: column;
    }

    .uhbook-sidebar {
        /* Mobile: slide-in drawer from right */
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        z-index: 9999;
        background: #fff;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        transition: right 0.3s ease;
        padding: 0 20px 20px;
        order: unset;
    }

    .uhbook-sidebar.is-open {
        right: 0;
    }

    /* Mobile header inside sidebar */
    .uhbook-sidebar__mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 0;
        border-bottom: 1px solid #eee;
        margin-bottom: 16px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
    }

    .uhbook-sidebar__mobile-title {
        font-size: 16px;
        font-weight: 700;
        color: #333;
    }

    .uhbook-sidebar__close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        background: #f3f4f6;
        border-radius: 50%;
        cursor: pointer;
        color: #333;
        transition: background 0.2s ease;
        padding: 0;
    }

    .uhbook-sidebar__close:hover {
        background: #e5e7eb;
    }

    /* Toggle button - visible on mobile */
    .uhbook-sidebar__toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border: 1.5px solid #ec5e69;
        border-radius: 100px;
        background: #fff;
        color: #ec5e69;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

    .uhbook-sidebar__toggle:hover {
        background: #fef2f2;
    }

    .uhbook-sidebar__toggle svg {
        flex-shrink: 0;
    }

    /* Overlay */
    .uhbook-sidebar__overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 9998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .uhbook-sidebar__overlay.is-open {
        display: block;
        opacity: 1;
    }

    .uhbook-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .uhbook-detail__grid {
        grid-template-columns: 250px 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .uhbook-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .uhbook-search-form {
        flex-direction: column;
    }

    .uhbook-search-field {
        min-width: 100%;
    }

    .uhbook-single__header {
        flex-direction: column;
    }

    .uhbook-single__cover {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .uhbook-detail__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .uhbook-detail__left {
        position: static;
        max-width: 300px;
        margin: 0 auto;
    }

    .uhbook-detail__title {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .uhbook-detail__title {
        font-size: 22px;
    }

    .uhbook-detail__info-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* =========================================
   BOOK READER PAGE
   ========================================= */

/* Reader page body override */
body.uhbook-reader-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #fff;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.uhbook-reader {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.uhbook-reader__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #16213e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.uhbook-reader__title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.uhbook-reader__title h1 {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    color: #fff;
}

.uhbook-reader__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.uhbook-reader__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-wrap: nowrap;
    width: fit-content;
}

.uhbook-reader__btn svg {
    width: 18px;
    height: 18px;
}

.uhbook-reader__btn--back {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.uhbook-reader__btn--back:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.uhbook-reader__btn--download {
    background: #ec5e69;
    color: #fff;
}

.uhbook-reader__btn--download:hover {
    background: #d94d58;
    color: #fff;
}

.uhbook-reader__content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.uhbook-reader__iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

.uhbook-reader__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
}

.uhbook-reader__loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ec5e69;
    border-radius: 50%;
    animation: uhbook-spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes uhbook-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Reader Responsive */
@media (max-width: 768px) {
    .uhbook-reader__toolbar {
        padding: 10px 12px;
    }

    .uhbook-reader__title h1 {
        font-size: 14px;
    }

    .uhbook-reader__btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .uhbook-reader__btn span {
        display: none;
    }
}