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

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

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

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

[dir="rtl"] .contact-grid {
    direction: rtl;
}

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

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

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1d4ed8;
}

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

.cookie-banner:not(.hidden) {
    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;
}

.cookie-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

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

/* Header */
.header {
    background: #fff;
    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;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

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

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

.nav-link {
    color: #4b5563;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

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

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #4b5563;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    min-height: 60vh;
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.hero-content {
    flex: 1;
    padding-right: 2rem;
}

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

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

.hero-image {
    flex: 1;
}

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

/* Buttons */
.cta-btn, .submit-btn, .view-all-btn {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.cta-btn:hover, .submit-btn:hover, .view-all-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    color: white;
}

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

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

/* Book Cards */
.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

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

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

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

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

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

.book-category {
    display: inline-block;
    background: #e2e8f0;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

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

/* Category Cards */
.category-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

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

.category-link {
    display: inline-block;
    margin-top: 1rem;
    color: #2563eb;
    font-weight: 600;
}

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

.page-header {
    background: #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;
}

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

.search-box input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 300px;
}

.category-filter select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    min-width: 200px;
}

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

.book-detail-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

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

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

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

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

.book-meta p {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

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

.book-link {
    background: #f3f4f6;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.book-link:hover {
    background: #e5e7eb;
}

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

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

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

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

.takeaways-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    padding-left: 1.5rem;
}

.takeaways-list li:before {
    content: "•";
    color: #2563eb;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.disclaimer-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 2rem;
}

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

/* Categories Page */
.category-detailed {
    margin-bottom: 4rem;
}

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

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

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

.category-book-card h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.category-book-card p {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
}

/* Contact Page */
.contact-section {
    padding: 4rem 0;
}

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

.contact-info h2 {
    margin-bottom: 1rem;
}

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

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

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

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

/* Forms */
.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

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

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

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

.legal-text {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

.legal-text h2 {
    color: #1f2937;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-text ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

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

.category-list {
    list-style: none;
    padding-left: 0;
}

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

/* Footer */
.footer {
    background: #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;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

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

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

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

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

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

/* Utility Classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

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

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

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

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