/* ========================================
   LIBRARY PAGE SPECIFIC STYLES
   ======================================== */

/* ========================================
   PREMIUM TYPOGRAPHY SYSTEM
   ======================================== */

/* Typography Variables - Premium Design System */
:root {
    --font-family-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-secondary: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-display: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Fluid Typography Scale - Scales beautifully across devices */
    --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --font-size-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
    --font-size-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.25rem);
    --font-size-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);
    --font-size-5xl: clamp(2.5rem, 2.1rem + 2vw, 3.5rem);
    
    /* Premium Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Optimal Line Heights for Readability */
    --line-height-tight: 1.2;
    --line-height-snug: 1.3;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;
    --line-height-loose: 1.8;
    
    /* Letter Spacing for Premium Feel */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
}

/* Premium Typography Classes */
.text-display {
    font-family: var(--font-family-display);
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-extrabold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
}

.text-heading-1 {
    font-family: var(--font-family-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
}

.text-heading-2 {
    font-family: var(--font-family-display);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-normal);
}

.text-heading-3 {
    font-family: var(--font-family-display);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
}

.text-body-large {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-normal);
}

.text-body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
}

.text-caption {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-wide);
}

.text-small {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
}

/* ========================================
   SUBTLE ANIMATIONS & MICRO-INTERACTIONS
   ======================================== */

/* Animation Variables */
:root {
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Smooth Hover Effects */
.tool-card {
    transition: all var(--transition-normal);
    transform: translateY(0);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(11, 73, 25, 0.15);
}

.tool-card:active {
    transform: translateY(-2px);
    transition: all var(--transition-fast);
}

/* Button Micro-interactions */
.btn {
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.98);
    transition: all var(--transition-fast);
}

/* Card Hover Effects */
.book-item,
.article-item {
    transition: all var(--transition-normal);
    cursor: pointer;
}

.book-item:hover,
.article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(11, 73, 25, 0.1);
}

.book-item:active,
.article-item:active {
    transform: translateY(0);
    transition: all var(--transition-fast);
}

/* Search Input Focus Animation */
.search-input {
    transition: all var(--transition-normal);
}

.search-input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(11, 73, 25, 0.1);
}

/* Filter Button Animations */
.filter-btn {
    transition: all var(--transition-normal);
    position: relative;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--forest-green);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.filter-btn.active::after,
.filter-btn:hover::after {
    width: 80%;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(11, 73, 25, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

/* Tool Transition Effects */
.library-tool {
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.library-tool.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.library-tool.fade-out {
    opacity: 0;
    transform: translateY(20px);
}

/* Staggered Animation for Grid Items */
.book-item,
.article-item {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.book-item:nth-child(1) { animation-delay: 0.1s; }
.book-item:nth-child(2) { animation-delay: 0.2s; }
.book-item:nth-child(3) { animation-delay: 0.3s; }
.book-item:nth-child(4) { animation-delay: 0.4s; }
.book-item:nth-child(5) { animation-delay: 0.5s; }
.book-item:nth-child(6) { animation-delay: 0.6s; }

.article-item:nth-child(1) { animation-delay: 0.1s; }
.article-item:nth-child(2) { animation-delay: 0.2s; }
.article-item:nth-child(3) { animation-delay: 0.3s; }
.article-item:nth-child(4) { animation-delay: 0.4s; }
.article-item:nth-child(5) { animation-delay: 0.5s; }
.article-item:nth-child(6) { animation-delay: 0.6s; }

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

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tool-card:hover,
    .book-item:hover,
    .article-item:hover {
        transform: none;
    }
    
    .btn:hover::before {
        left: -100%;
    }
}

/* Library page body - add top padding to account for fixed header */
body.library-page {
    padding-top: 80px !important; /* Space for fixed header - force override */
    scroll-behavior: smooth; /* Smooth scrolling for tool navigation */
}

/* Library page main content - normal document flow */
body.library-page main {
    margin-top: 0 !important; /* Reset any margin */
    position: relative !important; /* Ensure proper positioning */
    background: transparent !important; /* Ensure page background shows through */
}

/* ========================================
   HERO SECTION - FULL VIEWPORT WITH TOOL CARDS
   ======================================== */

/* Hero Section - Height determined by card content using fit-content */
.library-page .hero-section {
    position: relative; /* Changed from fixed to relative */
    width: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: fit-content; /* Section will be exactly as tall as its content */
    padding: 2rem 1rem;
    box-sizing: border-box;
    background: transparent; /* Ensure page background shows through */
}

/* Hero Spacer - no longer needed since hero is not fixed */
.library-page .hero-spacer {
    display: none; /* Remove hero-spacer since hero is no longer fixed */
}

/* Tool Cards Container - Responsive grid layout with centering */
.library-page .tool-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Individual Tool Card - Glass-morphism design preserves background while ensuring readability */
.library-page .tool-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(11, 73, 25, 0.2);
    box-shadow: 0 8px 32px rgba(11, 73, 25, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

/* Ensure identical styling for both tool cards - prevents CSS inheritance issues */
.library-page .book-card,
.library-page .article-card {
    /* Override any inherited styles to ensure visual consistency */
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(11, 73, 25, 0.2) !important;
    outline: none !important;
    box-shadow: 0 8px 32px rgba(11, 73, 25, 0.15) !important;
}

/* Remove green accent border from book cards for visual consistency */
.library-page .book-card::before {
    display: none;
}

/* Tool Card Hover Effect - Subtle elevation and color shift */
.library-page .tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(11, 73, 25, 0.25);
    background: rgba(255, 255, 255, 0.9);
}

/* Card Header - Title and subtitle styling */
.library-page .card-header {
    margin-bottom: 1.5rem;
}

.library-page .card-title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-semibold);
    color: var(--forest-green);
    margin-bottom: 0.5rem;
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
}

.library-page .card-subtitle {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-lg);
    color: var(--earth-brown);
    font-weight: var(--font-weight-medium);
    margin: 0;
    letter-spacing: var(--letter-spacing-normal);
}

/* Card Content - Trust indicator and description */
.library-page .card-content {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.library-page .trust-indicator {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

.library-page .trust-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--forest-green);
}

.library-page .trust-label {
    font-size: 0.9rem;
    color: var(--earth-brown);
    font-weight: 500;
}

.library-page .card-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0;
}

/* Card Action - Button styling */
.library-page .card-action {
    margin-top: auto;
}

.library-page .card-action .btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Mobile devices - Stack cards vertically */
@media (max-width: 768px) {
    .library-page .hero-section {
        padding: 1rem;
        /* Height is now content-driven via grid-template-rows: min-content */
    }
    
    .library-page .tool-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 500px; /* Increased from 400px for better mobile experience */
    }
    
    .library-page .tool-card {
        padding: 2rem; /* Keep same as desktop for better touch interaction */
        min-height: 280px; /* Slightly smaller but not cramped */
    }
    
    .library-page .card-title {
        font-size: 1.5rem;
    }
    
    .library-page .card-subtitle {
        font-size: 0.9rem;
    }
    
    .library-page .card-description {
        font-size: 0.9rem;
    }
    
    /* Larger trust indicators on mobile for better visibility */
    .library-page .trust-number {
        font-size: 2rem; /* Increased from default for mobile readability */
    }
}

/* Tablet devices - Adjust spacing */
@media (min-width: 769px) and (max-width: 1024px) {
    .library-page .tool-cards {
        gap: 1.5rem;
        max-width: 700px;
    }
    
    .library-page .tool-card {
        padding: 1.75rem;
    }
}

/* ========================================
   WELCOME SECTION - CLEAN & NATURAL (LEGACY)
   ======================================== */

/* Welcome Section - Compact for Viewport */
.library-page .welcome-section {
    padding: 1.5rem 0;
    position: relative;
}

/* Welcome Section Content Container - Glass Effect */
.library-page .welcome-section .container {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(11, 73, 25, 0.15);
    box-shadow: 0 4px 20px rgba(11, 73, 25, 0.1);
}

/* Welcome Content Container */
.library-page .welcome-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Welcome Title - Compact Typography */
.library-page .welcome-title {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--forest-green);
    text-align: center;
}

/* Welcome Description - Compact Typography */
.library-page .welcome-description {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    color: var(--text-medium);
    text-align: center;
}

/* Trust Indicators */
.trust-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.trust-badge {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 
        0 4px 20px rgba(11, 73, 25, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(11, 73, 25, 0.1);
    transition: all 0.3s ease;
}

.trust-badge:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 32px rgba(11, 73, 25, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08);
}

.trust-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.trust-content {
    flex: 1;
}

.trust-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--forest-green);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.trust-label {
    font-size: 0.9rem;
    color: var(--text-medium);
    font-weight: 500;
}

/* Quality Signals */
.quality-signals {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.quality-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-medium);
    font-size: 0.95rem;
    font-weight: 500;
}

.quality-item svg {
    color: var(--forest-green);
    flex-shrink: 0;
}

/* Responsive Typography - Compact */
@media (max-width: 768px) {
    .library-page .welcome-title {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .library-page .welcome-description {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .library-page .welcome-section {
        padding: 1.25rem 0;
    }
    
    .library-page .welcome-section .container {
        padding: 1.25rem;
    }
    
    .trust-indicators {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .trust-badge {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .trust-icon {
        font-size: 1.5rem;
    }
    
    .trust-number {
        font-size: 1.25rem;
    }
    
    .quality-signals {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }
    
    .quality-item {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .library-page .welcome-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .library-page .welcome-description {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .library-page .welcome-section {
        padding: 1rem 0;
    }
    
    .library-page .welcome-section .container {
        padding: 1rem;
    }
    
    .trust-indicators {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .trust-badge {
        padding: 0.75rem;
    }
    
    .trust-icon {
        font-size: 1.25rem;
    }
    
    .trust-number {
        font-size: 1.1rem;
    }
    
    .trust-label {
        font-size: 0.8rem;
    }
    
    .quality-signals {
        gap: 0.75rem;
    }
    
    .quality-item {
        font-size: 0.85rem;
    }
}

/* ========================================
   LIBRARY PAGE CONTENT SECTIONS
   ======================================== */

/* Library Page Content Sections - Glass Morphism Style */
.library-page .content-section {
    background: transparent;
}

/* Browse topics and contact sections removed */

.library-page .newsletter-section {
    background: linear-gradient(135deg, var(--forest-green) 0%, var(--forest-green-light) 100%);
    padding: 2rem 0;
    /* Height will be set dynamically by JavaScript */
}

/* ========================================
   LIBRARY PAGE TEXT SHADOWS FOR READABILITY
   ======================================== */

/* Text shadow styling for removed sections - cleaned up */

/* ========================================
   SEARCH GRID COMPONENT STYLING
   ======================================== */

.search-grid {
    background: transparent;
    padding: 2rem 0;
}

.search-grid-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-grid-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--forest-green);
    margin-bottom: 0.75rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.search-grid-subtitle {
    font-size: 1.125rem;
    color: var(--text-medium);
    margin-bottom: 0;
    opacity: 0.9;
}

.search-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .search-cards-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .search-grid-title {
        font-size: 2rem;
    }
    
    .search-grid-subtitle {
        font-size: 1rem;
    }
}

/* Books carousel component styling removed - starting fresh */

/* Articles grid component styling removed - starting fresh */

/* Search cards styling removed - starting fresh */

/* Old optimized spacing removed - starting fresh */

/* Contact section styling removed */

/* ========================================
   LIBRARY TOOLS - BOOK BROWSER & ARTICLE VIEWER
   ======================================== */

/* Tool Base Styling */
.library-tool {
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 999; /* Below header (z-index: 10000) */
    background: var(--background-white);
    overflow: hidden;
}

.tool-container {
    height: 100%;
    padding-top: 80px; /* Account for fixed header */
    box-sizing: border-box;
    position: relative;
}

/* Darker grey area for the first 80px that sits under the header */
.tool-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: #e0e0e0; /* Even darker grey for header overlap area */
    z-index: -1;
}

.tool-layout {
    height: calc(100vh - 80px); /* Full height minus header */
    display: grid;
    grid-template-columns: 1fr 1fr; /* Finder and Reader side by side */
    gap: 0;
}

/* Tool Finder Styling */
.tool-finder {
    background: var(--background-light);
    border-right: 1px solid rgba(11, 73, 25, 0.1);
    padding: 4px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Navigation Aids */
.finder-navigation {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(11, 73, 25, 0.1);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    color: var(--forest-green);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-normal);
    border-radius: 4px;
}

.nav-link:hover {
    color: var(--earth-brown);
    background: rgba(11, 73, 25, 0.05);
    text-decoration: none;
}

.nav-link:active {
    color: var(--forest-green);
}

.nav-link i {
    font-size: 1rem;
    opacity: 0.8;
}

.nav-link span {
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wide);
}

/* Navigation Link Variants */
.nav-tool {
    color: var(--primary);
}

.nav-tool:hover {
    color: var(--primary);
    background: rgba(25, 118, 210, 0.05);
}

.nav-newsletter {
    color: var(--orange);
}

.nav-newsletter:hover {
    color: var(--orange);
    background: rgba(255, 152, 0, 0.05);
}

.finder-header {
    margin-bottom: 2rem;
}

.finder-title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-semibold);
    color: var(--forest-green);
    margin-bottom: 0.5rem;
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
}

.finder-subtitle {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-lg);
    color: var(--text-medium);
    margin: 0;
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-normal);
}

.finder-controls {
    margin-bottom: 2rem;
}

.search-container {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(11, 73, 25, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--background-white);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    outline: none;
    border-color: var(--forest-green);
    box-shadow: 0 0 0 3px rgba(11, 73, 25, 0.1);
}

.filter-container {
    margin-bottom: 1rem;
}

.pathway-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    background: var(--background-white);
    border: 2px solid rgba(11, 73, 25, 0.2);
    color: var(--text-medium);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--forest-green);
    color: var(--forest-green);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--forest-green);
    border-color: var(--forest-green);
    color: var(--background-white);
    box-shadow: 0 2px 8px rgba(11, 73, 25, 0.3);
}

/* Tool Reader Styling */
.tool-reader {
    background: var(--background-white);
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.reader-header {
    margin-bottom: 2rem;
}

.reader-title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-semibold);
    color: var(--forest-green);
    margin-bottom: 0.5rem;
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
}

.reader-subtitle {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-lg);
    color: var(--text-medium);
    margin: 0;
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-normal);
}

.reader-content {
    flex: 1;
}

.reader-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    font-size: 1.1rem;
    text-align: center;
}

/* Book Browser Specific Styling */
.book-browser-tool {
    background: linear-gradient(135deg, var(--background-white) 0%, var(--background-light) 100%);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.book-item {
    background: var(--background-white);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(11, 73, 25, 0.1);
}

.book-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(11, 73, 25, 0.15);
}

.book-cover {
    margin-bottom: 1rem;
    text-align: center;
}

.book-cover img {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-info {
    text-align: center;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--forest-green);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.book-subtitle {
    font-size: 0.85rem;
    color: var(--earth-brown);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-style: italic;
    line-height: 1.2;
}

.book-author {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.book-meta-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--background-light);
    border-radius: 6px;
    border: 1px solid rgba(11, 73, 25, 0.1);
}

.book-pathway {
    font-size: 0.75rem;
    color: var(--forest-green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.book-price {
    font-size: 0.75rem;
    color: var(--earth-brown);
    font-weight: 600;
}

.book-description {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
    margin: 0;
}

/* Book Details in Reader */
.book-details {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.book-cover-large {
    flex-shrink: 0;
}

.book-cover-large img {
    width: 200px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.book-meta {
    flex: 1;
}

.book-title-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--forest-green);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.book-subtitle-large {
    font-size: 1.125rem;
    color: var(--earth-brown);
    font-weight: 500;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.book-author-large {
    font-size: 1.25rem;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Book Metadata Styling */
.book-metadata {
    background: var(--background-light);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(11, 73, 25, 0.1);
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.metadata-item:last-child {
    margin-bottom: 0;
}

.metadata-label {
    font-size: 0.9rem;
    color: var(--text-medium);
    font-weight: 500;
}

.metadata-value {
    font-size: 0.9rem;
    color: var(--forest-green);
    font-weight: 600;
}

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

.book-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.book-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.book-actions .btn svg {
    flex-shrink: 0;
}

/* Article Viewer Specific Styling */
.article-viewer-tool {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-white) 100%);
}

.articles-grid {
    display: grid;
    gap: 1rem;
}

.article-item {
    background: var(--background-white);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(11, 73, 25, 0.1);
}

.article-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(11, 73, 25, 0.15);
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.article-date,
.article-pathway {
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--background-light);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

/* Multiple pathway badges container */
.article-pathways {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pathway-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Individual pathway badge colors */
.pathway-energy {
    background: rgba(255, 193, 7, 0.2);
    color: #f57c00;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.pathway-food {
    background: rgba(76, 175, 80, 0.2);
    color: #388e3c;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.pathway-water {
    background: rgba(33, 150, 243, 0.2);
    color: #1976d2;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.pathway-movement {
    background: rgba(156, 39, 176, 0.2);
    color: #7b1fa2;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.pathway-goods {
    background: rgba(255, 152, 0, 0.2);
    color: #f57c00;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.pathway-habitat {
    background: rgba(139, 195, 74, 0.2);
    color: #689f38;
    border: 1px solid rgba(139, 195, 74, 0.3);
}

.pathway-community {
    background: rgba(233, 30, 99, 0.2);
    color: #c2185b;
    border: 1px solid rgba(233, 30, 99, 0.3);
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--forest-green);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.article-subtitle {
    font-size: 0.85rem;
    color: var(--earth-brown);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-style: italic;
    line-height: 1.2;
}

.article-author {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.article-meta-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(11, 73, 25, 0.1);
}

.article-source {
    font-size: 0.75rem;
    color: var(--forest-green);
    font-weight: 600;
    background: rgba(11, 73, 25, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.article-reading-time {
    font-size: 0.75rem;
    color: var(--text-medium);
    font-weight: 500;
}

.article-excerpt {
    font-size: 0.95rem;
    color: var(--text-medium);
    line-height: 1.5;
    margin: 0;
}

/* Article Details in Reader */
.article-details {
    max-width: 800px;
}

.article-meta-large {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.article-date-large,
.article-pathway-large {
    font-size: 0.9rem;
    color: var(--text-light);
    background: var(--background-light);
    padding: 0.5rem 1rem;
    border-radius: 16px;
}

/* Large pathway badges container for reader */
.article-pathways-large {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pathway-badge-large {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Large pathway badge colors (same as small ones but larger) */
.pathway-badge-large.pathway-energy {
    background: rgba(255, 193, 7, 0.2);
    color: #f57c00;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.pathway-badge-large.pathway-food {
    background: rgba(76, 175, 80, 0.2);
    color: #388e3c;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.pathway-badge-large.pathway-water {
    background: rgba(33, 150, 243, 0.2);
    color: #1976d2;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.pathway-badge-large.pathway-movement {
    background: rgba(156, 39, 176, 0.2);
    color: #7b1fa2;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.pathway-badge-large.pathway-goods {
    background: rgba(255, 152, 0, 0.2);
    color: #f57c00;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.pathway-badge-large.pathway-habitat {
    background: rgba(139, 195, 74, 0.2);
    color: #689f38;
    border: 1px solid rgba(139, 195, 74, 0.3);
}

.pathway-badge-large.pathway-community {
    background: rgba(233, 30, 99, 0.2);
    color: #c2185b;
    border: 1px solid rgba(233, 30, 99, 0.3);
}

.article-title-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--forest-green);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.article-subtitle-large {
    font-size: 1.125rem;
    color: var(--earth-brown);
    font-weight: 500;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.article-author-large {
    font-size: 1.25rem;
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Article Metadata Styling */
.article-metadata {
    background: rgba(11, 73, 25, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--forest-green);
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.metadata-item:last-child {
    margin-bottom: 0;
}

.metadata-label {
    font-weight: 600;
    color: var(--forest-green);
    font-size: 0.9rem;
}

.metadata-value {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.article-excerpt-large {
    font-size: 1.25rem;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.article-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Mobile Article Reader Dialog */
.mobile-article-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000; /* Same as bookstore dialog */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.mobile-dialog-content {
    background: var(--background-white);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.mobile-dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 1.8rem;
    color: #000000 !important;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all var(--transition-normal);
    z-index: 1; /* Same as bookstore close button */
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mobile-dialog-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000000 !important;
    transform: scale(1.1);
}

.mobile-reader-content {
    flex: 1;
    padding: 2rem;
    padding-top: 3rem; /* Space for close button */
    overflow-y: auto;
}

.mobile-dialog-footer {
    padding: 1rem 2rem;
    border-top: 1px solid rgba(11, 73, 25, 0.1);
    background: var(--background-light);
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
    
    .tool-finder {
        border-right: none;
        border-bottom: none;
    }
    
    .tool-reader {
        display: none; /* Hide desktop reader on mobile */
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .book-details {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .book-cover-large img {
        width: 150px;
    }
    
    .article-title-large {
        font-size: 2rem;
    }
    
    .article-excerpt-large {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .tool-finder,
    .tool-reader {
        padding: 1rem;
    }
    
    .finder-title,
    .reader-title {
        font-size: 1.5rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .book-title-large {
        font-size: 1.75rem;
    }
    
    .book-subtitle-large {
        font-size: 1rem;
    }
    
    .book-metadata {
        padding: 0.75rem;
    }
    
    .metadata-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .book-actions {
        flex-direction: column;
    }
    
    .book-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .article-title-large {
        font-size: 1.75rem;
    }
    
    .article-subtitle-large {
        font-size: 1rem;
    }
    
    .article-metadata {
        padding: 0.75rem;
    }
    
    .metadata-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .metadata-label,
    .metadata-value {
        font-size: 0.8rem;
    }
    
    .article-meta-small {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-source,
    .article-reading-time {
        font-size: 0.7rem;
    }
    
    /* Navigation Aids Responsive */
    .finder-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-link {
        justify-content: center;
        padding: 0.5rem 1rem;
    }
    
    .nav-link span {
        font-size: var(--font-size-xs);
    }
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .finder-navigation {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        flex: 1;
        min-width: 0;
        justify-content: center;
        padding: 0.5rem 0.25rem;
    }
    
    .nav-link span {
        display: inline; /* Keep text visible on mobile */
        font-size: var(--font-size-xs);
    }
    
    .nav-link i {
        font-size: 1rem;
    }
}

/* ========================================
   NEWSLETTER SECTION STYLING
   ======================================== */

.newsletter-section {
    padding: 4rem 2rem;
    background: var(--background-white);
    border-top: 1px solid rgba(11, 73, 25, 0.1);
    position: relative;
    z-index: 1000; /* Higher than hero section (z-index: 1) and tools (z-index: 999), below header/footer (z-index: 10000) */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Fallback minimum height */
}

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

/* Newsletter Navigation Aids */
.newsletter-section .finder-navigation {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(11, 73, 25, 0.1);
}

.newsletter-section .nav-link {
    color: var(--forest-green);
    transition: all var(--transition-normal);
}

.newsletter-section .nav-link:hover {
    background: rgba(11, 73, 25, 0.05);
    color: var(--earth-brown);
}

.newsletter-section .nav-link i {
    color: var(--forest-green);
}

.newsletter-header {
    margin-bottom: 2.5rem;
}

.newsletter-title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--forest-green);
    margin-bottom: 1rem;
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
}

.newsletter-subtitle {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-xl);
    color: var(--text-medium);
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-normal);
    margin: 0;
}

.newsletter-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Newsletter button styling removed - using unified styling from suspra.css */

/* Newsletter Responsive */
@media (max-width: 768px) {
    .newsletter-section {
        padding: 3rem 1.5rem;
    }
    
    .newsletter-title {
        font-size: var(--font-size-3xl);
    }
    
    .newsletter-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .newsletter-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    /* Newsletter button responsive styling removed - using unified styling */
}

@media (max-width: 480px) {
    .newsletter-section {
        padding: 2rem 1rem;
    }
    
    .newsletter-title {
        font-size: var(--font-size-2xl);
    }
    
    .newsletter-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Newsletter button responsive styling removed - using unified styling */
}

/* ========================================
   BOOK DISPLAYER COMPONENT STYLES (LIBRARY CONTEXT)
   ======================================== */

/* Book displayer layout for library page */
.library-page .book-displayer {
    width: 100%;
}

.library-page .book-displayer-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    min-height: 600px;
}

/* Book finder styles for library */
.library-page .book-displayer-finder {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.library-page .finder-navigation {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.library-page .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    color: var(--text-dark);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: var(--transition-fast);
    border-radius: 4px;
}

.library-page .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--forest-green);
    text-decoration: none;
}

.library-page .nav-link i {
    font-size: var(--font-size-base);
}

.library-page .finder-header {
    margin-bottom: 2rem;
}

.library-page .finder-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--forest-green);
    margin: 0 0 0.5rem 0;
}

.library-page .finder-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-medium);
    margin: 0;
}

.library-page .finder-controls {
    margin-bottom: 2rem;
}

.library-page .search-container {
    margin-bottom: 1.5rem;
}

.library-page .search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--text-dark);
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
}

.library-page .search-input:focus {
    outline: none;
    border-color: var(--forest-green);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(46, 94, 78, 0.2);
}

.library-page .search-input::placeholder {
    color: var(--text-medium);
}

.library-page .pathway-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.library-page .filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-small);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: var(--text-dark);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.library-page .filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.library-page .filter-btn.active {
    background: var(--forest-green);
    color: white;
    border-color: var(--forest-green);
}

.library-page .books-grid {
    display: grid;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.library-page .book-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition-fast);
}

.library-page .book-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.library-page .book-item .book-cover {
    flex: 0 0 60px;
}

.library-page .book-item .book-cover img {
    width: 60px;
    height: auto;
    border-radius: var(--border-radius-small);
}

.library-page .book-item .book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.library-page .book-item .book-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--forest-green);
    margin: 0;
    line-height: var(--line-height-snug);
}

.library-page .book-item .book-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-medium);
    margin: 0;
    line-height: var(--line-height-snug);
}

.library-page .book-meta-small {
    display: flex;
    gap: 0.5rem;
    font-size: var(--font-size-xs);
}

.library-page .book-pathway {
    color: var(--forest-green);
    font-weight: var(--font-weight-medium);
}

.library-page .book-price {
    color: var(--text-medium);
    font-weight: var(--font-weight-medium);
}

.library-page .book-item .book-description {
    font-size: var(--font-size-xs);
    color: var(--text-medium);
    margin: 0;
    line-height: var(--line-height-normal);
}

/* Book reader styles for library */
.library-page .book-displayer-reader {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: var(--border-radius-large);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    max-height: 600px;
}

.library-page .reader-header {
    margin-bottom: 2rem;
}

.library-page .reader-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--forest-green);
    margin: 0 0 0.5rem 0;
}

.library-page .reader-subtitle {
    font-size: var(--font-size-base);
    color: var(--text-medium);
    margin: 0;
}

.library-page .book-details {
    display: flex;
    gap: 2rem;
}

.library-page .book-cover-large {
    flex: 0 0 200px;
}

.library-page .book-cover-large img {
    width: 200px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.library-page .book-meta {
    flex: 1;
}

.library-page .book-title-large {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--forest-green);
    margin: 0 0 0.5rem 0;
    line-height: var(--line-height-tight);
}

.library-page .book-subtitle-large {
    font-size: var(--font-size-xl);
    color: var(--text-medium);
    margin: 0 0 1.5rem 0;
    line-height: var(--line-height-snug);
}

.library-page .book-metadata {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.library-page .metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.library-page .metadata-label {
    font-weight: var(--font-weight-semibold);
    color: var(--text-medium);
    font-size: var(--font-size-sm);
}

.library-page .metadata-value {
    font-weight: var(--font-weight-medium);
    color: var(--forest-green);
    font-size: var(--font-size-sm);
}

.library-page .book-description-large {
    font-size: var(--font-size-base);
    color: var(--text-dark);
    line-height: var(--line-height-relaxed);
    margin: 0 0 2rem 0;
}

.library-page .book-actions {
    display: flex;
    gap: 1rem;
}

.library-page .book-actions .btn {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.library-page .btn {
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.library-page .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.library-page .btn:hover::before {
    left: 100%;
}

.library-page .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.library-page .btn-primary {
    background: var(--forest-green);
    color: white;
    border-color: var(--forest-green);
}


.library-page .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
}

/* No book selected state */
.library-page .no-book-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
}

.library-page .no-book-content {
    color: var(--text-medium);
}

.library-page .no-book-content svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.library-page .no-book-content h3 {
    font-size: var(--font-size-xl);
    margin: 0 0 0.5rem 0;
    color: var(--forest-green);
}

.library-page .no-book-content p {
    margin: 0;
    font-size: var(--font-size-base);
}

/* Responsive design for library book displayer */
@media (max-width: 1024px) {
    .library-page .book-displayer-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .library-page .book-details {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .library-page .book-cover-large {
        flex: none;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .library-page .book-displayer-finder,
    .library-page .book-displayer-reader {
        padding: 1.5rem;
    }
    
    .library-page .finder-title,
    .library-page .reader-title {
        font-size: var(--font-size-xl);
    }
    
    .library-page .book-title-large {
        font-size: var(--font-size-2xl);
    }
    
    .library-page .book-subtitle-large {
        font-size: var(--font-size-lg);
    }
}

/* ========================================
   UNIFIED LIBRARY INTERFACE STYLES
   ======================================== */

/* Compact Library Hero Section */
.library-hero-section {
    padding: 2rem 0 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.library-hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.library-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.library-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--forest-green);
    margin: 0;
    line-height: 1.2;
}

.library-stats-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-inline {
    font-weight: 500;
    color: var(--text-primary);
}

.stat-separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Library Hero Controls */
.library-hero-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Library Content Section */
.library-content-section {
    padding: 2rem 0 4rem;
    min-height: 60vh;
}

.library-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.search-container {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: var(--border-radius-medium);
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--forest-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: rgba(139, 69, 19, 0.1);
    color: var(--forest-green);
}

.filter-container {
    display: flex;
    justify-content: center;
}

.pathway-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(139, 69, 19, 0.2);
    background: white;
    color: var(--text-primary);
    border-radius: var(--border-radius-medium);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--forest-green);
    background: rgba(46, 125, 50, 0.05);
}

.filter-btn.active {
    background: var(--forest-green);
    color: white;
    border-color: var(--forest-green);
}

/* Unified Results Grid */
.library-results {
    width: 100%;
    margin-top: 0;
}

.unified-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Book Card Items in Unified Grid */
.book-card-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: var(--border-radius-medium);
    padding: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.book-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--forest-green);
}

.book-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.book-cover-small {
    width: 100%;
    max-width: 160px;
    margin: 0 auto;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.book-cover-small img {
    width: 100%;
    height: auto;
    display: block;
}

.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.book-pathway-badge {
    background: var(--forest-green);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-small);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.book-price-badge {
    background: rgba(139, 69, 19, 0.1);
    color: var(--earth-brown);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    font-weight: 600;
}

.book-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.book-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.book-description {
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    flex-grow: 1;
    font-size: 0.875rem;
}

.book-actions {
    margin-top: auto;
    text-align: center;
}

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

/* Article Card Items in Unified Grid */
.article-card-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: var(--border-radius-medium);
    padding: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.article-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-color: var(--forest-green);
}

.article-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-header {
    margin-bottom: 0.875rem;
}

.article-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.article-title-link {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-title-link:hover {
    color: var(--forest-green);
    text-decoration: none;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.75rem;
}

.pathway-badge {
    background: var(--forest-green);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-small);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-date,
.article-read-time {
    color: var(--text-secondary);
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    font-size: 0.875rem;
}

.article-actions {
    margin-top: auto;
    text-align: center;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Responsive Design for Unified Library */
@media (max-width: 768px) {
    .library-hero-section {
        padding: 1.5rem 0 1rem;
        top: 60px;
    }
    
    .library-hero-container {
        padding: 0 1rem;
    }
    
    .library-hero-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1rem;
    }
    
    .library-title {
        font-size: 1.5rem;
    }
    
    .library-stats-inline {
        font-size: 0.8125rem;
    }
    
    .library-hero-controls {
        gap: 0.875rem;
    }
    
    .library-content-section {
        padding: 1.5rem 0 3rem;
    }
    
    .library-container {
        padding: 0 1rem;
    }
    
    .unified-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .pathway-filters {
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .search-input-wrapper {
        max-width: 100%;
    }
}

/* ========================================
   BOOK PURCHASE DIALOG STYLES
   ======================================== */

/* Book purchase dialog overlay */
.library-page .book-purchase-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

/* Book purchase dialog */
.library-page .book-purchase-dialog {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-large);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    animation: dialogSlideIn 0.3s ease-out;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Dialog close button */
.library-page .book-purchase-dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-dark);
    z-index: 1;
}

.library-page .book-purchase-dialog-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* Dialog content */
.library-page .book-purchase-dialog-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Dialog header */
.library-page .book-purchase-dialog-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.library-page .book-purchase-dialog-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--forest-green);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.library-page .book-purchase-dialog-subtitle {
    font-size: 1.1rem;
    color: var(--text-medium);
    margin: 0;
    line-height: 1.4;
}

/* Dialog body */
.library-page .book-purchase-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.library-page .book-purchase-dialog-description {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.6;
    margin: 0;
    text-align: center;
}

/* Purchase options */
.library-page .book-purchase-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.library-page .btn-purchase-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    text-decoration: none;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.library-page .btn-purchase-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.library-page .btn-purchase-option:hover::before {
    left: 100%;
}

.library-page .btn-purchase-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Button prices */
.library-page .btn-price {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

/* Primary button (eBook) */
.library-page .btn-purchase-option.btn-primary {
    background: var(--forest-green);
    color: white;
    border-color: var(--forest-green);
}

.library-page .btn-purchase-option.btn-primary:hover {
    background: var(--forest-green-light);
    border-color: var(--forest-green-light);
    box-shadow: 0 8px 25px rgba(46, 94, 78, 0.3);
}

/* Outline button (Paperback) */
.library-page .btn-purchase-option.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: var(--forest-green);
    border-color: var(--forest-green);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.library-page .btn-purchase-option.btn-outline:hover {
    background: var(--forest-green);
    color: white;
    border-color: var(--forest-green);
    box-shadow: 0 8px 25px rgba(46, 94, 78, 0.3);
}

/* Responsive dialog */
@media (max-width: 768px) {
    .library-page .book-purchase-dialog {
        max-width: 90vw;
        margin: 0.5rem;
    }
    
    .library-page .book-purchase-dialog-content {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .library-page .book-purchase-dialog-title {
        font-size: 1.5rem;
    }
    
    .library-page .book-purchase-dialog-subtitle {
        font-size: 1rem;
    }
    
    .library-page .btn-purchase-option {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
}