:root {
    --primary-color: #2a2319;
    --secondary-color: #4a433a;
    --accent-color: #a65d3f;
    --accent-muted: #8b5a3c;
    --text-color: #1c1917;
    --bg-light: #f0ebe3;
    --bg-paper: #faf8f5;
    --border-color: #e2dcd3;
    --bs-primary: #8b5a3c;
    --bs-primary-rgb: 139, 90, 60;
}

body {
    font-family: 'Georgia', 'Palatino Linotype', 'Book Antiqua', serif;
    color: var(--text-color);
    background-color: var(--bg-paper);
    line-height: 1.65;
}

.navbar {
    background: linear-gradient(180deg, #2a2319 0%, #1f1a14 100%);
    box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 20px rgba(0,0,0,0.12);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #fff !important;
}

.search-form {
    max-width: 400px;
}

@media (max-width: 991.98px) {
    .search-form {
        max-width: none;
        width: 100%;
    }
}

.navbar .nav-link .bi {
    font-size: 1.05em;
    opacity: 0.92;
}

.navbar .nav-link.active {
    color: #f5e6d3 !important;
}

.navbar .dropdown-toggle::after {
    margin-left: 0.35em;
    vertical-align: 0.12em;
}

.navbar-categories-dropdown {
    --bs-dropdown-min-width: 15rem;
    max-height: min(72vh, 22rem);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.navbar-categories-dropdown .dropdown-item {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-size: 0.9rem;
}

.navbar-categories-dropdown .dropdown-item .bi {
    flex-shrink: 0;
    width: 1.35rem;
    text-align: center;
    opacity: 0.88;
    color: rgba(255, 255, 255, 0.75);
}

.navbar-categories-dropdown .dropdown-item:hover .bi,
.navbar-categories-dropdown .dropdown-item.active .bi {
    color: #f0d9c4;
    opacity: 1;
}

.navbar-categories-dropdown .dropdown-item.active,
.navbar-categories-dropdown .dropdown-item:active {
    background-color: rgba(166, 93, 63, 0.35);
    color: #fff;
}

@media (min-width: 992px) {
    .navbar-categories-dropdown {
        max-height: min(80vh, 26rem);
    }
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav .dropdown-menu.navbar-categories-dropdown {
        position: static;
        width: 100%;
        margin-top: 0.25rem;
        margin-bottom: 0.25rem;
        border-radius: 0.375rem;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }
}

.hero-section {
    position: relative;
    height: 500px;
    overflow: hidden;
    margin-bottom: 3rem;
}

.hero-carousel {
    height: 100%;
}

.carousel-item {
    height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(26, 22, 18, 0.82) 0%, rgba(74, 55, 40, 0.55) 100%);
}

.carousel-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
    width: 90%;
    max-width: 800px;
}

.carousel-caption h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.carousel-caption p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    animation: fadeInUp 1.2s ease-out;
}

.carousel-caption .btn {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    animation: fadeInUp 1.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.2);
    border-radius: 50%;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    background-color: rgba(255,255,255,0.3);
}

.carousel-indicators {
    margin-bottom: 2rem;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

.book-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    background: #fffef9;
    box-shadow: 0 2px 8px rgba(42, 35, 25, 0.06);
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(42, 35, 25, 0.1);
}

.book-cover-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.book-card:hover .book-cover-img {
    transform: scale(1.03);
}

.book-card-body {
    padding: 0.65rem 0.75rem 0.75rem;
}

.book-cover-detail {
    text-align: center;
}

.book-cover-detail img {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.book-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.35rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-intro {
    color: #5c534a;
    font-size: 0.7rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.book-intro-full {
    color: #5c534a;
    font-size: 0.95rem;
    line-height: 1.6;
}

.book-category {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    background-color: var(--bg-light);
    border-radius: 4px;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--secondary-color);
}

.pagination {
    margin-top: 3rem;
}

.page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.page-link:hover {
    background-color: var(--bg-light);
    border-color: var(--border-color);
    color: var(--accent-muted);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.footer {
    background: linear-gradient(180deg, #2a2319 0%, #1a1612 100%);
    color: rgba(255,255,255,0.78);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
}

.category-nav {
    background-color: var(--bg-light);
    padding: 0.65rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.category-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.category-link:hover {
    background-color: #e8e0d5;
    color: var(--accent-muted);
}

.category-link.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.category-header {
    background: linear-gradient(135deg, #3d3228 0%, #2a2319 55%, #1f1a14 100%);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 0;
}

.category-header .breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.category-header .breadcrumb-item a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.category-header .breadcrumb-item a:hover {
    color: #fff;
}

.category-header .breadcrumb-item.active {
    color: rgba(255,255,255,0.9);
}

.category-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.category-description {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0;
}

.search-header {
    background: linear-gradient(135deg, #3d3228 0%, #2a2319 55%, #1f1a14 100%);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 0;
}

.search-header .breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.search-header .breadcrumb-item a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.search-header .breadcrumb-item a:hover {
    color: #fff;
}

.search-header .breadcrumb-item.active {
    color: rgba(255,255,255,0.9);
}

.search-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.search-query {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0;
}

.search-query strong {
    color: white;
    font-weight: 600;
}

.search-results-info {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.book-detail-header {
    background: linear-gradient(135deg, #3d3228 0%, #2a2319 55%, #1f1a14 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.book-detail-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.book-meta {
    font-size: 1rem;
    opacity: 0.9;
}

.content-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.contact-page .content-section {
    padding-bottom: 0;
}

.policy-content {
    line-height: 1.8;
}

.policy-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.policy-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
}

.policy-content ul {
    padding-left: 1.5rem;
}

.policy-content li {
    margin-bottom: 0.5rem;
}

.reading-header {
    background: linear-gradient(135deg, #3d3228 0%, #2a2319 55%, #1f1a14 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.reading-header .breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.reading-header .breadcrumb-item a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.reading-header .breadcrumb-item a:hover {
    color: #fff;
}

.reading-header .breadcrumb-item.active {
    color: rgba(255,255,255,0.9);
}

.reading-book-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.reading-chapter-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: rgba(255,255,255,0.95);
}

.reading-meta {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
}

.reading-meta i {
    margin-right: 0.25rem;
}

.reading-container {
    padding: 2rem 0 4rem;
}

.chapter-content {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

.chapter-text {
    font-size: 1.125rem;
    line-height: 1.72;
    color: var(--text-color);
    white-space: pre-line;
    text-align: justify;
    word-wrap: break-word;
}

.chapter-text p {
    margin-bottom: 0.85rem;
    text-indent: 1.5em;
}

.chapter-navigation {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border-color);
}

.chapter-navigation .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s;
}

.chapter-navigation .btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.chapter-selector .dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
}

.chapter-selector .dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.chapter-selector .dropdown-item:hover {
    background-color: var(--bg-light);
}

.chapter-list-wrap {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.book-grid-section {
    padding-top: 0.5rem;
    padding-bottom: 2rem;
}

.book-grid-section .section-heading {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.btn-primary {
    background-color: var(--accent-muted);
    border-color: var(--accent-muted);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #744a32;
    border-color: #744a32;
}

.btn-outline-primary {
    color: var(--accent-muted);
    border-color: var(--accent-muted);
}

.btn-outline-primary:hover {
    background-color: var(--accent-muted);
    border-color: var(--accent-muted);
    color: #fff;
}

@media (min-width: 576px) {
    .book-title {
        font-size: 0.95rem;
    }
    .book-intro {
        font-size: 0.78rem;
        -webkit-line-clamp: 3;
    }
    .book-cover-img {
        height: 210px;
    }
}

@media (min-width: 768px) {
    .book-title {
        font-size: 1rem;
    }
    .book-intro {
        font-size: 0.85rem;
    }
    .book-cover-img {
        height: 220px;
    }
}

@media (min-width: 992px) {
    .book-title {
        font-size: 1.05rem;
    }
    .book-cover-img {
        height: 230px;
    }
}

@media (max-width: 768px) {
    .carousel-caption h1 {
        font-size: 2rem;
    }
    
    .carousel-caption p {
        font-size: 1rem;
    }
    
    .hero-section,
    .carousel-item {
        height: 350px;
    }
    
    .book-detail-title {
        font-size: 1.75rem;
    }
    
    .book-cover-detail img {
        max-height: 300px;
    }
    
    .search-form {
        max-width: 100%;
    }
    
    .category-header {
        padding: 1.5rem 0;
    }
    
    .category-title {
        font-size: 1.75rem;
    }
    
    .category-description {
        font-size: 1rem;
    }
    
    .search-header {
        padding: 1.5rem 0;
    }
    
    .search-title {
        font-size: 1.75rem;
    }
    
    .search-query {
        font-size: 1rem;
    }
    
    .reading-header {
        padding: 1.5rem 0;
    }
    
    .reading-book-title {
        font-size: 1.25rem;
    }
    
    .reading-chapter-title {
        font-size: 1.1rem;
    }
    
    .reading-meta {
        font-size: 0.85rem;
    }
    
    .chapter-content {
        padding: 0 0.5rem;
    }
    
    .chapter-text {
        font-size: 1rem;
        line-height: 1.62;
        text-align: left;
    }
    
    .chapter-navigation {
        padding: 1.5rem 0.5rem;
    }
    
    .chapter-navigation .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .book-card-body {
        padding: 0.5rem 0.55rem 0.6rem;
    }
    .book-cover-img {
        height: 118px;
    }
    .book-title {
        font-size: 0.78rem;
        margin-bottom: 0.25rem;
    }
    .book-intro {
        font-size: 0.65rem;
        -webkit-line-clamp: 2;
        margin-bottom: 0.3rem;
    }
    .book-category {
        font-size: 0.58rem;
        padding: 0.1rem 0.35rem;
    }
    .book-grid-section .section-heading {
        font-size: 1.15rem;
        margin-bottom: 0.75rem;
    }
    .hero-section {
        margin-bottom: 1.25rem;
    }
    .book-intro-full {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}
