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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

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

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    text-decoration: underline;
}

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

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

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

.btn-secondary {
    background-color: #64748b;
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
    text-decoration: none;
}

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

.btn-outline: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 0;
    z-index: 1000;
}

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

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

/* Header */
.header {
    background-color: #fff;
    box-shadow: 0 1px 3px 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.25rem;
    color: #1f2937;
    text-decoration: none;
}

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

.logo img {
    width: 40px;
    height: 40px;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #64748b;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #64748b;
    margin: 3px 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 h1 {
    font-size: 3rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 2rem;
}

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

.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: 1rem;
}

.page-header p {
    font-size: 1.125rem;
    color: #64748b;
    margin: 0;
}

/* Sections */
.featured-books,
.categories-preview,
.books-directory,
.categories-page,
.about-content,
.contact-content,
.legal-content {
    padding: 4rem 0;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 3rem;
}

.section-footer {
    text-align: center;
    margin-top: 3rem;
}

/* Grids */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.categories-list {
    display: grid;
    gap: 3rem;
}

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

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

.book-card-image {
    width: 100%;
    height: 200px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-card-image img {
    width: 120px;
    height: 160px;
    object-fit: cover;
}

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

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

.book-card .author {
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

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

.book-card p {
    color: #64748b;
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

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

.book-card .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
}

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

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

.category-card h3 {
    margin-bottom: 0.5rem;
}

.category-card .book-count {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Category Section */
.category-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.category-header h2 {
    margin: 0;
}

.category-description {
    color: #64748b;
    margin-bottom: 2rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

.search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
}

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

.category-filter select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    min-width: 200px;
}

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

/* Book Detail */
.book-detail {
    padding: 2rem 0;
}

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

.book-detail-image {
    text-align: center;
}

.book-detail-image img {
    width: 200px;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.book-detail-info h1 {
    margin-bottom: 0.5rem;
}

.book-detail-info .author {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.book-detail-info .category {
    display: inline-block;
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-weight: 500;
    margin-bottom: 1rem;
}

.book-detail-info .publication-year {
    color: #64748b;
    margin-bottom: 1.5rem;
}

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

.book-detail-content {
    display: grid;
    gap: 2rem;
}

.content-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.content-section h2 {
    margin-bottom: 1rem;
    color: #1f2937;
}

.content-section ul {
    list-style-position: inside;
    margin-left: 1rem;
}

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

.third-party-notice {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 1rem;
    margin: 1.5rem 0;
    color: #92400e;
}

/* Book Not Found */
.book-not-found {
    text-align: center;
    padding: 4rem 0;
}

.book-not-found h1 {
    margin-bottom: 1rem;
    color: #1f2937;
}

.book-not-found p {
    color: #64748b;
    margin-bottom: 2rem;
}

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

/* Contact Form */
.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    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 {
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

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

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

.contact-item h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: #64748b;
    margin: 0;
}

/* Legal Content */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content .content-section {
    margin-bottom: 2rem;
}

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

.legal-content li {
    margin-bottom: 0.5rem;
}

/* 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 h3 {
    color: #f9fafb;
    margin-bottom: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: #f9fafb;
    margin-bottom: 1rem;
}

.footer-logo img {
    width: 32px;
    height: 32px;
}

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

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

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

.footer-section a:hover {
    color: #f9fafb;
    text-decoration: none;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .book-detail-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .category-filter select {
        min-width: auto;
        width: 100%;
    }
    
    .book-links {
        justify-content: center;
    }
    
    .hero-actions .btn {
        flex: 1;
        min-width: 140px;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .featured-books,
    .categories-preview,
    .books-directory,
    .categories-page,
    .about-content,
    .contact-content,
    .legal-content {
        padding: 2rem 0;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    .book-card-content,
    .category-card,
    .content-section {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .cookie-banner,
    .btn,
    .filters {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .page-header {
        background: none;
        padding: 1rem 0;
    }
}