* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #d97706;
    --secondary-color: #b45309;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #dc2626;
    --text-dark: #292524;
    --text-light: #78716c;
    --bg-light: #fef3c7;
    --bg-cream: #fffbeb;
    --border-color: #fde68a;
    --brown-dark: #78350f;
    --brown-light: #fef3c7;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    button, a, .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .compact-input, .compact-select {
        min-height: 44px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.logo-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.logo i {
    font-size: 2.5rem;
    color: var(--accent-color);
}

/* Desktop Nav */
.nav {
    display: block;
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.nav-backdrop {
    display: none;
}

.nav-header {
    display: none;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    padding: 0;
    flex-direction: row;
}

.nav ul li {
    padding: 0;
    border: none;
    opacity: 1;
    transform: none;
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 5px;
}

.nav a:hover {
    background: rgba(255,255,255,0.2);
    color: var(--accent-color);
}

.nav a i {
    margin-right: 5px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 8px;
    transition: transform 0.3s;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Hero Banner Carousel */
.hero-carousel {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.hero-slides {
    position: relative;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 2;
    padding: 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    font-weight: 800;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: var(--brown-dark);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.hero-nav-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.hero-nav-btn.prev {
    left: 20px;
}

.hero-nav-btn.next {
    right: 20px;
}

.hero-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid white;
}

.indicator.active {
    background: var(--accent-color);
    width: 40px;
    border-radius: 10px;
}

.btn {
    display: inline-block;
    padding: 14px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

.btn-primary {
    background: white;
    color: var(--brown-dark);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    background: var(--bg-cream);
}

/* Carousel Section */
.carousel-section {
    padding: 70px 0;
    background: var(--bg-cream);
    border-bottom: 3px solid var(--border-color);
}

.carousel-section:nth-child(even) {
    background: white;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    color: var(--brown-dark);
    font-weight: 800;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.carousel {
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 0;
    scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.book-card {
    min-width: 250px;
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(120, 53, 15, 0.15);
    transition: all 0.3s;
    border: 2px solid var(--border-color);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(217, 119, 6, 0.3);
    border-color: var(--primary-color);
}

.book-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.book-card h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.book-card .author {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status.available {
    background: #d1fae5;
    color: #065f46;
}

.status.unavailable {
    background: #fee2e2;
    color: #991b1b;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: 3px solid white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.carousel-btn:hover {
    background: var(--brown-dark);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* Search Page */
.search-page {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.search-page h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.search-container {
    background: white;
    padding: 35px;
    border-radius: 15px;
    box-shadow: 0 6px 25px rgba(120, 53, 15, 0.15);
    margin-bottom: 40px;
    border: 3px solid var(--border-color);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 14px 24px;
    border: 3px solid var(--border-color);
    border-radius: 50px;
    font-size: 1.05rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
}

.btn-search {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.btn-search:hover {
    background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 20px;
    border: 3px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    font-weight: 600;
    color: var(--text-dark);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
}

.results-count {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.book-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(120, 53, 15, 0.15);
    transition: all 0.3s;
    border: 3px solid var(--border-color);
}

.book-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 35px rgba(217, 119, 6, 0.3);
    border-color: var(--primary-color);
}

.book-image {
    position: relative;
    height: 350px;
    overflow: hidden;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.available {
    background: var(--success-color);
    color: white;
}

.status-badge.unavailable {
    background: var(--danger-color);
    color: white;
}

.book-details {
    padding: 20px;
}

.book-details h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.book-details p {
    margin-bottom: 8px;
    color: var(--text-light);
}

.book-details .author,
.book-details .category,
.book-details .isbn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.book-details .description {
    margin-top: 10px;
    line-height: 1.6;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results p {
    font-size: 1.25rem;
}

/* Compact Footer */
.footer {
    background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
    color: white;
    padding: 20px 0;
    margin-top: 40px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.footer-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.footer-brand i {
    color: var(--accent-color);
    margin-right: 5px;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #d1d5db;
}

.footer-center {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-center a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-center a:hover {
    color: var(--accent-color);
}

.footer-center i {
    margin-right: 5px;
}

.footer-right {
    display: flex;
    align-items: center;
}

.social-links-compact {
    display: flex;
    gap: 10px;
}

.social-links-compact a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.3s;
    font-size: 1rem;
    text-decoration: none;
}

.social-links-compact a:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        display: none;
    }

    .nav.active {
        display: block;
    }
    
    .nav ul {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }
    
    .nav ul li {
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    
    .mobile-menu-btn {
        display: block;
        color: white;
    }
    
    .hero-carousel {
        height: 400px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .hero-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .hero-nav-btn.prev {
        left: 10px;
    }
    
    .hero-nav-btn.next {
        right: 10px;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-btn {
        display: none;
    }
    
    .book-card {
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .hero-carousel {
        height: 350px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .search-page h1 {
        font-size: 1.75rem;
    }
    
    .book-card {
        min-width: 250px;
    }
    
    .book-card img {
        height: 220px;
    }
    
    .info-card .stat-number {
        font-size: 2rem;
    }
}


/* Additional Enhancements */
.nav ul li a i {
    margin-right: 5px;
}

body {
    background: var(--bg-cream);
}

.search-page {
    background: var(--bg-cream);
}

.search-page h1 {
    color: var(--brown-dark);
    font-weight: 800;
}

/* Info Cards (Stats Style) */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 60px 0;
}

.info-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(120, 53, 15, 0.15);
    border: 3px solid var(--border-color);
    transition: all 0.3s;
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(217, 119, 6, 0.3);
    border-color: var(--primary-color);
}

.info-card i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.info-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--brown-dark);
    margin-bottom: 10px;
}

.info-card h3 {
    color: var(--text-dark);
    font-size: 1.3rem;
    font-weight: 600;
}

.info-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Quick Stats */
.quick-stats {
    background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
    color: white;
    padding: 50px 0;
    margin: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-item {
    padding: 20px;
}

.stat-item i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card, .book-item {
    animation: fadeInUp 0.5s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 9px;
}

::-webkit-scrollbar-track {
    background: var(--bg-cream);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brown-dark);
}


/* Compact Search Page */
.container-fluid {
    max-width: 98%;
    margin: 0 auto;
    padding: 0 15px;
}

/* Main Search Bar */
.main-search-bar {
    padding: 0;
    margin-bottom: 15px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(120, 53, 15, 0.1);
    transition: all 0.3s;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.2);
}

.search-icon {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 0 15px;
}

.main-search-input {
    flex: 1;
    border: none;
    padding: 12px 10px;
    font-size: 1.05rem;
    outline: none;
    background: transparent;
}

.main-search-input::placeholder {
    color: #9ca3af;
}



.btn-reset-main {
    background: #ef4444;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.3s, transform 0.3s;
    margin-left: 8px;
    white-space: nowrap;
    opacity: 1;
}

.btn-reset-main:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.btn-reset-main i {
    margin-right: 5px;
}

/* Prevent layout shift when reset button appears/disappears */
.search-input-wrapper {
    position: relative;
}

.btn-toggle-filters-small {
    background: #6b7280;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    margin-left: 8px;
    white-space: nowrap;
}

.btn-toggle-filters-small:hover {
    background: var(--brown-dark);
    transform: scale(1.05);
}

.btn-toggle-filters-small i {
    margin-right: 5px;
    transition: transform 0.3s;
}

/* Collapsible Filters Panel */
.filters-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-bottom: 15px;
    position: relative;
}

.filters-panel.show {
    max-height: 200px;
}

.close-filters-btn {
    display: none;
}

.filters-title {
    display: none;
    color: var(--brown-dark);
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.filters-note {
    background: #fef3c7;
    border-left: 4px solid var(--accent-color);
    padding: 12px 15px;
    margin: 0 0 20px 0;
    border-radius: 4px;
    color: var(--brown-dark);
    font-size: 0.9rem;
    line-height: 1.5;
}

.compact-search-form {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(120, 53, 15, 0.1);
    border: 2px solid var(--border-color);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: start;
}

.filter-item {
    width: 100%;
}

.compact-input, .compact-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background-color: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.compact-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d97706' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 35px;
    cursor: pointer;
}

.compact-input:focus, .compact-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.1);
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .compact-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .compact-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Compact DataTable */
.table-wrapper {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(120, 53, 15, 0.1);
    border: 2px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-cream);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--brown-dark);
}

.compact-table {
    width: 100% !important;
    font-size: 0.9rem;
}

.compact-table thead {
    background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
    color: white;
}

.compact-table thead th {
    padding: 10px 8px;
    font-weight: 600;
    text-align: left;
    border: none;
    font-size: 0.85rem;
}

.compact-table tbody td {
    padding: 8px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

.compact-table tbody tr:hover {
    background-color: var(--bg-cream);
}

.table-top, .table-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 10px;
}

/* Book Thumbnail */
.book-thumbnail {
    position: relative;
    width: 60px;
    height: 80px;
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.table-book-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.book-thumbnail:hover .table-book-img {
    transform: scale(1.1);
}

.view-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.book-thumbnail:hover .view-icon {
    opacity: 1;
}

.status-badge-table {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.status-available {
    background: #d1fae5;
    color: #065f46;
}

.status-not-available {
    background: #ffdada !important;
    color: #dc2626 !important;
}

.status-not-available i {
    color: #dc2626 !important;
}

.btn-action {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-action:hover {
    background: var(--brown-dark);
    transform: scale(1.1);
}

/* Gallery Popup */
.gallery-popup {
    display: none;
    position: fixed;
    z-index: 9998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}

.gallery-popup-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.gallery-popup-content h3 {
    color: var(--brown-dark);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 35px;
    font-weight: bold;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.3s;
}

.close-popup:hover {
    color: var(--primary-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    font-size: 2rem;
    margin-bottom: 5px;
}

/* Fullscreen Viewer */
.fullscreen-viewer {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.98);
    align-items: center;
    justify-content: center;
}

.viewer-content {
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fullscreenImage {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.close-viewer {
    position: fixed;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s;
}

.close-viewer:hover {
    color: var(--accent-color);
}

.viewer-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10000;
}

.viewer-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.viewer-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.image-counter {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 10000;
}

.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s;
    z-index: 10000;
}

.nav-btn:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 30px;
}

.next-btn {
    right: 30px;
}

/* DataTables Custom Styling */
.dataTables_wrapper .dataTables_length select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin: 0 5px;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-left: 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 8px 15px;
    margin: 0 3px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-dark) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-cream) !important;
    color: var(--text-dark) !important;
    border-color: var(--primary-color);
}

/* Tablet Responsive (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
    }
    
    .container-fluid {
        max-width: 98%;
    }
    
    .hero-carousel {
        height: 450px;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .info-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .compact-table {
        font-size: 0.85rem;
    }
    
    .compact-table thead th {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    .compact-table tbody td {
        padding: 6px;
    }
}

/* Mobile Responsive (max-width: 768px) */
@media (max-width: 768px) {
    /* Nav Backdrop */
    .nav-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(2px);
    }
    
    .nav-backdrop.active {
        display: block;
        opacity: 1;
    }
    
    /* Header */
    .nav {
        position: fixed;
        top: 0;
        right: -320px;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -6px 0 30px rgba(0,0,0,0.5);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
        z-index: 1001;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .nav::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
        z-index: 0;
    }

    .nav.active {
        right: 0;
        box-shadow: -8px 0 40px rgba(0,0,0,0.7);
    }
    
    .nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
        position: relative;
        z-index: 1;
    }
    
    .nav-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        color: white;
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .nav-logo-img {
        width: 35px;
        height: 35px;
        object-fit: contain;
    }
    
    .nav-logo i {
        font-size: 1.8rem;
        color: var(--accent-color);
    }
    
    .close-nav-btn {
        background: rgba(255, 255, 255, 0.2);
        color: white;
        border: 2px solid white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s;
    }
    
    .close-nav-btn:hover {
        background: var(--danger-color);
        transform: scale(1.1);
    }
    
    .nav ul {
        flex-direction: column;
        padding: 20px;
        gap: 0;
    }
    
    .nav ul li {
        padding: 0;
        border-bottom: 1px solid #e5e7eb;
        opacity: 0;
        transform: translateX(30px);
        transition: all 0.3s ease;
    }
    
    .nav.active ul li {
        opacity: 1;
        transform: translateX(0);
    }
    
    .nav.active ul li:nth-child(1) { transition-delay: 0.1s; }
    .nav.active ul li:nth-child(2) { transition-delay: 0.15s; }
    .nav.active ul li:nth-child(3) { transition-delay: 0.2s; }
    .nav.active ul li:nth-child(4) { transition-delay: 0.25s; }
    .nav.active ul li:nth-child(5) { transition-delay: 0.3s; }
    
    .nav ul li a {
        display: block;
        padding: 18px 15px;
        font-size: 1.1rem;
        transition: all 0.3s ease;
        color: var(--text-dark);
    }
    
    .nav ul li a:hover {
        background: var(--bg-cream);
        padding-left: 25px;
        color: var(--primary-color);
    }
    
    .nav ul li a i {
        margin-right: 10px;
        color: var(--primary-color);
    }
    
    .mobile-menu-btn {
        display: block;
        color: white;
        z-index: 999;
        position: relative;
        transition: opacity 0.3s ease;
    }
    
    .mobile-menu-btn i {
        transition: transform 0.3s ease;
    }
    
    .mobile-menu-btn:active i {
        transform: rotate(90deg);
    }
    
    .logo a {
        font-size: 1.3rem;
    }
    
    .logo-img {
        width: 38px;
        height: 38px;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    /* Hero */
    .hero-carousel {
        height: 400px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .hero-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .hero-nav-btn.prev {
        left: 10px;
    }
    
    .hero-nav-btn.next {
        right: 10px;
    }
    
    /* Info Cards */
    .info-cards {
        grid-template-columns: 1fr;
        padding: 40px 0;
    }
    
    .info-card {
        padding: 25px 20px;
    }
    
    /* Carousels */
    .carousel-btn {
        display: none;
    }
    
    .book-card {
        min-width: 250px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Search Page */
    .main-search-bar {
        padding: 0px;
    }
    
    .search-input-wrapper {
        border-radius: 12px;
        padding: 8px;
    }
    
    .search-icon {
        font-size: 1.2rem;
        margin: 0 12px;
    }
    
    .main-search-input {
        flex: 1;
        padding: 14px 12px;
        font-size: 1rem;
        border-radius: 8px;
    }
    

    
    .btn-reset-main {
        width: 50px;
        height: 50px;
        padding: 0;
        font-size: 1.2rem;
        margin-left: 8px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-toggle-filters-small {
        width: 50px;
        height: 50px;
        padding: 0;
        font-size: 1.2rem;
        margin-left: 8px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Filters Backdrop */
    .filters-backdrop {
        display: none;
    }
    
    /* Collapsible Filters on Mobile */
    .filters-panel {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        margin-bottom: 15px;
        position: relative;
        background: white;
        border-radius: 10px;
    }
    
    .filters-panel.show {
        max-height: 800px;
    }
    
    .filters-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(135deg, var(--brown-dark), var(--secondary-color));
        padding: 15px 20px;
        border-radius: 10px 10px 0 0;
    }
    
    .filters-title {
        display: block;
        color: white;
        margin: 0;
        font-size: 1.2rem;
    }
    
    .close-filters-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.2);
        color: white;
        border: 2px solid white;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 1.1rem;
        transition: all 0.3s;
        flex-shrink: 0;
    }
    
    .close-filters-btn:hover {
        background: var(--danger-color);
        transform: scale(1.1);
    }
    
    .filters-note {
        display: block;
        background: #fef3c7;
        border-left: 4px solid var(--accent-color);
        padding: 12px 15px;
        margin: 0 0 15px 0;
        border-radius: 4px;
        color: var(--brown-dark);
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .filters-note i {
        color: var(--primary-color);
        margin-right: 8px;
    }
    
    .compact-search-form {
        padding: 15px;
        border: 2px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 10px 10px;
    }
    
    .filters-row {
        display: flex;
        flex-direction: column;
        gap: 18px;
    }
    
    .filter-item {
        position: relative;
    }
    
    .filter-item::before {
        content: attr(data-label);
        position: absolute;
        top: -8px;
        left: 12px;
        background: white;
        padding: 0 8px;
        font-size: 0.75rem;
        color: var(--primary-color);
        font-weight: 600;
        z-index: 1;
    }
    
    .compact-input, .compact-select {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 16px 15px;
        border-radius: 10px;
        border: 2px solid var(--border-color);
        background: white;
        transition: all 0.3s;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .compact-select {
        padding-right: 40px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23d97706' d='M8 12L2 6h12z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px;
    }
    
    .compact-input:focus, .compact-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
        transform: translateY(-2px);
    }
    
    .filters-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .compact-input, .compact-select {
        font-size: 1rem;
        padding: 12px 15px;
        border-radius: 8px;
    }
    
    /* DataTable */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .compact-table {
        font-size: 0.75rem;
        min-width: 800px;
    }
    
    .compact-table thead th {
        padding: 8px 4px;
        font-size: 0.7rem;
    }
    
    .compact-table tbody td {
        padding: 6px 4px;
    }
    
    .book-thumbnail {
        width: 50px;
        height: 70px;
    }
    
    .status-badge-table {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .btn-action {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    /* Gallery */
    .gallery-popup-content {
        width: 95%;
        padding: 20px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .viewer-controls {
        bottom: 15px;
        gap: 8px;
    }
    
    .viewer-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .nav-btn {
        width: 45px;
        height: 45px;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    /* Footer */
    .footer {
        padding: 15px 0;
        margin-top: 30px;
    }
    
    .footer-compact {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 5px 0;
    }
    
    .footer-left {
        align-items: center;
        gap: 3px;
    }
    
    .footer-brand {
        font-size: 1rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
    }
    
    .footer-center {
        flex-direction: row;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-center a {
        font-size: 0.85rem;
    }
    
    .social-links-compact {
        gap: 8px;
    }
    
    .social-links-compact a {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    /* Hero */
    .hero-carousel {
        height: 350px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    /* Info Cards */
    .info-card .stat-number {
        font-size: 2rem;
    }
    
    .info-card h3 {
        font-size: 1.1rem;
    }
    
    /* Carousels */
    .section-title {
        font-size: 1.5rem;
    }
    
    .book-card {
        min-width: 250px;
    }
    
    .book-card img {
        height: 220px;
    }
    
    /* Search */
    .search-icon {
        font-size: 1.1rem;
        margin: 0 10px;
    }
    
    .main-search-input {
        font-size: 0.95rem;
        padding: 10px 8px;
    }
    
    .btn-reset-main, .btn-toggle-filters-small {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .search-page h1 {
        font-size: 1.75rem;
    }
    
    /* DataTable */
    .compact-table {
        font-size: 0.7rem;
    }
    
    .book-thumbnail {
        width: 45px;
        height: 60px;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .close-popup, .close-viewer {
        font-size: 30px;
        top: 10px;
        right: 15px;
    }
    
    .image-counter {
        font-size: 0.95rem;
        padding: 8px 15px;
    }
    
    /* Search */
    .search-input-wrapper {
        border-radius: 10px;
    }
    
    .main-search-input {
        padding: 12px 10px;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    .btn-reset-main, .btn-toggle-filters-small {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .filters-panel.show {
        max-height: 900px;
    }
    
    .filters-header {
        padding: 12px 15px;
    }
    
    .filters-title {
        font-size: 1.1rem;
    }
    
    .close-filters-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .filters-note {
        font-size: 0.8rem;
        padding: 10px 12px;
        margin-bottom: 12px;
    }
    
    .compact-search-form {
        padding: 12px;
    }
    
    .filters-row {
        gap: 14px;
    }
    
    .compact-input, .compact-select {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer {
        padding: 12px 0;
    }
    
    .footer-compact {
        gap: 10px;
    }
    
    .footer-brand {
        font-size: 0.95rem;
    }
    
    .footer-brand i {
        font-size: 1rem;
    }
    
    .footer-copyright {
        font-size: 0.75rem;
    }
    
    .footer-center {
        gap: 12px;
    }
    
    .footer-center a {
        font-size: 0.8rem;
    }
    
    .social-links-compact {
        gap: 6px;
    }
    
    .social-links-compact a {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}
    
    .filters-row {
        flex-direction: column;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .table-wrapper {
        padding: 10px;
        overflow-x: auto;
    }
    
    .gallery-popup-content {
        width: 95%;
        padding: 20px;
    }
    
    .viewer-controls {
        bottom: 15px;
        gap: 8px;
    }
    
    .viewer-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .nav-btn {
        width: 45px;
        height: 45px;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
}
