/* ========================================
   MODERN DESIGN SYSTEM - VIETNAMESE BOOK PLATFORM
   ======================================== */

/* CSS Variables for Theme and Design Tokens */
:root {
    /* Reading Font Sizes */
    --font-size-small: 14px;
    --font-size-medium: 16px;
    --font-size-large: 18px;
    --font-size-xl: 20px;

    /* Font Families */
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Roboto', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Courier New', monospace;

    /* Reading Themes */
    --theme-day-bg: #ffffff;
    --theme-day-text: #333333;
    --theme-night-bg: #1a1a1a;
    --theme-night-text: #e0e0e0;
    --theme-sepia-bg: #f4ecd8;
    --theme-sepia-text: #5c4b37;

    /* ========================================
       BOOK LOVER'S COLOR PALETTE
       Brown (Literary/Vintage), Green (Nature/Growth), Blue (Knowledge/Trust)
       ======================================== */

    /* Primary - Warm Brown Tones (Literary, Classic Books) */
    --primary-color: #8B4513;        /* Saddle Brown - Main brand color */
    --primary-dark: #654321;         /* Dark Brown - Leather-bound books */
    --primary-light: #A0826D;        /* Light Brown - Warm accent */
    --primary-lighter: #D2B48C;      /* Tan - Subtle backgrounds */

    /* Secondary - Forest Green (Nature, Growth, Reading) */
    --secondary-color: #2F5233;      /* Forest Green - Earthy, calming */
    --secondary-dark: #1E3A20;       /* Dark Forest - Deep, rich */
    --secondary-light: #4A7C59;      /* Sage Green - Fresh, modern */
    --secondary-lighter: #87A96B;    /* Light Sage - Soft backgrounds */

    /* Accent - Deep Blue (Knowledge, Trust, Wisdom) */
    --accent-color: #1E3A5F;         /* Navy Blue - Sophisticated */
    --accent-dark: #0F2344;          /* Midnight Blue - Deep accent */
    --accent-light: #3D5A80;         /* Steel Blue - Modern touch */
    --accent-lighter: #5A7FA8;       /* Sky Blue - Soft highlights */

    /* Functional Colors */
    --success-color: #4A7C59;        /* Green - Success states */
    --warning-color: #C8963E;        /* Golden - Warnings */
    --danger-color: #A0443F;         /* Muted Red - Errors */
    --info-color: #5A7FA8;           /* Blue - Information */

    /* Gradient Backgrounds */
    --gradient-warm: linear-gradient(135deg, #f4e4d7 0%, #ecdcc9 50%, #e4d4c1 100%);
    --gradient-nature: linear-gradient(135deg, #87A96B 0%, #4A7C59 50%, #2F5233 100%);
    --gradient-knowledge: linear-gradient(135deg, #5A7FA8 0%, #3D5A80 50%, #1E3A5F 100%);
    --gradient-sunset: linear-gradient(135deg, #D2B48C 0%, #C8963E 25%, #8B4513 75%, #654321 100%);
    --gradient-forest: linear-gradient(135deg, #87A96B 0%, #2F5233 50%, #1E3A5F 100%);
    --gradient-library: linear-gradient(135deg, #A0826D 0%, #8B4513 33%, #2F5233 66%, #1E3A5F 100%);
    --gradient-vintage: linear-gradient(to bottom, #f9f6f0 0%, #f4e4d7 50%, #ecdcc9 100%);
    --gradient-modern: linear-gradient(135deg, rgba(139,69,19,0.05) 0%, rgba(47,82,51,0.05) 50%, rgba(30,58,95,0.05) 100%);

    /* Neutral Colors - Warm Palette */
    --gray-50: #faf8f5;              /* Warm white */
    --gray-100: #f4f1ec;             /* Cream */
    --gray-200: #ebe6df;             /* Light parchment */
    --gray-300: #d9d2c7;             /* Parchment */
    --gray-400: #bfb5a7;             /* Warm gray */
    --gray-500: #9a8d7e;             /* Medium warm gray */
    --gray-600: #786c5e;             /* Dark warm gray */
    --gray-700: #5c5146;             /* Charcoal brown */
    --gray-800: #3d362f;             /* Deep brown */
    --gray-900: #2a2421;             /* Almost black brown */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

/* Vietnamese Font Stack with Better Typography */
body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary) !important;
    background-color: var(--bg-primary) !important;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* Subtle pattern overlay for depth - adapts to theme */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(139, 69, 19, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(47, 82, 51, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(30, 58, 95, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* Reduce pattern visibility in dark modes */
body[data-theme="medium-dark"]::before,
body[data-theme="dark"]::before {
    opacity: 0.15;
}

body > * {
    position: relative;
    z-index: 2;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Better Link Styling */
a {
    transition: color var(--transition-fast);
}

/* ========================================
   ENHANCED NAVIGATION
   ======================================== */

.navbar {
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    transition: transform var(--transition-base);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Enhanced Search Bar */
.navbar .input-group {
    box-shadow: var(--shadow);
    border-radius: var(--radius-full);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.navbar .input-group:focus-within {
    box-shadow: var(--shadow-lg);
}

.navbar .form-control {
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
}

.navbar .btn-outline-light {
    border: none;
    padding: 0.75rem 1.5rem;
}

/* ========================================
   FEATURED CAROUSEL - MODERN DESIGN
   ======================================== */

#featuredCarousel {
    /*border-radius: var(--radius-xl);*/
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    margin-bottom: 3rem;
}

#featuredCarousel .carousel-item {
    position: relative;
}

#featuredCarousel .carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    z-index: 1;
}

#featuredCarousel .carousel-caption {
    z-index: 2;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    /*padding: 2rem !important;*/
    /*max-width: 600px;*/
    margin: 0 auto;
    /*bottom: 3rem !important;*/
}

#featuredCarousel .carousel-caption h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#featuredCarousel .carousel-caption p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#featuredCarousel .carousel-caption .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
}

#featuredCarousel .carousel-caption .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

#featuredCarousel .carousel-control-prev,
#featuredCarousel .carousel-control-next {
    width: 60px;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: var(--radius-full);
    opacity: 0;
    transition: all var(--transition-base);
}

#featuredCarousel:hover .carousel-control-prev,
#featuredCarousel:hover .carousel-control-next {
    opacity: 1;
}

#featuredCarousel .carousel-control-prev {
    left: 2rem;
}

#featuredCarousel .carousel-control-next {
    right: 2rem;
}

#featuredCarousel .carousel-control-prev:hover,
#featuredCarousel .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

#featuredCarousel .carousel-indicators {
    margin-bottom: 1rem;
    z-index: 3;
    right: unset;
    margin-left: 5%;
    margin-right: unset;
}

#featuredCarousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    border: 2px solid white;
    background-color: transparent;
    transition: all var(--transition-base);
}

#featuredCarousel .carousel-indicators button.active {
    background-color: white;
    width: 40px;
}

/* ========================================
   MODERN TABS DESIGN
   ======================================== */

.nav-tabs {
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    color: var(--gray-600);
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    margin-bottom: -2px;
    transition: all var(--transition-base);
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-light);
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.nav-tabs .nav-link i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.tab-content {
    background: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 2rem !important;
    box-shadow: var(--shadow-md);
}

/* ========================================
   ENHANCED BOOK CARDS
   ======================================== */

.card {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow);
    transition: all var(--transition-base);
}

.card:hover {
    /*transform: translateY(-8px);*/
    /*box-shadow: var(--shadow-xl);*/
}

.card-img-top {
    transition: transform var(--transition-slow);
    position: relative;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card > a {
    position: relative;
    overflow: hidden;
    display: block;
}

.card > a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover > a::after {
    opacity: 1;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title a {
    color: var(--gray-900);
    transition: color var(--transition-base);
}

.card:hover .card-title a {
    color: var(--primary-color);
}

.card-text {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ========================================
   RATING STARS - ENHANCED
   ======================================== */

.rating-stars {
    color: var(--warning-color);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.rating-stars i {
    transition: all var(--transition-fast);
}

.rating-stars .bi-star {
    cursor: pointer;
}

.rating-stars .bi-star:hover,
.rating-stars .bi-star:hover ~ .bi-star {
    color: #ff9800;
    transform: scale(1.2);
}

.rating-stars .bi-star-fill {
    color: var(--warning-color);
}

.user-rating .bi-star:hover {
    transform: scale(1.3);
}

/* ========================================
   BADGES - MODERN STYLE
   ======================================== */

.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--radius-full);
    letter-spacing: 0.3px;
}

/* ========================================
   CATEGORY CARDS
   ======================================== */

.category-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    color: white;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.category-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transition: transform var(--transition-slower);
}

.category-card:hover::before {
    transform: translate(-25%, -25%);
}

.category-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.category-card h6 {
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.category-card small {
    opacity: 0.9;
}

/* ========================================
   FILTER SIDEBAR - ENHANCED
   ======================================== */

.filter-sidebar .card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.filter-sidebar .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    padding: 1.25rem;
    font-weight: 600;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.filter-sidebar .form-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.filter-sidebar .form-select {
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    padding: 0.625rem 0.875rem;
    transition: all var(--transition-base);
}

.filter-sidebar .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.filter-sidebar .btn {
    border-radius: var(--radius);
    font-weight: 600;
    padding: 0.75rem;
    transition: all var(--transition-base);
}

.filter-sidebar .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   BOOK DETAILS PAGE
   ======================================== */

.book-cover-wrapper {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    transition: transform var(--transition-base);
}

.book-cover-wrapper:hover {
    transform: scale(1.02);
}

.book-cover-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.4));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.book-cover-wrapper:hover::after {
    opacity: 1;
}

.book-actions .btn {
    border-radius: var(--radius-lg);
    font-weight: 600;
    padding: 0.875rem;
    transition: all var(--transition-base);
}

.book-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.book-stats .card {
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
}

.book-stats .card-body > div {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

.book-stats .card-body > div:last-child {
    border-bottom: none;
}

.book-stats .card-body > div:hover {
    padding-left: 0.5rem;
    background: var(--gray-50);
}

/* ========================================
   CHAPTER LIST - MODERN TABLE
   ======================================== */

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-300);
    padding: 1rem;
}

.table tbody tr {
    transition: all var(--transition-base);
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:hover {
    background: var(--gray-50);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

.table tbody tr td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr td a {
    color: var(--gray-800);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-base);
}

.table tbody tr:hover td a {
    color: var(--primary-color);
}

/* ========================================
   COMMENTS SECTION
   ======================================== */

.comment-item {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    margin-bottom: 1rem;
    transition: all var(--transition-base);
}

.comment-item:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* ========================================
   CHAPTER READING PAGE
   ======================================== */

.chapter-content {
    font-size: var(--font-size-medium);
    line-height: 1.9;
    padding: 3rem 2rem;
    max-width: 1024px;
    margin: 0 auto;
    background-color: var(--theme-day-bg);
    color: var(--theme-day-text);
    min-height: 70vh;
    /*border-radius: var(--radius-xl);*/
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.chapter-content h2 {
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.chapter-content .content {
    text-align: justify;
    text-justify: inter-word;
}

.chapter-content .content p {
    line-height: 2rem;
    /*margin-bottom: 1rem;*/
    /*text-indent: 1em;*/
}

/* Reading Settings Classes - Font Sizes */
.chapter-content.font-small { font-size: var(--font-size-small); line-height: 1.8; }
.chapter-content.font-medium { font-size: var(--font-size-medium); line-height: 1.9; }
.chapter-content.font-large { font-size: var(--font-size-large); line-height: 2.0; }
.chapter-content.font-xl { font-size: var(--font-size-xl); line-height: 2.1; }

/* Reading Settings Classes - Font Families */
.chapter-content.font-serif { font-family: var(--font-serif); }
.chapter-content.font-sans { font-family: var(--font-sans); }
.chapter-content.font-mono { font-family: var(--font-mono); }

/* Reading Settings Classes - Themes */
.chapter-content.theme-day {
    background-color: var(--theme-day-bg);
    color: var(--theme-day-text);
}

.chapter-content.theme-night {
    background-color: var(--theme-night-bg);
    color: var(--theme-night-text);
}

.chapter-content.theme-sepia {
    background-color: var(--theme-sepia-bg);
    color: var(--theme-sepia-text);
}

/* Chapter Navigation */
.chapter-nav {
    position: sticky;
    top: 75px;
    background: white;
    z-index: 1020;
    border-bottom: 1px solid var(--gray-300);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.chapter-navigation .btn {
    /*border-radius: var(--radius-lg);*/
    font-weight: 600;
    transition: all var(--transition-base);
}

.chapter-navigation .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   READING SETTINGS MODAL (Legacy - Kept for compatibility)
   ======================================== */

.modal-content {
    /*border-radius: var(--radius-xl);*/
    border: none;
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.5rem;
    border: none;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1.25rem;
}

.reading-settings .btn-group .btn {
    border-radius: 0;
    transition: all var(--transition-base);
}

.reading-settings .btn-group .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.reading-settings .btn-group .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.reading-settings .btn-group .btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ========================================
   COLLAPSIBLE READING SETTINGS PANEL - PROFESSIONAL DESIGN
   ======================================== */

.reading-settings-wrapper {
    margin-bottom: 1.5rem;
}

/* Toggle Button - Enhanced Design */
.reading-settings-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0;
    background: linear-gradient(135deg, #4a6fa5 0%, #2e5a8a 100%);
    border: none;
    /*border-radius: var(--radius-lg);*/
    color: white;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(46, 90, 138, 0.25);
    transition: all var(--transition-base);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.reading-settings-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.reading-settings-toggle:hover::before {
    left: 100%;
}

.reading-settings-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 90, 138, 0.35);
    background: linear-gradient(135deg, #5578b3 0%, #3d6898 100%);
}

.reading-settings-toggle:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(46, 90, 138, 0.3);
}

.reading-settings-toggle .toggle-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.reading-settings-toggle .toggle-left,
.reading-settings-toggle .toggle-right {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.reading-settings-toggle i.bi-gear-fill {
    font-size: 1.25rem;
    animation: rotate-gear 3s linear infinite;
}

@keyframes rotate-gear {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.reading-settings-toggle:hover i.bi-gear-fill {
    animation-duration: 1s;
}

.reading-settings-toggle .settings-text {
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.reading-settings-toggle .settings-badge {
    padding: 0.375rem 0.875rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 50px;
    text-align: center;
}

.reading-settings-toggle .toggle-icon {
    transition: transform var(--transition-base);
    font-size: 1rem;
    font-weight: bold;
}

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

/* Collapsible Panel - Enhanced */
.reading-settings-panel {
    margin-top: 0.875rem;
    transition: all var(--transition-base);
}

.settings-panel-content {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-300);
}

/* Settings Label - Professional Styling */
.settings-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--gray-800);
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-bottom: 0.25rem;
}

.settings-label i {
    font-size: 1.125rem;
    color: #4a6fa5;
    filter: drop-shadow(0 1px 2px rgba(74, 111, 165, 0.3));
}

/* Button Group Styling - Consistent Heights & Professional Look */
.settings-btn-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
    border: 1px solid var(--gray-300);
}

.settings-btn-group .btn {
    border-radius: 0;
    transition: all var(--transition-base);
    font-weight: 600;
    padding: 0.75rem 1rem;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-right: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    position: relative;
    overflow: hidden;
}

.settings-btn-group .btn:last-child {
    border-right: none;
}

.settings-btn-group .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 111, 165, 0.05), transparent);
    transition: left 0.4s;
}

.settings-btn-group .btn:hover::before {
    left: 100%;
}

.settings-btn-group .btn:hover:not(.active) {
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    color: #4a6fa5;
    transform: translateY(-1px);
}

.settings-btn-group .btn:active:not(.active) {
    transform: translateY(0);
    background: var(--gray-200);
}

.settings-btn-group .btn.active {
    background: linear-gradient(135deg, #4a6fa5 0%, #3d6898 100%);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),
                0 0 0 3px rgba(74, 111, 165, 0.15);
    z-index: 2;
    font-weight: 700;
}

.settings-btn-group .btn.active::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    pointer-events: none;
}

/* Button Text & Icons */
.settings-btn-group .btn .btn-text {
    font-size: 0.9375rem;
    letter-spacing: 0.3px;
}

.settings-btn-group .btn i {
    font-size: 1.125rem;
    transition: all var(--transition-base);
}

.settings-btn-group .btn .btn-label {
    font-size: 0.875rem;
    margin-left: 0.375rem;
    font-weight: 600;
}

.settings-btn-group .btn:hover i {
    transform: scale(1.1);
}

.settings-btn-group .btn.active i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Theme-specific button colors when active */
.theme-btn[data-theme="day"].active {
    background: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),
                0 0 0 3px rgba(255, 165, 0, 0.2);
}

.theme-btn[data-theme="night"].active {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),
                0 0 0 3px rgba(44, 62, 80, 0.2);
}

.theme-btn[data-theme="sepia"].active {
    background: linear-gradient(135deg, #8b7355 0%, #6d5a43 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),
                0 0 0 3px rgba(139, 115, 85, 0.2);
}

/* Focus States for Accessibility */
.settings-btn-group .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.3);
    z-index: 3;
}

.settings-btn-group .btn.active:focus {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),
                0 0 0 3px rgba(74, 111, 165, 0.4);
}

/* Responsive Design for Settings Panel */
@media (max-width: 991px) {
    .settings-panel-content {
        padding: 1.5rem;
    }

    .settings-btn-group .btn {
        padding: 0.625rem 0.875rem;
        height: 44px;
    }
}

@media (max-width: 768px) {
    .reading-settings-toggle .toggle-content {
        padding: 0.875rem 1rem;
    }

    .reading-settings-toggle .settings-text {
        font-size: 0.9375rem;
    }

    .reading-settings-toggle .settings-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
        min-width: 45px;
    }

    .reading-settings-toggle i.bi-gear-fill {
        font-size: 1.125rem;
    }

    .settings-panel-content {
        padding: 1.25rem;
    }

    .settings-label {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .settings-label i {
        font-size: 1rem;
    }

    .settings-btn-group .btn {
        padding: 0.625rem 0.75rem;
        height: 42px;
        font-size: 0.875rem;
    }

    .settings-btn-group .btn .btn-text {
        font-size: 0.875rem;
    }

    .settings-btn-group .btn .btn-label {
        font-size: 0.8125rem;
    }

    /* Add spacing between stacked controls on mobile */
    .settings-panel-content .row > .col-12:not(:last-child) {
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 576px) {
    body.public-home .carousel-section{
        padding-left: 0;
        padding-right: 0;
    }
    .reading-settings-toggle .settings-badge {
        display: none;
    }

    .reading-settings-toggle .toggle-right {
        gap: 0.5rem;
    }

    .settings-btn-group .btn {
        padding: 0.625rem 0.625rem;
        height: 40px;
    }

    .settings-btn-group .btn .btn-label.d-none {
        display: none !important;
    }

    .settings-btn-group .btn i {
        font-size: 1rem;
    }
}

/* ========================================
   AUTOCOMPLETE DROPDOWN
   ======================================== */

#autocomplete-results {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

#autocomplete-results .autocomplete-item {
    padding: 1rem 1.25rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--gray-800);
    display: block;
    border-bottom: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
}

#autocomplete-results .autocomplete-item:hover {
    background: linear-gradient(to right, var(--primary-light) 0%, transparent 100%);
    padding-left: 1.5rem;
    color: var(--primary-dark);
}

#autocomplete-results .autocomplete-item:last-child {
    border-bottom: none;
}

/* ========================================
   ALERTS & NOTIFICATIONS
   ======================================== */

.alert {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1f4e0 0%, #e8f8f0 100%);
    color: var(--success-color);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #e8f6f8 100%);
    color: var(--info-color);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #fff9e6 100%);
    color: #856404;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #fce8ea 100%);
    color: var(--danger-color);
}

/* ========================================
   BUTTONS - ENHANCED
   ======================================== */

.btn {
    /*border-radius: var(--radius);*/
    /*font-weight: 600;*/
    /*padding: 0.625rem 1.25rem;*/
    /*transition: all var(--transition-base);*/
    /*border: none;*/
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    gap: 0.5rem;
}

.page-link {
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    font-weight: 600;
    padding: 0.625rem 1rem;
    transition: all var(--transition-base);
    margin: 0;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* ========================================
   ADVANCED FOOTER
   ======================================== */

/* Footer Main Container */
.advanced-footer {
    background: linear-gradient(135deg, #1a1d29 0%, #2d3142 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    margin-top: 4rem;
}

/* Footer Brand */
.footer-brand h4 {
    color: #ffffff;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.footer-brand i {
    font-size: 1.75rem;
}

/* Footer Description */
.footer-description {
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Footer Headings */
.footer-heading {
    color: #ffffff;
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 2px;
}

/* Newsletter Form */
.newsletter-form .input-group {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.newsletter-form input.form-control {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-right: none;
}

.newsletter-form input.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: none;
}

.newsletter-form input.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-form button.btn-primary {
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--primary-color);
}

.newsletter-form button.btn-primary:hover {
    background: var(--primary-dark);
    transform: none;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    transition: all var(--transition-fast);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-base);
    position: relative;
}

.footer-links a i {
    font-size: 1rem;
    transition: all var(--transition-base);
}

.footer-links a:hover {
    color: var(--primary-light) !important;
    padding-left: 8px;
}

.footer-links a:hover i {
    color: var(--primary-color);
}

/* Footer Contact */
.footer-contact p {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.footer-contact a {
    transition: all var(--transition-base);
}

.footer-contact a:hover {
    color: var(--primary-light) !important;
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.social-link {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.25rem;
    text-decoration: none;
    transition: all var(--transition-base);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-5px) scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 8px 16px rgba(13, 110, 253, 0.3);
}

.social-link:active {
    transform: translateY(-3px) scale(1.05);
}

/* Footer Bottom Bar */
.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-links {
    margin: 0;
    padding: 0;
}

.footer-bottom-links li {
    display: inline-block;
    margin: 0 0.5rem;
}

.footer-bottom-links a {
    transition: all var(--transition-fast);
}

.footer-bottom-links a:hover {
    color: var(--primary-light) !important;
}

/* Back to Top Button */
.btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.btn-back-to-top:active {
    transform: translateY(-2px);
}

/* Responsive Design for Footer */
@media (max-width: 991px) {
    .footer-heading::after {
        width: 30px;
        height: 2px;
    }

    .social-link {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

@media (max-width: 767px) {
    .advanced-footer {
        margin-top: 3rem;
    }

    .footer-brand h4 {
        font-size: 1.35rem;
    }

    .footer-heading {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .footer-bottom-links li {
        margin: 0 0.25rem;
        font-size: 0.85rem;
    }

    .btn-back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@media (max-width: 575px) {
    .footer-bottom .row > div {
        text-align: center !important;
    }

    .footer-bottom-links {
        margin-top: 0.5rem;
    }

    .social-links {
        justify-content: center;
    }
}

/* ========================================
   LOADING STATES & ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .chapter-content {
        padding: 1.5rem 1rem;
        /*border-radius: var(--radius-lg);*/
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    #featuredCarousel .carousel-caption {
        padding: 1rem !important;
        bottom: 1rem !important;
    }

    #featuredCarousel .carousel-caption h3 {
        font-size: 1.5rem;
    }

    #featuredCarousel .carousel-caption p {
        font-size: 0.95rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #featuredCarousel .carousel-control-prev,
    #featuredCarousel .carousel-control-next {
        display: none;
    }

    .tab-content {
        padding: 1rem !important;
    }

    .card-title {
        font-size: 0.95rem;
    }
}

/* Adjust chapter nav position for mobile header */
@media (max-width: 991px) {
    .chapter-nav {
        top: 60px;
    }
}

@media (max-width: 576px) {
    .chapter-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }

    .chapter-navigation .btn {
        width: 100%;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .navbar, .footer, .chapter-nav, .comments-section, .chapter-navigation {
        display: none !important;
    }

    .chapter-content {
        max-width: 100%;
        padding: 0;
        font-size: 12pt;
        line-height: 1.6;
        color: #000 !important;
        background: #fff !important;
        box-shadow: none;
        border-radius: 0;
    }

    .chapter-content h2 {
        border-bottom: 2px solid #000;
    }
}

/* ========================================
   DECORATIVE BACKGROUND CIRCLES
   ======================================== */

.bg-circle {
    position: fixed;
    border-radius: 50%;
    filter: blur(15.625rem);
    z-index: -1;
    pointer-events: none;
}

.bg-circle-1 {
    /* Size and position set by JavaScript */
    background: rgba(250, 175, 64, 0.99);
    animation: float-circle-1 20s ease-in-out infinite;
}

.bg-circle-2 {
    /* Size and position set by JavaScript */
    background: rgba(30, 58, 95, 0.99);
    animation: float-circle-2 25s ease-in-out infinite;
}

@keyframes float-circle-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-30px, 40px) scale(1.1);
    }
    66% {
        transform: translate(40px, -30px) scale(0.95);
    }
}

@keyframes float-circle-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    40% {
        transform: translate(50px, -40px) scale(1.08);
    }
    80% {
        transform: translate(-40px, 50px) scale(0.92);
    }
}

/* Hide circles on mobile for better performance */
@media (max-width: 768px) {
    .bg-circle {
        display: none;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.shadow-hover {
    transition: box-shadow var(--transition-base);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-xl);
}

/* ========================================
   BOOK LOVER'S GRADIENT UTILITIES
   ======================================== */

/* Background Gradients */
.bg-gradient-warm {
    background: var(--gradient-warm);
}

.bg-gradient-nature {
    background: var(--gradient-nature);
}

.bg-gradient-knowledge {
    background: var(--gradient-knowledge);
}

.bg-gradient-sunset {
    background: var(--gradient-sunset);
}

.bg-gradient-forest {
    background: var(--gradient-forest);
}

.bg-gradient-library {
    background: var(--gradient-library);
}

.bg-gradient-vintage {
    background: var(--gradient-vintage);
}

.bg-gradient-modern {
    background: var(--gradient-modern);
}

/* Text Gradients */
.text-gradient-warm {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-nature {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-knowledge {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-library {
    background: var(--gradient-library);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   ENHANCED CARDS FOR BOOK LOVERS
   ======================================== */

.card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(139, 69, 19, 0.1);
    background: linear-gradient(135deg, #faf8f5 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.08);
    transition: all var(--transition-base);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-library);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(139, 69, 19, 0.15);
    border-color: rgba(139, 69, 19, 0.2);
}

.card:hover::before {
    opacity: 1;
}

.card-title {
    color: var(--primary-color);
    font-weight: 700;
}

.card-text {
    color: var(--gray-700);
}

/* Book Card Specific */
.book-card {
    position: relative;
    overflow: hidden;
}

.book-card .card-img-top {
    transition: transform var(--transition-slow);
}

.book-card:hover .card-img-top {
    transform: scale(1.05);
}

.book-card .card-body {
    background: linear-gradient(to top, #faf8f5 0%, transparent 100%);
}

/* ========================================
   SECTION BACKGROUNDS
   ======================================== */

.section-featured {
    background: var(--gradient-warm);
    padding: 3rem 0;
    border-radius: var(--radius-xl);
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.section-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(139, 69, 19, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(47, 82, 51, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.section-categories {
    background: linear-gradient(135deg, rgba(47, 82, 51, 0.03) 0%, rgba(30, 58, 95, 0.03) 100%);
    padding: 3rem 0;
    position: relative;
}

.section-new-releases {
    background: var(--gradient-modern);
    padding: 3rem 0;
}

/* ========================================
   ENHANCED BADGES
   ======================================== */

.badge {
    border-radius: var(--radius);
    padding: 0.35rem 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid transparent;
}

.badge-primary {
    background: var(--gradient-sunset);
    color: white;
    border-color: var(--primary-dark);
}

.badge-success {
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary-color));
    color: white;
    border-color: var(--secondary-dark);
}

.badge-info {
    background: linear-gradient(135deg, var(--accent-lighter), var(--accent-light));
    color: white;
    border-color: var(--accent-color);
}

.badge-warning {
    background: linear-gradient(135deg, #f4d06f, var(--warning-color));
    color: var(--gray-900);
    border-color: #d4a929;
}

/* ========================================
   CATEGORY & GENRE CARDS
   ======================================== */

.category-card,
.genre-card {
    background: linear-gradient(135deg, #faf8f5 0%, #f4f1ec 100%);
    border: 2px solid rgba(139, 69, 19, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before,
.genre-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.category-card:hover,
.genre-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 28px rgba(139, 69, 19, 0.2);
    border-color: var(--primary-color);
}

.category-card:hover::before,
.genre-card:hover::before {
    opacity: 1;
}

.category-card i,
.genre-card i {
    font-size: 2.5rem;
    background: var(--gradient-library);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    display: block;
}

.category-card h5,
.genre-card h5 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-card p,
.genre-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* ========================================
   ENHANCED TABS
   ======================================== */

.nav-tabs {
    border-bottom: 2px solid transparent;
    border-image: var(--gradient-library) 1;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--gray-600);
    font-weight: 600;
    padding: 1rem 1.5rem;
    transition: all var(--transition-base);
    position: relative;
    background: transparent;
}

.nav-tabs .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-library);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background: linear-gradient(to bottom, rgba(139, 69, 19, 0.05), transparent);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: linear-gradient(to bottom, rgba(139, 69, 19, 0.08), transparent);
}

.nav-tabs .nav-link.active::before {
    transform: scaleX(1);
}

/* ========================================
   READING PROGRESS BAR
   ======================================== */

.progress {
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: var(--gradient-library);
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ========================================
   AUTHOR & BOOK INFO PANELS
   ======================================== */

.info-panel {
    background: linear-gradient(135deg, #faf8f5 0%, #f4f1ec 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.08);
}

.info-panel h5 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

.info-panel p {
    color: var(--gray-700);
    line-height: 1.7;
}

/* ========================================
   SEARCH & FILTERS
   ======================================== */

.search-box {
    background: linear-gradient(135deg, #faf8f5 0%, #ffffff 100%);
    border: 2px solid rgba(139, 69, 19, 0.1);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.05);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(139, 69, 19, 0.15), 0 0 0 3px rgba(139, 69, 19, 0.1);
    background: #ffffff;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-chip:hover {
    background: var(--gradient-library);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2);
}

.filter-chip.active {
    background: var(--gradient-library);
    color: white;
    border-color: var(--primary-color);
}

/* ========================================
   BOOK STATISTICS
   ======================================== */

.stat-card {
    background: linear-gradient(135deg, #faf8f5 0%, #ffffff 100%);
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(139, 69, 19, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    background: var(--gradient-library);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========================================
   QUOTE BLOCKS (for book excerpts)
   ======================================== */

.book-quote {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.03) 0%, rgba(47, 82, 51, 0.03) 100%);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    font-family: var(--font-serif);
    color: var(--gray-700);
    position: relative;
}

.book-quote::before {
    content: '"';
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    font-size: 4rem;
    color: var(--primary-light);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.book-quote cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ========================================
   BREADCRUMBS
   ======================================== */

.breadcrumb {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05), rgba(47, 82, 51, 0.05));
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(139, 69, 19, 0.1);
}

.breadcrumb-item {
    color: var(--gray-600);
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 700;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--gray-400);
}

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

/* ========================================
   FOOTER UPDATES
   ======================================== */

.advanced-footer {
    background: var(--gradient-forest);
    position: relative;
    overflow: hidden;
}

.advanced-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(30, 58, 95, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.footer-heading::after {
    background: linear-gradient(90deg, var(--primary-light), transparent);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(139, 69, 19, 0.6);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}
