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

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    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.3;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

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

a:hover {
    text-decoration: underline;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* 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;
}

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

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

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

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

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

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1f2937;
    color: white;
    padding: 1rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.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: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    padding: 1rem 0;
}

.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-link {
    color: #4b5563;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #2563eb;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4b5563;
}

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

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

.hero-content h1 {
    color: #1f2937;
    margin-bottom: 1.5rem;
}

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

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

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

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

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

/* Content Sections */
.content-section {
    padding: 4rem 0;
}

.featured-books {
    padding: 4rem 0;
    background-color: #f8fafc;
}

.categories-preview {
    padding: 4rem 0;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

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

.book-card img {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
}

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

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

.book-card .category {
    display: inline-block;
    background-color: #e5e7eb;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.book-card p {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
}

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

.category-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    text-decoration: none;
}

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

.category-card p {
    color: #6b7280;
    margin: 0;
}

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

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

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

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

.category-filters select {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
}

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

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

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

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

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

.book-meta {
    margin-bottom: 2rem;
}

.book-meta .author {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.book-meta .category {
    display: inline-block;
    background-color: #dbeafe;
    color: #1d4ed8;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 1rem;
}

.book-meta .year {
    color: #6b7280;
    margin-bottom: 2rem;
}

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

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

.purchase-disclaimer p {
    margin: 0;
    color: #92400e;
    font-size: 0.875rem;
}

.book-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

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

.takeaways-list {
    list-style: none;
    padding: 0;
}

.takeaways-list li {
    background-color: #f8fafc;
    padding: 1rem;
    border-left: 4px solid #2563eb;
    margin-bottom: 1rem;
    border-radius: 0 6px 6px 0;
}

.book-sidebar .sidebar-card {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.book-sidebar .sidebar-card h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.sidebar-card {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

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

.sidebar-card ul {
    list-style: none;
    padding: 0;
}

.sidebar-card li {
    margin-bottom: 0.5rem;
}

.sidebar-card a {
    color: #2563eb;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
}

.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: 12px;
    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 {
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

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

.contact-info .contact-item {
    margin-bottom: 1.5rem;
}

.contact-info .contact-item strong {
    display: block;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.contact-info .contact-item p {
    margin: 0;
    color: #4b5563;
}

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

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

.legal-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Back Link */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.back-link:hover {
    color: #2563eb;
}

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

.book-not-found {
    text-align: center;
    padding: 4rem 2rem;
}

/* Categories Section */
.category-section {
    margin-bottom: 4rem;
}

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

.category-description {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

/* Footer */
.footer {
    background-color: #1f2937;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

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

.footer-section p {
    color: #d1d5db;
    line-height: 1.6;
}

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

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

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

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

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

.footer-bottom p {
    color: #9ca3af;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        gap: 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .book-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .book-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .purchase-links {
        justify-content: center;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

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

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .logo {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero .container {
    grid-template-columns: 1fr 1fr;
}

[dir="rtl"] .book-header {
    grid-template-columns: 1fr 200px;
}

[dir="rtl"] .content-grid {
    grid-template-columns: 1fr 2fr;
}

[dir="rtl"] .book-content {
    grid-template-columns: 1fr 2fr;
}

[dir="rtl"] .takeaways-list li {
    border-left: none;
    border-right: 4px solid #2563eb;
    border-radius: 6px 0 0 6px;
}

[dir="rtl"] ul,
[dir="rtl"] ol {
    padding-left: 0;
    padding-right: 2rem;
}