/* ============================================
   OUR BOOKS PAGE CSS - COMPLETE
   ============================================ */

/* ============================================
   HERO SECTION
   ============================================ */
.books-hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.books-hero .hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.books-hero .hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.7) 0%, rgba(44, 62, 80, 0.4) 50%, rgba(159, 161, 255, 0.3) 100%);
}

/* Static Decorative Elements (NO animation) */
.hero-deco {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.hero-deco-1 { top: 15%; left: 8%; font-size: 3rem; }
.hero-deco-2 { top: 25%; right: 12%; font-size: 2rem; }
.hero-deco-3 { top: 60%; left: 5%; font-size: 2.2rem; }
.hero-deco-4 { bottom: 20%; right: 8%; font-size: 2.8rem; }
.hero-deco-5 { top: 45%; right: 20%; font-size: 1.8rem; }
.hero-deco-6 { bottom: 30%; left: 15%; font-size: 2rem; }

/* Hero Content Override */
.books-hero .hero-container {
    position: relative;
    z-index: 2;
    min-height: 600px;
}

.books-hero .hero-content {
    grid-column: 1 / span 7;
    max-width: 640px;
}

.books-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    background: var(--color-secondary);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.books-hero .hero-title {
    font-size: 56px;
    line-height: 1.1;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.books-hero .hero-subtitle {
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    background: none;
    padding: 0;
    opacity: 1;
}

.books-hero .hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.books-hero .btn-primary {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.books-hero .btn-primary:hover {
    background: var(--color-bg-warm);
    color: var(--color-primary-dark);
    transform: translateY(-2px);
}

.books-hero .btn-secondary {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.books-hero .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
    color: white;
}

.books-hero .scroll-indicator {
    color: white;
    opacity: 0.6;
}

/* ============================================
   SEARCH & FILTERS SECTION
   ============================================ */
.search-section {
    padding: 0;
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.search-box {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 32px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border-light);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 20px;
    font-size: 20px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-input {
    flex: 1;
    height: 56px;
    padding: 0 20px 0 52px;
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-text);
    background: var(--color-bg-warm);
    transition: all var(--transition-base);
    width: 100%;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-white);
    box-shadow: 0 0 0 4px rgba(159, 161, 255, 0.1);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-btn {
    height: 56px;
    padding: 0 32px;
    background: var(--gradient-4);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filters-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 160px;
}

.filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.filter-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-bg-warm);
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%237F8C8D' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-white);
    box-shadow: 0 0 0 4px rgba(159, 161, 255, 0.1);
}

/* ============================================
   BROWSE BY AGE SECTION
   ============================================ */
.age-browse {
    background: linear-gradient(135deg, #FFFBF5 0%, #FFF5E6 50%, #FFFBF5 100%);
    padding: var(--section-padding) 0;
}

.age-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.age-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    text-decoration: none;
}

.age-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.age-emoji {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.age-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 8px;
}

.age-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(159, 161, 255, 0.1);
    padding: 4px 16px;
    border-radius: var(--radius-full);
}

/* ============================================
   POPULAR CATEGORIES SECTION
   ============================================ */
.categories-section {
    background: var(--color-bg);
    padding: var(--section-padding) 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
            hsl(var(--cat-hue, 25), 80%, 60%),
            hsl(calc(var(--cat-hue, 25) + 40), 75%, 55%));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: hsl(var(--cat-hue, 25), 60%, 70%);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.category-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 8px;
}

.category-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.category-card-all {
    background: linear-gradient(135deg, var(--color-primary), #B5BAFF);
    border-color: transparent;
}

.category-card-all .category-title,
.category-card-all .category-count {
    color: white;
}

.category-card-all:hover {
    background: linear-gradient(135deg, #B5BAFF, var(--color-primary));
}

/* ============================================
   BOOKS GRID & CARDS
   ============================================ */
.books-grid {
    gap: 28px;
}

/* Override carousel card styles for grid layout */
.books-grid .book-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    overflow: hidden;
}

.books-grid .book-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.books-grid .book-card:focus-within {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Book Cover */
.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    background-color: #f3ede5;
    position: relative;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.books-grid .book-card:hover .book-cover img {
    transform: scale(1.05);
}

/* Rating Badge */
.book-rating {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 700;
    color: var(--color-dark);
}

.rating-star {
    font-size: 14px;
}

/* NEW Badge */
.book-badge-new {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

/* Book Content */
.book-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 8px 8px;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.book-tag {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
    background: rgba(159, 161, 255, 0.1);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.book-age {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-bg-warm);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.book-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 6px;
    line-height: 1.3;
}

.book-author {
    font-size: 14px;
    font-style: italic;
    color: var(--color-text-light);
    margin-bottom: 10px;
}

.book-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--color-border-light);
    margin-top: auto;
}

.book-pages {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.book-pages i {
    font-size: 14px;
}

/* Staff Pick Badge */
.staff-pick-card {
    position: relative;
}

.staff-pick-badge {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 20px;
    background: linear-gradient(135deg, var(--color-primary), #B5BAFF);
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
    z-index: 3;
}

/* Trending Badge */
.trending-card {
    position: relative;
}

.trending-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.trending-badge i {
    font-size: 14px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--color-border);
    margin: 20px 0;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--color-dark);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 16px;
    color: var(--color-text-light);
    margin-bottom: 24px;
}

/* ============================================
   SECTION BACKGROUNDS
   ============================================ */
.new-releases {
    background: linear-gradient(160deg, #FFF8F0 0%, #FFECD2 50%, #FFF8F0 100%);
    padding: var(--section-padding) 0;
}

.staff-picks {
    background: var(--color-bg-warm);
    padding: var(--section-padding) 0;
}

.trending {
    background: linear-gradient(160deg, #FFFBF5 0%, #FFF0E0 50%, #FFFBF5 100%);
    padding: var(--section-padding) 0;
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
    background: var(--gradient-2);
    padding: var(--section-padding) 0;
    position: relative;
    overflow: hidden;
}

.stats-section .section-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.stats-section .section-title {
    color: white;
}

.stats-section .section-desc {
    color: rgba(255, 255, 255, 0.85);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.stat-card {
    text-align: center;
    padding: 40px 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-6px);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   FEATURED AUTHORS
   ============================================ */
.featured-authors {
    background: var(--color-bg-warm);
    padding: var(--section-padding) 0;
}

.author-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.author-spotlight {
    text-align: center;
    padding: 40px 32px;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.author-spotlight:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 4px solid var(--color-primary);
    box-shadow: 0 8px 24px rgba(159, 161, 255, 0.3);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 4px;
}

.author-role {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.author-bio {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

/* ============================================
   CTA SECTION (reuses style.css but customized)
   ============================================ */
.cta-section {
    padding: 120px 0 140px;
    background: var(--gradient-1);
}

/* ============================================
   FOOTER FIXES
   ============================================ */
.footer-submit-btn {
    background: none;
    border: none;
    padding: 0;
    color: #B0BEC5;
    font-size: 15px;
    cursor: pointer;
    transition: color var(--transition-fast);
    font-family: var(--font-body);
}

.footer-submit-btn:hover {
    color: var(--color-primary);
    padding-left: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .author-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .books-hero .hero-title {
        font-size: 48px;
    }
}

@media (max-width: 992px) {
    .age-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .author-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .books-hero .hero-content {
        grid-column: 1 / span 9;
    }

    .books-hero .hero-title {
        font-size: 40px;
    }

    .search-box {
        padding: 24px;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .books-hero {
        min-height: 500px;
    }

    .books-hero .hero-container {
        min-height: 500px;
    }

    .books-hero .hero-content {
        grid-column: 1 / span 12;
        max-width: 100%;
    }

    .books-hero .hero-title {
        font-size: 32px;
    }

    .books-hero .hero-subtitle {
        font-size: 16px;
    }

    .books-hero .hero-actions {
        flex-direction: column;
    }

    .books-hero .hero-actions .btn {
        width: 100%;
    }

    .hero-deco {
        display: none;
    }

    .age-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .age-card {
        padding: 28px 16px;
    }

    .age-emoji {
        font-size: 36px;
    }

    .age-title {
        font-size: 18px;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .stat-card {
        padding: 28px 16px;
    }

    .stat-number {
        font-size: 28px;
    }

    .author-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        padding: 20px;
        border-radius: var(--radius-lg);
    }

    .search-input-wrap {
        flex-direction: column;
    }

    .search-input,
    .search-btn {
        width: 100%;
    }

    .search-icon {
        top: 50%;
        transform: translateY(-50%);
    }
}

@media (max-width: 576px) {
    .books-hero .hero-title {
        font-size: 28px;
    }

    .age-grid {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card {
        padding: 24px 12px;
    }

    .category-icon {
        font-size: 32px;
    }

    .category-title {
        font-size: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 24px;
    }

    .book-title {
        font-size: 18px;
    }

    .book-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cta-section {
        padding: 80px 0 100px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.book-card:focus-visible,
.age-card:focus-visible,
.category-card:focus-visible,
.author-spotlight:focus-visible,
.link-arrow:focus-visible,
.search-btn:focus-visible,
.filter-select:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .books-grid .book-card,
    .age-card,
    .category-card,
    .stat-card,
    .author-spotlight {
        transition: none;
    }

    .book-cover img {
        transition: none;
    }
}