/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Define one standard height for the whole site */
:root {
    --header-height: 75px; 
}

/* Responsive Base */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--white);
    overflow-x: hidden;
    word-wrap: break-word;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    padding-top: var(--header-height) !important;
}

.header {
    height: var(--header-height);
}

/* This pushes the content down so the header doesn't cover the title */
.page-header {
    margin-top: 0 !important; /* Remove manual margin, let body padding handle it */
}

/* GPU-Accelerated Mobile Navigation */
.nav-menu {
    will-change: transform; /* Tells the phone to use the GPU */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%); /* Use transform instead of 'left' for better speed */
    left: 0; /* Reset left to 0 */
}

.nav-menu.active {
    transform: translateX(0);
}

/* Book Card Cover Styling */
.book-card .book-cover {
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Very faint line */
    background-color: var(--secondary-color); /* Fills gaps if cover is small */
}

img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Responsive Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

p {
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    word-wrap: break-word;
}

/* Responsive Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Responsive Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Responsive Flex */
.flex {
    display: flex;
    gap: 1rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.flex-between {
    justify-content: space-between;
    align-items: center;
}

/* Language Switcher Styles */
.language-switcher {
    display: flex;
    gap: 5px;
    background: var(--light-gray, #f5f5f5);
    padding: 5px;
    border-radius: 20px;
}

.lang-btn {
    border: none;
    padding: 5px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    background: transparent;
    color: #333;
}

.lang-btn:hover {
    background: rgba(139, 0, 0, 0.1);
}

.lang-btn.active {
    background: var(--primary-color, #8B0000);
    color: white;
}

/* Responsive Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    box-sizing: border-box;
}

.btn:hover {
    background: #660000;
    transform: translateY(-2px);
}

/* Responsive Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
    overflow: hidden;
    word-wrap: break-word;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Prevent flickering and improve performance */
*,
*::before,
*::after {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

:root {
    --primary-color: #8B0000;
    --secondary-color: #F5F5DC;
    --accent-color: #CD853F;
    --text-dark: #2C2C2C;
    --text-light: #666;
    --white: #FFFFFF;
    --light-gray: #F8F8F8;
    --border-color: #E5E5E5;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Noto Serif Bengali', serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Header Styles */
.page-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--white) 100%);
    padding: 120px 0 80px;
    text-align: center;
    margin-top: 80px;
}

.page-header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.2rem;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Header */
.header {
    background: #ffffff;
    border-bottom: 1px solid #eeeeee; /* Adds a very thin line to separate from body */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    display: flex;
    align-items: center; /* This moves everything UP into the middle */
    justify-content: space-between;
    padding: 10px 20px; /* Adds equal space on top and bottom */
    height: 80px; /* Gives the header a defined height to center within */
}

.nav-container {
    display: flex;
    justify-content: space-between; /* This pushes logo LEFT and menu RIGHT */
    align-items: center;           /* This pulls them UP away from the bottom */
    padding: 15px 20px;            /* Adds a nice gap at the top and bottom */
    height: 80px;                  /* Sets a clean height for the bar */
    width: 100%;                   /* Makes sure it uses the full screen width */
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    margin-left: 0;                /* Ensures it stays at the far left */
    gap: 12px;                     /* Adds space between circle logo and words */
}

.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* If the text specifically feels too low, we can nudge it up */
.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform: translateY(-2px); /* Tiny nudge upwards */
}

.logo-text h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0;
}

.logo-text p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    font-style: italic;
}

.nav-menu {
    overflow: hidden; /* This hides any stray scroll icons */
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.admin-link {
    background: var(--primary-color);
    color: var(--white) !important;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.admin-link:hover {
    background: #660000;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-right: 0;               /* Ensures it stays at the far right */
    display: flex;
    align-items: center;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--white) 100%);
    padding: 120px 0 80px;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: var(--shadow-hover);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: #660000;
    transform: translate3d(0, -2px, 0);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--text-dark);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--text-dark);
    color: var(--white);
}

/* Sections */
.section-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Featured Books */
.featured-books {
    padding: 80px 0;
    background: var(--light-gray);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.book-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.book-card:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: var(--shadow-hover);
}

.book-cover {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.book-info {
    padding: 1.5rem;
}

.book-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.book-author {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-style: italic;
}

.book-description {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.book-category {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Categories */
.categories {
    padding: 80px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card p {
    color: var(--text-light);
    margin: 0;
}

/* About Preview */
.about-preview {
    padding: 80px 0;
    background: var(--secondary-color);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.about-text p {
    color: var(--text-dark);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--white);
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
    color: #ccc;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translate3d(0, -2px, 0);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 2rem;
    text-align: center;
    color: #ccc;
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
        display: flex;
        animation: slideDown 0.4s ease forwards;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2.2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-text h1 {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 1.5rem;
    }
}

/* Animation Classes - Optimized to prevent flickering */
.fade-in {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.slide-in-left {
    opacity: 0;
    transform: translate3d(-50px, 0, 0);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.slide-in-right {
    opacity: 0;
    transform: translate3d(50px, 0, 0);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Mobile Menu Slide Animation */
@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Book Loader Animation */
#loader-wrapper {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Always on top */
    transition: opacity 0.5s ease;
}

.book-loader {
    width: 60px;
    height: 40px;
    position: relative;
    border: 3px solid #8B0000; /* Your Dark Red brand color */
    border-radius: 4px;
}

.book-page {
    position: absolute;
    left: 50%; top: 0;
    width: 50%; height: 100%;
    background: #fff;
    border-left: 2px solid #8B0000;
    transform-origin: left center;
    animation: flip 1.5s infinite ease-in-out;
}

.book-page:nth-child(2) { animation-delay: 0.2s; }
.book-page:nth-child(3) { animation-delay: 0.4s; }

@keyframes flip {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-180deg); }
}

.loader-text {
    margin-top: 20px;
    font-family: 'Noto Serif Bengali', serif;
    color: #8B0000;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Mobile Navigation Menu Styles */
.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden by default */
    width: 80%;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 80px 40px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.mobile-nav-menu.active {
    right: 0; /* Slide in from right */
}

/* For iOS fix mentioned in your JS */
.mobile-nav-menu {
    height: calc(var(--vh, 1vh) * 100);
}

.mobile-dark-toggle {
    margin-top: auto; /* Pushes toggle to the bottom */
    padding: 15px;
    background: #f4f4f4;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* Removes default arrows from dropdowns */
.nav-link select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
}

/* Modern PDF Viewer Mobile Optimization */
.modern-pdf-viewer {
    height: 80vh !important; /* Use 80% of the screen height */
    max-height: 800px;
}

@media (max-width: 600px) {
    .pdf-header {
        flex-direction: column; /* Stack controls on small phones */
        gap: 5px;
    }
    .pdf-tools {
        display: none; /* Hide zoom tools on mobile to save space */
    }
}

/* Lazy Loading Shimmer Effect */
img.lazy {
    background: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Reading Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    z-index: 10001; /* Higher than nav to stay visible */
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

/* The actual progress bar */
.progress-bar {
    height: 4px;
    background: #8B0000; /* Your Dark Red brand color */
    width: 0%; /* Starts at 0 */
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}

/* Legacy Badge for 50-Year Milestone */
.legacy-badge {
    background: linear-gradient(135deg, #8B0000, #4a0000);
    color: #FFD700; /* Gold color */
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #FFD700;
    margin: 2rem 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.legacy-badge h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

/* Fix for the Book Cards on Mobile */
.book-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    width: 100%;
    overflow: hidden; /* Prevents text from leaking out */
}

.book-card img {
    width: 150px; /* Force a standard size */
    height: 210px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

.book-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    word-wrap: break-word; /* Fixes long titles */
}

.book-info p {
    font-size: 0.9rem;
    color: #666;
}

/* Fix for the Featured Grid */
.books-grid {
    display: grid;
    grid-template-columns: 1fr; /* One book per row on mobile */
    gap: 20px;
    padding: 10px;
}

@media (min-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 books on desktop */
    }
}

/* FORCE MOBILE FIX */
@media (max-width: 768px) {
    .books-grid, #featuredBooks {
        display: block !important; /* Stack books vertically */
        padding: 10px !important;
    }

    .book-card {
        display: block !important;
        margin-bottom: 30px !important;
        background: #fff !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
        padding: 20px !important;
        width: 100% !important;
        text-align: center !important;
    }

    .book-card img {
        width: 180px !important; /* Fixed width */
        height: 250px !important; /* Fixed height */
        object-fit: cover !important;
        margin: 0 auto 15px auto !important;
        display: block !important;
        border-radius: 8px !important;
    }

    .book-info {
        width: 100% !important;
    }

    .book-info h3 {
        font-size: 1.4rem !important;
        line-height: 1.2 !important;
        margin: 10px 0 !important;
        color: #333 !important;
        word-wrap: break-word !important;
        display: block !important;
    }

    .book-info p {
        font-size: 1rem !important;
        margin-bottom: 15px !important;
    }

    .btn-read {
        width: 100% !important;
        padding: 12px !important;
        display: block !important;
    }
}

/* The Shimmer Animation */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.skeleton-card {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    display: inline-block;
    position: relative;
    animation: shimmer 1.2s infinite linear;
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
    height: 300px; /* Matches your book card height */
}

.skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* FINAL MOBILE FIX */
@media (max-width: 600px) {
    .book-card {
        flex-direction: column !important;
        height: auto !important;
        padding: 15px !important;
        margin-bottom: 20px !important;
        display: flex !important;
        align-items: center !important;
    }

    .book-image {
        width: 100% !important;
        max-width: 160px !important;
        margin-bottom: 15px !important;
    }

    .book-image img {
        width: 100% !important;
        height: 220px !important;
        object-fit: contain !important; /* This stops the stretching */
        border-radius: 5px;
    }

    .book-info {
        text-align: center !important;
        width: 100% !important;
    }

    /* This stops the name from repeating if the CSS was doing it */
    .book-info h3, .book-info p {
        display: block !important;
        margin: 5px 0 !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Mobile Fix for Book Cards */
.book-card {
    display: flex !important;
    flex-direction: column !important; /* Stack vertical */
    align-items: center !important;
    background: white;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
}

.book-cover-wrapper {
    width: 100%;
    max-width: 160px; /* Limits width on mobile */
    height: 230px;    /* FORCES height so title can't overlap */
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
}

.book-cover-wrapper img {
    height: 100%;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.book-details {
    width: 100%;
}

.book-title {
    font-size: 1.2rem !important;
    color: #333;
    margin: 10px 0 5px 0 !important;
    font-weight: bold;
    line-height: 1.2;
}

.book-author {
    font-size: 0.9rem !important;
    color: #666;
    margin-bottom: 15px !important;
}

.read-btn {
    display: block;
    background: #8B0000;
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
}
