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

/* Prevent zoom on mobile */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2D3748;
    background-color: #FAFAFA;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

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

/* Navigation */
.navbar {
    background: #FFFFFF;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 16px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
}

.nav-container > * {
    flex-shrink: 0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #2D3748;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

/* Navbar Search */
.nav-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.nav-search .search-container {
    display: flex;
    width: 100%;
    background: #FFFFFF;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-search .search-container:focus-within {
    border-color: #38A169;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.2);
}

.nav-search .search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.nav-search .search-input::placeholder {
    color: #A0AEC0;
}

.nav-search .search-btn {
    padding: 12px 16px;
    background: #38A169;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.nav-search .search-btn:hover {
    background: #2F855A;
}

.nav-menu {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-shrink: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #4A5568;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.nav-link:hover {
    background: #F7FAFC;
    color: #2D3748;
}

.nav-text {
    display: none;
}

@media (min-width: 1024px) {
    .nav-text {
        display: inline;
    }
    
    /* Fix sub-dropdown positioning for icon-only mode */
    .sub-dropdown-menu {
        left: 0;
        top: 100%;
        margin-left: 0;
        margin-top: 8px;
        transform: translateY(-10px);
        -webkit-transform: translateY(-10px);
    }
    
    .sub-dropdown.active .sub-dropdown-menu {
        transform: translateY(0);
        -webkit-transform: translateY(0);
    }
    
    /* Ensure sub-dropdown container has proper positioning */
    .sub-dropdown {
        position: relative;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Dropdown Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10000;
    margin-top: 8px;
    -webkit-transform: translateY(-10px);
    -webkit-transition: all 0.2s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    -webkit-transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #4A5568;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    -webkit-transition: background 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.dropdown-item:hover {
    background: #F7FAFC;
    color: #2D3748;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

/* Nested Dropdown Styles */
.filters-menu {
    min-width: 220px;
}

.sub-dropdown {
    position: relative;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.sub-dropdown-toggle {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.sub-dropdown-toggle .fa-chevron-right {
    transition: transform 0.2s ease;
    -webkit-transition: -webkit-transform 0.2s ease;
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
}

.sub-dropdown.active .sub-dropdown-toggle .fa-chevron-right {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
}

.sub-dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    z-index: 10001;
    margin-left: 8px;
    -webkit-transform: translateX(-10px);
    -webkit-transition: all 0.2s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.sub-dropdown.active .sub-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    -webkit-transform: translateX(0);
}

.sub-dropdown-menu .dropdown-item {
    border-radius: 0;
}

.sub-dropdown-menu .dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.sub-dropdown-menu .dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

/* Hero Banner */
.hero-banner {
    padding: 20px 0;
    background: linear-gradient(135deg, #F7FAFC 0%, #EDF2F7 100%);
    text-align: center;
    border-bottom: 1px solid #E2E8F0;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 24px;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 8px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 14px;
    color: #718096;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Removed search-section styles since CTA button is no longer in hero */

/* Old standalone search styles removed - now using nav-search */

/* CTA button styles removed - using floating button instead */

@media (min-width: 768px) {
    .search-section {
        flex-direction: row;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 48px;
    }
}

/* Old filter styles removed - now using dropdown navigation */

.books-section {
    padding: 60px 0;
    position: relative;
    z-index: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: #2D3748;
    margin: 0;
    letter-spacing: -0.5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.sort-filter {
    position: relative;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    color: #4A5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: #EDF2F7;
    border-color: #CBD5E0;
}

.sort-btn.active {
    background: #38A169;
    color: #FFFFFF;
    border-color: #38A169;
}

.sort-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: 8px;
}

.sort-filter.active .sort-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    display: block;
    padding: 12px 16px;
    color: #4A5568;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.sort-option:hover {
    background: #F7FAFC;
    color: #2D3748;
}

.sort-option:first-child {
    border-radius: 12px 12px 0 0;
}

.sort-option:last-child {
    border-radius: 0 0 12px 12px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 40px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 32px;
    }
}

.book-card {
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.book-image {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #F7FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    background: #FFFFFF;
    padding: 8px;
}

/* Style for fallback book cover images */
.book-image img[src*="data:image/svg+xml"] {
    background: linear-gradient(135deg, #4A5568 0%, #2D3748 100%);
    border: 1px solid #718096;
    padding: 0;
}

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

.wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: #A0AEC0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.wishlist-btn:hover {
    background: #FFFFFF;
    color: #E53E3E;
    transform: scale(1.1);
}

.wishlist-btn.active {
    color: #E53E3E;
}

.book-info {
    padding: 20px;
}

.book-title {
    font-size: 18px;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 14px;
    color: #718096;
    margin-bottom: 12px;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.book-rating i {
    font-size: 14px;
    color: #F6AD55;
}

.book-rating .fas.fa-star,
.book-rating .fas.fa-star-half-alt {
    color: #F6AD55;
}

.book-rating .far.fa-star {
    color: #E2E8F0;
}

.rating-text {
    font-size: 12px;
    color: #718096;
    font-weight: 400;
    margin-top: 4px;
}

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

.condition-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.condition-badge.like-new {
    background: #C6F6D5;
    color: #22543D;
}

.condition-badge.very-good {
    background: #BEE3F8;
    color: #2A4365;
}

.condition-badge.good {
    background: #FEEBC8;
    color: #744210;
}

.book-price {
    font-size: 18px;
    font-weight: 700;
    color: #38A169;
}

.book-release-date {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #718096;
    font-weight: 400;
}

.book-release-date i {
    font-size: 11px;
    color: #A0AEC0;
}

/* Loading and Error States */
/* Old book animation removed - replaced with falling books */

.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #E53E3E;
    font-size: 16px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 16px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.fab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: #38A169;
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(56, 161, 105, 0.3);
}

.fab-btn:hover {
    background: #2F855A;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(56, 161, 105, 0.4);
}

@media (min-width: 768px) {
    .fab {
        display: none;
    }
}

@media (min-width: 651px) and (max-width: 1023px) {
    .mobile-menu-toggle {
        display: none;
    }
    
    .nav-item {
        display: block;
    }
    
    /* Fix sub-dropdown positioning for icon-only mode (651px-1023px) */
    .sub-dropdown-menu {
        left: 0;
        top: 100%;
        margin-left: 0;
        margin-top: 0;
        transform: translateY(-10px);
        -webkit-transform: translateY(-10px);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        pointer-events: auto;
    }
    
    .sub-dropdown.active .sub-dropdown-menu {
        transform: translateY(0);
        -webkit-transform: translateY(0);
    }
    
    /* Ensure sub-dropdown container has proper positioning */
    .sub-dropdown {
        position: relative;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* Ensure dropdown menu has proper z-index */
    .dropdown-menu {
        z-index: 10000;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

@media (max-width: 650px) {
    .nav-container {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
        position: relative;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    }
    
    .nav-container.mobile-menu-active {
        gap: 8px;
    }
    
    .nav-brand {
        order: 1;
        -webkit-box-ordinal-group: 1;
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-align: center;
        -webkit-align-items: center;
        align-items: center;
        -webkit-box-pack: justify;
        -webkit-justify-content: space-between;
        justify-content: space-between;
        width: 100%;
        min-height: 44px;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -webkit-flex-direction: row;
        flex-direction: row;
    }
    
    .logo {
        font-size: 24px;
        margin-bottom: 0;
        font-weight: 700;
        flex-shrink: 0;
    }
    
    .nav-brand .mobile-menu-toggle {
        display: block !important;
        z-index: 1000;
        position: static;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        margin-left: auto;
        font-size: 24px;
        background: none;
        border: none;
        color: #4A5568;
        cursor: pointer;
        padding: 8px;
        border-radius: 4px;
        transition: background-color 0.3s ease;
        -webkit-appearance: none;
        appearance: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-align-self: center;
        align-self: center;
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
        min-width: 44px;
        min-height: 44px;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .nav-brand .mobile-menu-toggle:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Safari-specific fixes */
    @supports (-webkit-appearance: none) {
        .nav-brand .mobile-menu-toggle {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            pointer-events: auto !important;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .nav-brand {
            display: -webkit-box !important;
            display: -webkit-flex !important;
            display: flex !important;
        }
        
        .dropdown-menu {
            -webkit-transform: translateY(-10px);
            transform: translateY(-10px);
        }
        
        .dropdown.active .dropdown-menu {
            -webkit-transform: translateY(0);
            transform: translateY(0);
        }
        
        .filter-section-toggle {
            -webkit-appearance: none;
            appearance: none;
            -webkit-tap-highlight-color: transparent;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .filter-chevron {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
            display: none;
        }
        
        .filter-section.active .filter-chevron {
            -webkit-transform: translateZ(0) rotate(90deg);
            transform: translateZ(0) rotate(90deg);
        }
        
        .filter-toggle {
            -webkit-appearance: none;
            appearance: none;
            -webkit-tap-highlight-color: transparent;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .filter-toggle.active .filter-chevron {
            -webkit-transform: translateZ(0) rotate(90deg);
            transform: translateZ(0) rotate(90deg);
        }
        
        .sort-btn {
            -webkit-appearance: none;
            appearance: none;
            -webkit-tap-highlight-color: transparent;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .sort-dropdown {
            -webkit-transform: translateY(-10px);
            transform: translateY(-10px);
        }
        
        .sort-filter.active .sort-dropdown {
            -webkit-transform: translateY(0);
            transform: translateY(0);
        }
        
        .sub-dropdown-menu {
            -webkit-transform: translateX(-10px);
            transform: translateX(-10px);
        }
        
        .sub-dropdown.active .sub-dropdown-menu {
            -webkit-transform: translateX(0);
            transform: translateX(0);
        }
        
        .sub-dropdown {
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }
        
        .sub-dropdown-menu {
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            pointer-events: auto;
        }
    }
    
    .nav-search {
        order: 3;
        margin: 0;
        max-width: none;
        width: 100%;
        flex: none;
        -webkit-box-ordinal-group: 3;
        -webkit-box-flex: 0;
        min-width: 100%;
        flex-shrink: 0;
    }
    
    .nav-menu {
        order: 4;
        display: none;
        -webkit-box-ordinal-group: 4;
    }
    
    .nav-search .search-container {
        border-radius: 25px;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        width: 100%;
        min-width: 100%;
        flex-shrink: 0;
    }
    
    .nav-search .search-input {
        padding: 10px 14px;
        font-size: 14px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .nav-search .search-btn {
        padding: 10px 14px;
        font-size: 14px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .nav-menu {
        position: static;
        background: transparent;
        box-shadow: none;
        padding: 0;
        transform: none;
        opacity: 1;
        visibility: visible;
        flex-direction: row;
        gap: 8px;
        z-index: auto;
        justify-content: flex-end;
        align-items: center;
        flex-shrink: 0;
    }
    
    .nav-menu.active {
        position: static;
        background: #FFFFFF;
        box-shadow: none;
        padding: 0;
        flex-direction: column;
        gap: 0;
        z-index: auto;
        transform: none;
        opacity: 1;
        visibility: visible;
        order: unset;
        height: auto;
        overflow: visible;
        border-bottom: none;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        margin-top: 0;
        width: 100% !important;
    }
    
    .nav-menu.active .nav-item {
        display: flex !important;
        width: 100% !important;
        margin-bottom: 0;
        border-bottom: 1px solid #E2E8F0;
    }
    
    .nav-menu.active .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-menu.active .nav-item:last-child {
        margin-bottom: 0;
    }
    
    .nav-item {
        width: auto;
        flex-shrink: 0;
    }
    
    .nav-link {
        width: auto;
        justify-content: center;
        padding: 8px;
        border-radius: 8px;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
    }
    
    .nav-menu.active .nav-link {
        width: 100% !important;
        justify-content: flex-start;
        padding: 12px 16px;
        border-radius: 0;
        min-height: 48px;
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 16px;
        font-weight: 500;
        background: transparent;
        transition: background-color 0.2s ease;
        -webkit-transition: background-color 0.2s ease;
    }
    
    .nav-menu.active .nav-link:hover {
        background-color: #F7FAFC;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-menu.active .nav-text {
        display: inline;
    }
    
    .nav-link i {
        font-size: 16px;
    }
    
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: #FFFFFF;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        min-width: 200px;
        margin-top: 8px;
        z-index: 1000;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* Mobile nested dropdown styles */
    .sub-dropdown-menu {
        position: absolute;
        left: 100%;
        top: 0;
        background: #FFFFFF;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        margin-left: 8px;
        border-radius: 8px;
        min-width: 200px;
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-10px);
        transition: all 0.2s ease;
        -webkit-transform: translateX(-10px);
        -webkit-transition: all 0.2s ease;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        pointer-events: auto;
    }
    
    .sub-dropdown.active .sub-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        -webkit-transform: translateX(0);
    }
    
    .sub-dropdown-toggle .fa-chevron-right {
        transition: transform 0.2s ease;
        -webkit-transition: transform 0.2s ease;
    }
    
    .sub-dropdown.active .sub-dropdown-toggle .fa-chevron-right {
        transform: rotate(90deg);
        -webkit-transform: rotate(90deg);
    }
    
    .hero-banner {
        padding: 16px 0;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .hero-subtitle {
        font-size: 13px;
    }
    
    .search-input,
    .search-btn {
        font-size: 14px;
    }
    
/* CTA button mobile styles removed */
    
    /* Old filter styles removed */
    
    .section-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }
    
    .section-title {
        font-size: 24px;
        flex-shrink: 0;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .sort-filter {
        margin-left: auto;
    }
    
    /* Grid styles handled by main breakpoints above */
    
    .book-image {
        height: 240px;
    }
    
    .book-info {
        padding: 16px;
    }
    
    .book-title {
        font-size: 16px;
    }
    
    .book-author {
        font-size: 12px;
    }
    
    .book-price {
        font-size: 16px;
    }
    
    .book-release-date {
        font-size: 11px;
        margin-top: 6px;
    }
    
    .rating-text {
        font-size: 11px;
        margin-top: 3px;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    textarea {
        font-size: 16px !important;
        transform: none !important;
    }
    
    /* Prevent horizontal scroll */
    .container {
        padding: 0 16px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Old filters section removed */
    
    /* Ensure filter groups have proper positioning context */
    /* Old filter group removed */
    

    
    .nav-container {
        padding: 0 16px;
    }
}

/* Focus styles for accessibility */
html {
    scroll-behavior: smooth;
}

button:focus,
input:focus,
a:focus {
    outline: 2px solid #38A169;
    outline-offset: 2px;
}

/* Loading state for search button */
.loading {
    pointer-events: none;
}

.dropdown-toggle .fa-chevron-down {
    transition: transform 0.2s ease;
}

.dropdown.active .dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

/* Desktop filters dropdown - hidden on mobile */
.filters-dropdown {
    display: block;
}

@media (max-width: 650px) {
    .filters-dropdown {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* Filter Toggle within dropdown */
.filters-menu .filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    -webkit-transition: background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.filters-menu .filter-toggle:hover {
    background-color: #F7FAFC;
}

.filters-menu .filter-toggle i:first-child {
    color: #4A5568;
    font-size: 12px;
    width: 16px;
}

.filters-menu .filter-toggle span {
    flex: 1;
}

.filters-menu .filter-chevron {
    color: #4A5568;
    font-size: 10px;
    transition: transform 0.2s ease;
    -webkit-transition: -webkit-transform 0.2s ease;
    display: none;
}

.filters-menu .filter-toggle.active .filter-chevron {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
}

/* Filter Options within dropdown */
.filters-menu .filter-options {
    display: none;
    flex-direction: column;
    background-color: #F7FAFC;
}

.filters-menu .filter-options.active {
    display: flex;
}

.filters-menu .filter-option {
    padding: 8px 16px 8px 32px;
    font-size: 13px;
    margin: 0;
}

/* Old filter group styles removed */

/* Scroll sentinel for infinite scroll */
.scroll-sentinel {
    height: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}

.scroll-sentinel::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #E2E8F0;
    border-top: 2px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scroll-sentinel.loading::after {
    opacity: 1;
}

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

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #4A5568;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    align-self: center;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}



.mobile-menu-toggle:hover {
    background: #F7FAFC;
    color: #2D3748;
}

.mobile-menu-toggle.active {
    background: #EDF2F7;
    color: #2D3748;
}

/* Additional mobile improvements */
@media (max-width: 767px) {
    /* Prevent text selection on buttons */
    button, .book-card {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Improve button touch targets */
    .search-btn {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Better spacing for mobile */
    .hero-content {
        padding: 0 16px;
    }
    
/* Removed search-section mobile styles */
    
    .search-container {
        width: 100%;
    }
    
    /* Improve book card touch interaction */
    .book-card {
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .book-card:active {
        transform: scale(0.98);
    }
    
    /* Old filter dropdown styles removed */
    
    /* Old filter dropdown styles removed */
    
    /* Additional mobile improvements for very small screens */
            @media (max-width: 480px) {
            .nav-menu.active {
                padding: 16px;
            }
            
            .section-title {
                font-size: 20px;
                line-height: 1.4;
            }
        
        .nav-menu.active .nav-link {
            padding: 12px;
        }
        /* Old filter styles removed */
        
        .nav-menu {
            gap: 4px;
        }
        
        .nav-link {
            padding: 6px;
            min-width: 32px;
            min-height: 32px;
        }
        
        .nav-link i {
            font-size: 14px;
        }
        
        .nav-search {
            max-width: 100%;
            width: 100%;
            min-width: 100%;
            flex-shrink: 0;
        }
        
        .nav-container {
            gap: 8px;
        }
    }
    
    /* Improve scroll performance */
    .books-grid {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Better loading spinner for mobile */
    .loading-spinner {
        width: 100%;
        height: 100vh;
        margin: 0;
        position: relative;
        perspective: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 400px;
        grid-column: 1 / -1; /* Span full width of grid */
    }
    
    /* Improve error message display */
    .error-message, .no-results {
        padding: 40px 20px;
        text-align: center;
        font-size: 16px;
    }
}

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

/* Breadcrumb Navigation */
.breadcrumb-container {
    background: #F7FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: 16px 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4A5568;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: #38A169;
}

.breadcrumb-item.active {
    color: #2D3748;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #CBD5E0;
    font-size: 12px;
}

/* Book Details Section */
.book-details-section {
    padding: 40px 0;
}

/* Details Book Card (Same as Search Grid) */
.details-book-card {
    max-width: 400px;
    margin: 0 auto 40px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    background: #FFFFFF;
    transition: all 0.3s ease;
}

.details-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.details-book-card .book-image {
    aspect-ratio: 1 / 1.4; /* Standard book cover aspect ratio */
    -webkit-aspect-ratio: 1 / 1.4;
    position: relative;
    background: #F7FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.details-book-card .book-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    background: #FFFFFF;
    padding: 12px;
}

.details-book-card .book-image img[src*="data:image/svg+xml"] {
    background: linear-gradient(135deg, #4A5568 0%, #2D3748 100%);
    border: 1px solid #718096;
    padding: 0;
}

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

.details-book-card .wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.details-book-card .wishlist-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.details-book-card .wishlist-btn.active {
    color: #E53E3E;
}

.details-book-card .wishlist-btn i {
    font-size: 16px;
    color: #4A5568;
}

.details-book-card .wishlist-btn.active i {
    color: #E53E3E;
}

.details-book-card .book-info {
    padding: 20px;
}

.details-book-card .book-title {
    font-size: 20px;
    font-weight: 700;
    color: #1A202C;
    line-height: 1.3;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.details-book-card .book-author {
    font-size: 14px;
    color: #4A5568;
    margin: 0 0 12px 0;
    font-weight: 500;
}

.details-book-card .book-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.details-book-card .book-rating i {
    color: #F6AD55;
    font-size: 14px;
}

.details-book-card .book-rating .rating-text {
    font-size: 12px;
    color: #718096;
    margin-left: 4px;
}

.details-book-card .book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.details-book-card .book-release-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #718096;
}

.details-book-card .book-release-date i {
    font-size: 10px;
}

.details-book-card .book-price {
    font-size: 16px;
    font-weight: 700;
    color: #38A169;
}

/* Book Details Content */
.book-details-content {
    max-width: 800px;
    margin: 0 auto;
}



/* Quick Info Cards */
.quick-info-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.info-card:hover {
    border-color: #38A169;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.1);
}

.info-card i {
    color: #38A169;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: #2D3748;
    font-weight: 600;
}

/* Book Info Section */
.book-info-section {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.book-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.book-title {
    font-size: 32px;
    font-weight: 700;
    color: #2D3748;
    line-height: 1.2;
    margin: 0;
}

.book-author {
    font-size: 18px;
    color: #4A5568;
    margin: 0;
}

/* Rating Section */
.book-rating-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #E2E8F0;
}

.rating-stars {
    display: flex;
    gap: 4px;
}

.rating-stars i {
    color: #F6AD55;
    font-size: 18px;
}

.rating-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rating-score {
    font-size: 16px;
    font-weight: 600;
    color: #2D3748;
}

.rating-count {
    font-size: 14px;
    color: #718096;
}

/* Pricing Section */
.book-pricing {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 16px 0;
}

.price-section, .condition-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-label, .condition-label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.price-value {
    font-size: 24px;
    font-weight: 700;
    color: #38A169;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 16px;
    padding: 24px 0;
    border-bottom: 1px solid #E2E8F0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: #4299E1;
    color: white;
}

.btn-primary:hover {
    background: #3182CE;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #F7FAFC;
    color: #4A5568;
    border: 1px solid #E2E8F0;
}

.btn-secondary:hover {
    background: #EDF2F7;
    border-color: #CBD5E0;
}

/* Book Description */
.book-description {
    padding: 24px 0;
}

.section-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: #2D3748;
    margin: 0 0 16px 0;
}

.description-content {
    line-height: 1.6;
    color: #4A5568;
    font-size: 16px;
}

.loading-text {
    color: #A0AEC0;
    font-style: italic;
}

/* Book Details Sections */
.book-details {
    margin-top: 32px;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section .section-subtitle {
    margin-bottom: 12px;
    color: #2D3748;
    font-weight: 600;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #F7FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    color: #4A5568;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag:hover {
    background: #EDF2F7;
    border-color: #CBD5E0;
    color: #2D3748;
}

.tag.genre {
    background: #EBF8FF;
    border-color: #90CDF4;
    color: #2B6CB0;
}

.tag.genre:hover {
    background: #BEE3F8;
    border-color: #63B3ED;
}

.tag.place {
    background: #F0FFF4;
    border-color: #9AE6B4;
    color: #22543D;
}

.tag.place:hover {
    background: #C6F6D5;
    border-color: #68D391;
}

.tag.person {
    background: #FAF5FF;
    border-color: #D6BCFA;
    color: #553C9A;
}

.tag.person:hover {
    background: #E9D8FD;
    border-color: #B794F4;
}

.tag.time {
    background: #FFFBEB;
    border-color: #F6E05E;
    color: #975A16;
}

.tag.time:hover {
    background: #FEF5E7;
    border-color: #ECC94B;
}

.no-data {
    color: #A0AEC0;
    font-style: italic;
    font-size: 14px;
}

/* Reviews Section */
.reviews-section {
    padding: 60px 0;
    background: #F7FAFC;
}

.reviews-filter {
    display: flex;
    gap: 12px;
}

.reviews-filter .filter-btn {
    padding: 8px 16px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    color: #4A5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reviews-filter .filter-btn:hover {
    border-color: #38A169;
    color: #38A169;
}

.reviews-filter .filter-btn.active {
    background: #38A169;
    color: #FFFFFF;
    border-color: #38A169;
}

.reviews-container {
    margin-top: 32px;
}

/* Review Card */
.review-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #38A169;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 16px;
}

.reviewer-info {
    flex: 1;
}

.reviewer-name {
    font-size: 14px;
    font-weight: 600;
    color: #2D3748;
    margin: 0;
}

.review-date {
    font-size: 12px;
    color: #718096;
    margin: 0;
}

.review-rating {
    display: flex;
    gap: 2px;
}

.review-rating i {
    color: #F6AD55;
    font-size: 14px;
}

.review-content {
    color: #4A5568;
    line-height: 1.6;
    font-size: 14px;
}



/* Responsive Design for Book Details */
@media (max-width: 1024px) {
    .details-book-card {
        max-width: 350px;
    }
    
    .details-book-card .book-image {
        aspect-ratio: 1 / 1.4; /* Standard book cover aspect ratio */
        -webkit-aspect-ratio: 1 / 1.4;
    }
}

@media (max-width: 768px) {
    .details-book-card {
        max-width: 100%;
        margin: 0 16px 24px;
    }
    
    .details-book-card .book-image {
        aspect-ratio: 1 / 1.4; /* Standard book cover aspect ratio */
        -webkit-aspect-ratio: 1 / 1.4;
    }
    
    .details-book-card .book-title {
        font-size: 18px;
    }
    
    .details-book-card .book-author {
        font-size: 13px;
    }
    
    .book-title {
        font-size: 22px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        -webkit-hyphens: auto;
        hyphens: auto;
    }
    
    .book-author {
        font-size: 15px;
        line-height: 1.4;
    }
    
    .book-pricing {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    }
    
    .action-buttons {
        flex-direction: column;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    }
    
    .reviews-filter {
        flex-wrap: wrap;
    }
    
    .quick-info-cards {
        flex-direction: column;
        gap: 8px;
        overflow-x: visible;
        padding-bottom: 0;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    }
    
    .info-card {
        min-width: auto;
        flex-shrink: 0;
        -webkit-box-flex: 0;
    }
    
    .book-details {
        margin-top: 20px;
    }
    
    .detail-section {
        margin-bottom: 16px;
    }
    
    .tags-container {
        gap: 6px;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
    }
    
    .tag {
        padding: 4px 10px;
        font-size: 12px;
        -webkit-box-flex: 0;
    }
    
    .book-info-section {
        padding: 0 16px;
    }
    
    .book-description {
        padding: 0 16px;
    }
    
    .book-details {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .details-book-card {
        max-width: 100%;
        margin: 0 12px 20px;
    }
    
    .details-book-card .book-image {
        aspect-ratio: 1 / 1.4; /* Standard book cover aspect ratio */
        -webkit-aspect-ratio: 1 / 1.4;
    }
    
    .details-book-card .book-title {
        font-size: 16px;
    }
    
    .details-book-card .book-author {
        font-size: 12px;
    }
    
    .book-details-section {
        padding: 16px 0;
    }
    
    .book-details-grid {
        gap: 20px;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
    }
    
    .book-image-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-box-align: center;
    }
    
    .book-image-container {
        max-width: 200px;
        width: 100%;
        margin: 0 auto;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        aspect-ratio: 1 / 1.4; /* Standard book cover aspect ratio */
        -webkit-aspect-ratio: 1 / 1.4;
    }
    
    .book-cover {
        width: 100%;
        height: 100%;
        object-fit: contain;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .book-title {
        font-size: 18px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        -webkit-hyphens: auto;
        hyphens: auto;
    }
    
    .book-author {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .book-info-section {
        gap: 20px;
        padding: 0 16px;
    }
    
    .book-header {
        gap: 12px;
    }
    
    .quick-info-cards {
        flex-direction: column;
        gap: 8px;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    }
    
    .info-card {
        padding: 12px;
        min-width: auto;
        -webkit-box-flex: 0;
    }
    
    .action-buttons {
        gap: 8px;
        flex-direction: column;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        -webkit-box-flex: 0;
    }
    
    .book-description {
        padding: 0 16px;
    }
    
    .description-content {
        font-size: 14px;
        line-height: 1.5;
        -webkit-hyphens: auto;
        hyphens: auto;
    }
    
    .book-details {
        padding: 0 16px;
    }
    
    .detail-section {
        margin-bottom: 16px;
    }
    
    .tags-container {
        gap: 4px;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
    }
    
    .tag {
        padding: 6px 8px;
        font-size: 11px;
        -webkit-box-flex: 0;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 300px;
    padding: 40px 20px;
    min-height: 200px;
}

/* Loading Animation - Books Falling Over */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    perspective: 1000px;
}

.books-stack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.book-item {
    width: 60px;
    height: 8px;
    background: #2D3748;
    border-radius: 2px;
    position: relative;
    transform-origin: bottom center;
    animation: fall 1.5s ease-in-out infinite;
}

.book-item:nth-child(1) {
    animation-delay: 0s;
    background: #4A5568;
}

.book-item:nth-child(2) {
    animation-delay: 0.2s;
    background: #2D3748;
}

.book-item:nth-child(3) {
    animation-delay: 0.4s;
    background: #1A202C;
}

.book-item:nth-child(4) {
    animation-delay: 0.6s;
    background: #4A5568;
}

.book-item:nth-child(5) {
    animation-delay: 0.8s;
    background: #2D3748;
}

.book-item:nth-child(6) {
    animation-delay: 1s;
    background: #1A202C;
}

@keyframes fall {
    0% {
        transform: rotateX(0deg) translateY(0);
        opacity: 1;
    }
    20% {
        transform: rotateX(0deg) translateY(0);
        opacity: 1;
    }
    40% {
        transform: rotateX(15deg) translateY(0);
        opacity: 1;
    }
    60% {
        transform: rotateX(45deg) translateY(10px);
        opacity: 0.8;
    }
    80% {
        transform: rotateX(75deg) translateY(20px);
        opacity: 0.6;
    }
    100% {
        transform: rotateX(90deg) translateY(30px);
        opacity: 0.3;
    }
}

/* Safari compatibility */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .book-item {
        -webkit-transform-origin: bottom center;
        transform-origin: bottom center;
        -webkit-animation: fall 1.5s ease-in-out infinite;
        animation: fall 1.5s ease-in-out infinite;
    }
    
    @-webkit-keyframes fall {
        0% {
            -webkit-transform: rotateX(0deg) translateY(0);
            transform: rotateX(0deg) translateY(0);
            opacity: 1;
        }
        20% {
            -webkit-transform: rotateX(0deg) translateY(0);
            transform: rotateX(0deg) translateY(0);
            opacity: 1;
        }
        40% {
            -webkit-transform: rotateX(15deg) translateY(0);
            transform: rotateX(15deg) translateY(0);
            opacity: 1;
        }
        60% {
            -webkit-transform: rotateX(45deg) translateY(10px);
            transform: rotateX(45deg) translateY(10px);
            opacity: 0.8;
        }
        80% {
            -webkit-transform: rotateX(75deg) translateY(20px);
            transform: rotateX(75deg) translateY(20px);
            opacity: 0.6;
        }
        100% {
            -webkit-transform: rotateX(90deg) translateY(30px);
            transform: rotateX(90deg) translateY(30px);
            opacity: 0.3;
        }
    }
}

/* Individual page animations */
/* Page animations removed - simplified to book opening only */




/* Safari specific fixes for loading animation */


















/* Old keyframes removed - simplified to book opening only */

.loading-title {
    font-size: 24px;
    font-weight: 600;
    color: #2D3748;
    margin-bottom: 8px;
}

.loading-subtitle {
    font-size: 16px;
    color: #718096;
    line-height: 1.5;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1A202C;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #F7FAFC;
    color: #2D3748;
}

/* Auth Form Styles */
.auth-form {
    padding: 0 24px 24px 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2D3748;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #4299E1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-group input.error {
    border-color: #E53E3E;
}

.error-message {
    color: #E53E3E;
    font-size: 14px;
    margin-top: 4px;
}

/* Social Login Styles */
.social-login {
    padding: 0 24px 24px 24px;
}

.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E2E8F0;
}

.divider span {
    background: white;
    padding: 0 16px;
    color: #718096;
    font-size: 14px;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    background: white;
    color: #2D3748;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.social-btn:hover {
    border-color: #CBD5E0;
    background: #F7FAFC;
}

.google-btn:hover {
    border-color: #4285F4;
    background: #F8F9FA;
}

.apple-btn:hover {
    border-color: #000;
    background: #F8F9FA;
}

.facebook-btn:hover {
    border-color: #1877F2;
    background: #F0F2F5;
}

/* Form Toggle */
.form-toggle {
    padding: 24px;
    text-align: center;
    border-top: 1px solid #E2E8F0;
    background: #F7FAFC;
    border-radius: 0 0 12px 12px;
}

.form-toggle span {
    color: #718096;
    font-size: 14px;
}

.form-toggle button {
    background: none;
    border: none;
    color: #4299E1;
    font-weight: 600;
    cursor: pointer;
    margin-left: 8px;
    font-size: 14px;
}

.form-toggle button:hover {
    text-decoration: underline;
}

/* User Menu Styles */
.user-menu-container {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
    font-family: inherit;
    font-size: inherit;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.user-menu-container.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #2D3748;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.user-dropdown a:hover {
    background: #F7FAFC;
}

.user-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-separator {
    height: 1px;
    background: #E2E8F0;
    margin: 4px 0;
}

/* Mobile styles for user menu */
@media (max-width: 650px) {
    .user-menu-container {
        width: 100%;
    }
    
    .user-menu-toggle {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
    }
    
    .user-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid #E2E8F0;
        border-radius: 0;
        margin-top: 0;
        background: transparent;
    }
    
    .user-menu-container.active .user-dropdown {
        display: block;
    }
    
    .user-menu-container:not(.active) .user-dropdown {
        display: none;
    }
    
    .user-dropdown a {
        padding: 12px 16px;
        border-radius: 0;
    }
    
    .dropdown-separator {
        margin: 0;
    }
    
    /* Hide desktop user menu on mobile */
    .user-menu-container {
        display: none !important;
    }
    
    /* Show mobile profile/logout links when authenticated */
    .mobile-profile-link,
    .mobile-logout-link {
        display: block !important;
    }
    
    /* Hide login nav item when authenticated */
    .nav-menu.active .login-nav-item.hidden {
        display: none !important;
    }
    
    /* Hide login nav item when authenticated (more specific) */
    .nav-menu.active .nav-item#login-nav-item.hidden {
        display: none !important;
    }
    
    /* Hide user menu container on mobile when authenticated */
    .nav-menu.active .nav-item#user-menu {
        display: none !important;
    }
    
    /* Ensure mobile profile/logout links are visible when authenticated */
    .nav-menu.active .nav-item.mobile-profile-link:not(.hidden),
    .nav-menu.active .nav-item.mobile-logout-link:not(.hidden) {
        display: block !important;
    }
    
    /* Force hide login button when authenticated on mobile */
    .nav-menu.active .nav-item#login-nav-item.hidden {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Additional aggressive hiding for mobile authenticated state */
    .nav-menu.active .nav-item#login-nav-item.hidden,
    .nav-menu.active .nav-item#user-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* Ensure mobile profile/logout links are always visible when not hidden */
    .nav-menu.active .nav-item.mobile-profile-link:not(.hidden),
    .nav-menu.active .nav-item.mobile-logout-link:not(.hidden) {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        position: static !important;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 20px 20px 0 20px;
    }
    
    .auth-form,
    .social-login {
        padding: 0 20px 20px 20px;
    }
    
    .form-toggle {
        padding: 20px;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Mobile filter styles */
.mobile-filters-section {
    display: none;
}

/* Show mobile filters on mobile when menu is active */
@media (max-width: 650px) {
    .nav-container {
        padding: 0 2px;
    }
    
    .nav-menu.active .mobile-filters-section {
        display: block !important;
        width: 100% !important;
        margin-bottom: 0;
    }
    
    /* Ensure all mobile filter options are hidden by default */
    .mobile-filter-options {
        display: none !important;
        width: 100% !important;
    }
    
    /* Only show when toggle is active */
    .mobile-filter-toggle.active + .mobile-filter-options {
        display: block !important;
    }
    
    /* Ensure mobile filter toggles are full width */
    .mobile-filter-toggle {
        width: 100% !important;
        max-width: 100% !important;
    }
}

.filter-section-header {
    background: #F7FAFC;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2D3748;
    padding: 12px 16px;
    border-bottom: 1px solid #E2E8F0;
}

.mobile-filter-item {
    margin-bottom: 0;
    width: 100%;
    border-bottom: 1px solid #E2E8F0;
}

.mobile-filter-item:last-child {
    border-bottom: none;
}

.mobile-filter-toggle {
    width: 100% !important;
    background: none;
    border: none;
    padding: 12px 16px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 500;
    color: #4A5568;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
    min-height: 48px;
    text-decoration: none;
}

.mobile-filter-toggle:hover {
    background-color: #F7FAFC;
}

.mobile-filter-toggle.active {
    background-color: #EDF2F7;
    color: #2D3748;
}

.mobile-filter-toggle i:first-child {
    margin-right: 12px;
    width: 16px;
    text-align: center;
}

.mobile-filter-toggle span {
    flex: 1;
}

.mobile-filter-toggle .filter-chevron {
    transition: transform 0.2s ease;
    display: block;
}

.mobile-filter-toggle.active .filter-chevron {
    transform: rotate(180deg);
}

.mobile-filter-options {
    background: #F7FAFC;
    border-radius: 0;
    margin-top: 0;
    box-shadow: none;
    overflow: hidden;
    display: none;
    border-top: 1px solid #E2E8F0;
}

.mobile-filter-option {
    display: block;
    padding: 12px 16px;
    color: #4A5568;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #E2E8F0;
    width: 100%;
}

.mobile-filter-option:last-child {
    border-bottom: none;
}

.mobile-filter-option:hover {
    background-color: #F7FAFC;
    color: #2D3748;
}

.mobile-filter-option.active {
    background-color: #EDF2F7;
    color: #2D3748;
    font-weight: 500;
}

/* Hide desktop filters on mobile */
@media (max-width: 650px) {
    .desktop-only {
        display: none !important;
    }
    
    /* Ensure mobile menu shows mobile filters instead of desktop dropdown */
    .nav-menu.active .filters-dropdown {
        display: none !important;
    }
    
    /* Show mobile filters in mobile menu */
    .nav-menu.active .mobile-filters-section {
        display: block !important;
        width: 100% !important;
        margin-bottom: 16px !important;
    }
    
    /* Hide desktop dropdown menu on mobile */
    .nav-menu.active .dropdown-menu {
        display: none !important;
    }
}

/* Show desktop filters on larger screens */
@media (min-width: 651px) {
    .mobile-filters-section {
        display: none !important;
    }
}

/* Safari fixes for loading animation */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .book ul li {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform-style: preserve-3d;
        transform-style: preserve-3d;
        -webkit-perspective: 100px;
        perspective: 100px;
        -webkit-transform: rotateZ(0deg) translateX(-16px) translateZ(2px);
        transform: rotateZ(0deg) translateX(-16px) translateZ(2px);
    }
    
    .book {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform-style: preserve-3d;
        transform-style: preserve-3d;
        -webkit-perspective: 100px;
        perspective: 100px;
    }
    
    .book ul {
        -webkit-transform-style: preserve-3d;
        transform-style: preserve-3d;
        -webkit-perspective: 100px;
        perspective: 100px;
    }
}

/* Profile Modal Styles */
.profile-content {
    padding: 20px 0;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E2E8F0;
}

.profile-avatar {
    font-size: 60px;
    color: #4299E1;
}

.profile-details h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2D3748;
}

.profile-details p {
    margin: 4px 0;
    color: #718096;
    font-size: 14px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
}

.btn-secondary {
    background: #EDF2F7;
    color: #2D3748;
    border: 1px solid #E2E8F0;
}

.btn-secondary:hover {
    background: #E2E8F0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .profile-info {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .profile-avatar {
        font-size: 50px;
    }
    
    .profile-details h3 {
        font-size: 20px;
    }
}

/* Hide wishlist buttons by default when not authenticated */
.wishlist-btn {
    display: none;
}

/* Show wishlist buttons when user is authenticated */
.wishlist-btn.authenticated {
    display: block;
}



