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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.btn-secondary:hover {
    background-color: #2563eb;
    color: white;
    text-decoration: none;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1f2937;
    color: white;
    padding: 1rem;
    z-index: 1000;
    display: block;
}

.cookie-banner.hidden {
    display: none;
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

.cookie-content p {
    margin: 0;
    flex: 1;
}

/* Header */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: #1f2937;
}

.logo a {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.logo img {
    width: 32px;
    height: 32px;
    margin-right: 0.5rem;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav a {
    color: #4b5563;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav a:hover,
.nav a.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    text-decoration: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 2px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 4rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.hero-text p {
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 2rem;
}

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

.hero-image img {
    width: 100%;
    height: auto;
    max-width: 500px;
}

/* Page Header */
.page-header {
    background-color: #f8fafc;
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Book Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.book-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.book-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.book-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card-content {
    padding: 1.5rem;
}

.book-category {
    display: inline-block;
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.book-card h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.book-author {
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.book-card p {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

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

.book-year {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Categories */
.categories-preview {
    padding: 4rem 0;
    background-color: #f8fafc;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s ease;
}

.category-card:hover {
    transform: translateY(-2px);
}

.category-card h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.category-card a {
    color: #2563eb;
    font-weight: 500;
}

/* Categories Detailed Grid */
.categories-detailed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.category-detailed-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.category-detailed-card:hover {
    transform: translateY(-2px);
}

.category-detailed-card h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.category-detailed-card p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.category-book-count {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Directory Controls */
.directory-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 250px;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
}

.search-bar input:focus {
    outline: none;
    border-color: #2563eb;
}

.filter-controls select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
}

.filter-controls select:focus {
    outline: none;
    border-color: #2563eb;
}

/* Book Details */
.book-details {
    padding: 2rem 0;
}

.breadcrumb {
    margin-bottom: 2rem;
    color: #6b7280;
}

.breadcrumb a {
    color: #2563eb;
}

.book-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.book-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.book-info h1 {
    color: #1f2937;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.book-author {
    color: #6b7280;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.book-year {
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.book-short-desc {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 2rem;
}

.purchase-notice {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.purchase-notice p {
    margin: 0;
    color: #92400e;
}

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

.book-content {
    max-width: 800px;
}

.book-section {
    margin-bottom: 3rem;
}

.book-section h2 {
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.book-section ul {
    padding-left: 1.5rem;
}

.book-section li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

/* Related Books */
.related-books {
    background-color: #f8fafc;
    padding: 3rem 0;
}

/* Contact */
.contact-content {
    padding: 2rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h2,
.contact-form h2 {
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.contact-details {
    margin-top: 2rem;
}

.contact-item {
    margin-bottom: 2rem;
}

.contact-item h3 {
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-item p {
    color: #6b7280;
    margin: 0;
}

.contact-item a {
    color: #2563eb;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
}

.form-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.form-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Legal Content */
.legal-content {
    padding: 2rem 0;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.content-section h3 {
    color: #374151;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-section ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 0;
    color: #6b7280;
}

.no-results h3 {
    color: #374151;
    margin-bottom: 1rem;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 4rem 0;
}

.error-message h1 {
    color: #ef4444;
    margin-bottom: 1rem;
}

.error-message p {
    color: #6b7280;
    margin-bottom: 2rem;
}

/* Section Footer */
.section-footer {
    text-align: center;
    margin-top: 3rem;
}

/* Footer */
.footer {
    background-color: #1f2937;
    color: #d1d5db;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
}

.footer-logo img {
    width: 32px;
    height: 32px;
    margin-right: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .book-header {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .directory-controls {
        flex-direction: column;
    }
    
    .search-bar {
        min-width: 100%;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .book-links {
        justify-content: center;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    
    .hero {
        padding: 2rem 0;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    .book-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-detailed-grid {
        grid-template-columns: 1fr;
    }
}