/* ============================================
   IR DIGITAL LIBRARY - MAIN STYLES
   ============================================ */

/* ============================================
   ACCESSIBILITY STYLES
   ============================================ */

/* Skip Navigation Link for keyboard users */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--warning-color);
    outline-offset: 2px;
}

/* Focus indicators for all interactive elements */
*:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --secondary-color: #0000FF;
        --accent-color: #FF0000;
        --text-color: #000000;
        --bg-light: #FFFFFF;
        --border-color: #000000;
    }
    
    .btn, .book-card, .category-card {
        border: 2px solid currentColor !important;
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   CSS VARIABLES 
   ============================================ */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --text-color: #2c3e50;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border-color: #dee2e6;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    
    /* Accessible minimum touch target sizes */
    --touch-target-min: 44px;
    --button-padding: 12px 24px;
    --button-font-size: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px; /* Base font size for accessibility */
}

/* ============================================
   ACCESSIBLE BUTTON STYLES
   ============================================ */

/* Base button style - WCAG compliant */
.btn {
    min-height: var(--touch-target-min);
    min-width: var(--touch-target-min);
    padding: var(--button-padding);
    font-size: var(--button-font-size);
    font-weight: 600;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Primary button */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #5a72d7 0%, #6a4393 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Success button */
.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border-color: #27ae60;
}

.btn-success:hover, .btn-success:focus {
    background: linear-gradient(135deg, #219a52 0%, #27b862 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

/* Accent/Danger button */
.btn-accent, .btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-color: #e74c3c;
}

.btn-accent:hover, .btn-accent:focus,
.btn-danger:hover, .btn-danger:focus {
    background: linear-gradient(135deg, #d44637 0%, #a93226 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

/* Warning button */
.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #1a1a1a;
    border-color: #f39c12;
}

.btn-warning:hover, .btn-warning:focus {
    background: linear-gradient(135deg, #e08e0b 0%, #d35400 100%);
    color: #1a1a1a;
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.4);
}

/* Outline buttons */
.btn-outline-primary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--secondary-color);
    color: white;
}

.btn-outline-light {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-light:hover, .btn-outline-light:focus {
    background: white;
    color: var(--primary-color);
}

/* Large button variant */
.btn-lg {
    min-height: 56px;
    padding: 16px 32px;
    font-size: 1.125rem;
    border-radius: 16px;
}

/* Small button - still meets 44px minimum */
.btn-sm {
    min-height: var(--touch-target-min);
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Icon button */
.btn-icon {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    padding: 0;
    border-radius: 50%;
}

/* ============================================
   HEADER STYLES
   ============================================ */
.main-header {
    background: var(--bg-gradient);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    color: white;
    opacity: 0.9;
}

.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-container {
    position: relative;
    display: flex;
}

.search-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid transparent;
    border-radius: 50px 0 0 50px;
    font-size: 1rem;
    min-height: var(--touch-target-min);
    outline: none;
    box-shadow: var(--shadow);
}

.search-input:focus {
    border-color: var(--warning-color);
    outline: none;
}

.search-btn {
    padding: 0.875rem 1.5rem;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    background: var(--accent-color);
    border: none;
    border-radius: 0 50px 50px 0;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.search-btn:hover {
    background: #c0392b;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 15px 15px;
    box-shadow: var(--shadow);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: var(--bg-light);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    background: rgba(255,255,255,0.15);
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--touch-target-min);
}

.btn-header {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.btn-header:hover, .btn-header:focus {
    background: rgba(255,255,255,0.25);
    color: white;
    border-color: white;
}

/* ============================================
   NAVIGATION - Accessible
   ============================================ */
.main-nav {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.nav-link.active {
    color: white;
    background: var(--bg-gradient);
    border-color: var(--primary-color);
}

.nav-link:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    min-height: var(--touch-target-min);
    background: white;
    font-size: 1rem;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--secondary-color);
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: var(--bg-gradient);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   FEATURED CAROUSEL
   ============================================ */
.featured-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--primary-color);
}

.view-all-btn {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    min-height: var(--touch-target-min);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.view-all-btn:hover, .view-all-btn:focus {
    color: white;
    background: var(--secondary-color);
    text-decoration: none;
}

/* ============================================
   BOOK GRID - Default view
   ============================================ */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Book List View */
.books-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.books-grid.list-view .book-card {
    display: flex;
    flex-direction: row;
    height: auto;
    max-height: 180px;
}

.books-grid.list-view .book-cover {
    width: 120px;
    min-width: 120px;
    aspect-ratio: auto;
    height: 100%;
}

.books-grid.list-view .book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.books-grid.list-view .book-title {
    font-size: 1.1rem;
    -webkit-line-clamp: 1;
}

.books-grid.list-view .book-author {
    margin-bottom: 0.25rem;
}

.books-grid.list-view .book-description {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

.books-grid:not(.list-view) .book-description {
    display: none;
}

/* ============================================
   ACCESSIBLE BOOK CARD
   ============================================ */
.book-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.book-card:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
}

.book-card:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.book-cover {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.75);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-overlay,
.book-card:focus .book-overlay,
.book-card:focus-within .book-overlay {
    opacity: 1;
}

.book-actions {
    display: flex;
    gap: 1rem;
}

/* Accessible book action buttons */
.book-action {
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.book-action:hover, .book-action:focus {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.book-action:focus {
    outline: 3px solid white;
    outline-offset: 2px;
}

.status-select {
    background: rgba(255,255,255,0.9);
    color: #333;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.8rem;
    min-width: 80px;
}

.book-info {
    padding: 0.75rem;
}

.book-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 0.5rem 0;
}

h3.book-title {
    font-size: 0.9rem;
}

.book-author {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0 0 0.5rem 0;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.star {
    color: #ffc107;
    font-size: 0.9rem;
}

.book-badges {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 15px;
    font-weight: 600;
}

.badge-new {
    background: var(--success-color);
    color: white;
}

.badge-featured {
    background: var(--warning-color);
    color: white;
}

.badge-popular {
    background: var(--accent-color);
    color: white;
}

/* ============================================
   CATEGORIES - Accessible
   ============================================ */
.categories-section {
    margin-bottom: 3rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.category-card:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
}

.category-card:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--bg-gradient);
    transition: height 0.2s ease;
}

.category-card:hover::before {
    height: 8px;
}

.category-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-name, h3.category-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
}

.category-count, p.category-count {
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
}

/* ============================================
   SWIPER CAROUSEL - Accessible
   ============================================ */
.swiper-container {
    padding-bottom: 2rem;
}

.swiper-slide {
    width: 220px;
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--primary-color);
    background: white;
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 1.25rem;
    font-weight: bold;
}

.swiper-button-next:focus,
.swiper-button-prev:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.swiper-pagination-bullet {
    width: 12px;
    height: 12px;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
}

/* ============================================
   FILTERS - Accessible
   ============================================ */
.filters-section {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.filter-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading i {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-section {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

/* ============================================
   FOOTER STYLES
   ============================================ */
.main-footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255,255,255,0.7);
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

/* ============================================
   ACCESSIBILITY TOGGLE CLASSES
   ============================================ */
body.high-contrast {
    --primary-color: #000000;
    --secondary-color: #0000FF;
    --accent-color: #FF0000;
    --text-color: #000000;
    --bg-light: #FFFFFF;
    --bg-white: #FFFFFF;
    --border-color: #000000;
}

body.high-contrast .btn,
body.high-contrast .book-card,
body.high-contrast .category-card {
    border: 3px solid currentColor !important;
}

body.large-text {
    font-size: 20px;
}

body.large-text h1 { font-size: 2.5rem; }
body.large-text h2 { font-size: 2rem; }
body.large-text h3 { font-size: 1.75rem; }
body.large-text .btn { font-size: 1.2rem; }

/* Screen reader only class */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-search {
        order: 2;
        width: 100%;
    }

    .user-actions {
        order: 1;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-controls {
        width: 100%;
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links a {
        justify-content: center;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #ecf0f1;
        --bg-light: #2c3e50;
        --bg-white: #34495e;
        --border-color: #4a5568;
    }

    body {
        background: var(--bg-light);
        color: var(--text-color);
    }

    .book-card,
    .category-card,
    .filters-section {
        background: var(--bg-white);
    }

    .search-input {
        background: var(--bg-white);
        color: var(--text-color);
    }
    
    .main-nav {
        background: var(--bg-white);
    }
    
    .nav-link {
        color: var(--text-color);
    }
    
    .nav-link:hover {
        background: rgba(255,255,255,0.1);
    }
}

/* Navigation Tabs */
.nav-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-tab.active {
    background: var(--secondary-color);
    color: white;
}

.nav-tab:hover {
    background: rgba(52, 152, 219, 0.1);
}

/* Profile Styles */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-info {
    display: flex;
    align-items: center;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 2rem;
}

.profile-details h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.profile-details p {
    margin: 0.25rem 0;
    color: var(--text-muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
}
