/* 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 {
    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: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

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

/* Header */
.header {
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 20px;
}

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

.logo:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: #374151;
    font-weight: 500;
    text-decoration: none;
}

.nav-links a:hover {
    color: #2563eb;
}

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

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

.book-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.book-image {
    width: 80px;
    height: 120px;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.book-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

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

.book-description {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.5;
}

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

.category-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.category-card h3 {
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.category-count {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Sections */
.featured-books, .categories-preview {
    padding: 4rem 0;
}

.featured-books {
    background-color: #f9fafb;
}

/* Search and Filters */
.search-filters {
    background-color: #f9fafb;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.filter-select {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
}

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

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

.book-detail-image {
    width: 200px;
    height: 300px;
    border-radius: 8px;
}

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

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

.book-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

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

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

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

.key-takeaways li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.key-takeaways li:before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    margin-right: 0.5rem;
}

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

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

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

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

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

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

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .book-detail-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .book-detail-image {
        width: 150px;
        height: 225px;
        margin: 0 auto;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input {
        min-width: 100%;
    }
    
    .book-links {
        flex-direction: column;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .book-card {
        padding: 1rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
}

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

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

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

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

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

[dir="rtl"] .key-takeaways li:before {
    margin-right: 0;
    margin-left: 0.5rem;
}