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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1em;
}

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

a:hover {
    text-decoration: underline;
}

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

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

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

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

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

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

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

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

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

.cookie-content p {
    margin: 0;
    margin-right: 20px;
}

.cookie-content a {
    color: #60a5fa;
}

.cookie-dismiss {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.cookie-dismiss:hover {
    background: #1d4ed8;
}

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

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

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
}

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

.logo img {
    margin-right: 8px;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: #6b7280;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.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: 4px;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0.1;
    z-index: 1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.hero-content h1 {
    margin-bottom: 16px;
    color: #1f2937;
}

.hero-content p {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

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

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    color: #1f2937;
    margin-bottom: 8px;
}

.section-header p {
    color: #6b7280;
    font-size: 1.125rem;
    margin-bottom: 0;
}

.section-footer {
    text-align: center;
    margin-top: 48px;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 0;
}

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

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

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

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

.book-content {
    padding: 24px;
}

.book-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.book-author {
    color: #6b7280;
    margin-bottom: 12px;
}

.book-description {
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

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

.book-actions {
    display: flex;
    gap: 12px;
}

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

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

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

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

.category-icon {
    width: 64px;
    height: 64px;
    background: #f3f4f6;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.category-count {
    color: #6b7280;
    margin-bottom: 0;
}

/* Search and Filter */
.search-filter {
    background: #f9fafb;
    padding: 32px 0;
    margin-bottom: 48px;
}

.search-filter-content {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

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

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

/* Book Detail */
.book-detail {
    padding: 48px 0;
}

.book-detail-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.book-detail-image {
    background: #f9fafb;
    border-radius: 12px;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
}

.book-detail-image img {
    max-width: 200px;
    max-height: 300px;
    object-fit: contain;
}

.book-detail-info h1 {
    margin-bottom: 8px;
}

.book-detail-meta {
    color: #6b7280;
    margin-bottom: 24px;
}

.book-detail-description {
    margin-bottom: 32px;
}

.book-links {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.book-links .btn {
    flex: 1;
    text-align: center;
}

.disclaimer-note {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 32px;
}

.disclaimer-note p {
    margin: 0;
    color: #92400e;
}

.key-takeaways {
    margin-bottom: 32px;
}

.key-takeaways h3 {
    margin-bottom: 16px;
}

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

.key-takeaways li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.key-takeaways li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: bold;
}

.who-its-for {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 6px;
    padding: 24px;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 48px 0 24px;
}

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

.footer-logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.footer-logo img {
    margin-right: 8px;
}

.footer-section h4 {
    color: white;
    margin-bottom: 16px;
}

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

.footer-section li {
    margin-bottom: 8px;
}

.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: 24px;
    text-align: center;
    color: #9ca3af;
}

/* Page Specific */
.page-header {
    background: #f9fafb;
    padding: 48px 0;
    text-align: center;
}

.page-content {
    padding: 48px 0;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.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 {
    height: 120px;
    resize: vertical;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .book-detail-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .book-detail-image {
        height: 300px;
    }
    
    .book-links {
        flex-direction: column;
    }
    
    .search-filter-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .cookie-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .cookie-content p {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 48px 0;
    }
    
    .featured-books,
    .categories-preview {
        padding: 48px 0;
    }
    
    .books-grid {
        gap: 24px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .logo img {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .footer-logo img {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .key-takeaways li {
    padding-left: 0;
    padding-right: 24px;
}

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