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

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

h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
}

h2 {
    font-size: 2rem;
    color: #1a1a1a;
}

h3 {
    font-size: 1.5rem;
    color: #1a1a1a;
}

h4 {
    font-size: 1.25rem;
    color: #1a1a1a;
}

p {
    margin-bottom: 1rem;
    color: #555;
}

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

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

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

li {
    margin-bottom: 0.5rem;
    color: #555;
}

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

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

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

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

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

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    color: white;
    padding: 15px 0;
    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;
    padding: 0 20px;
    gap: 20px;
}

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

.cookie-content button {
    flex-shrink: 0;
}

/* Header */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

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

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

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

.nav-link {
    color: #555;
    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;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

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

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

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

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

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

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

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

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

.page-header p {
    font-size: 1.25rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
}

/* 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 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

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

.book-image {
    width: 100%;
    height: 200px;
    background-color: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

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

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

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

.book-description {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Featured Books Section */
.featured-books {
    padding: 4rem 0;
}

.featured-books h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

/* Categories Preview */
.categories-preview {
    padding: 4rem 0;
    background-color: #f8fafc;
}

.categories-preview h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

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

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-5px);
    text-decoration: none;
    color: inherit;
}

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

.category-card p {
    color: #555;
}

/* Categories Listing */
.categories-listing {
    padding: 4rem 0;
}

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

.category-card-large {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.category-card-large h2 {
    color: #2563eb;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.category-card-large p {
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Books Directory */
.books-directory {
    padding: 2rem 0 4rem;
}

.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: 8px;
    font-size: 1rem;
}

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

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

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

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

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

.book-detail-image {
    width: 100%;
    max-width: 400px;
    height: 500px;
    background-color: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-detail-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

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

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

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

.book-detail-category {
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 500;
}

.book-detail-year {
    background-color: #f1f5f9;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

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

.book-links a {
    padding: 12px 24px;
    background-color: #2563eb;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.book-links a:hover {
    background-color: #1d4ed8;
    text-decoration: none;
}

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

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

.key-takeaways {
    background-color: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
}

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

.key-takeaways li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    padding-left: 2rem;
}

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

.key-takeaways li:last-child {
    border-bottom: none;
}

.third-party-notice {
    background-color: #fef3c7;
    border: 2px solid #f59e0b;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.third-party-notice p {
    margin: 0;
    color: #92400e;
    font-weight: 500;
}

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

.not-found-content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.not-found-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #6b7280;
}

/* Contact Form */
.contact-content {
    padding: 2rem 0 4rem;
}

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

.contact-form {
    display: flex;
    flex-direction: column;
    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;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    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;
}

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

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

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item h3 {
    margin-bottom: 0.5rem;
    color: #2563eb;
}

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

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

.legal-sections {
    max-width: 800px;
    margin: 0 auto;
}

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

.legal-section h2 {
    color: #2563eb;
    margin-bottom: 1rem;
}

.legal-section ul {
    margin-left: 1rem;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    color: #d1d5db;
    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 ul {
    list-style: none;
    padding: 0;
}

.footer-section ul 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: 2rem;
    text-align: center;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .book-detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .filters {
        flex-direction: column;
    }

    .search-box {
        min-width: auto;
    }

    .cookie-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .categories-grid-large {
        grid-template-columns: 1fr;
    }

    .book-links {
        flex-direction: column;
    }

    .book-links a {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .book-card {
        padding: 1rem;
    }

    .category-card {
        padding: 1.5rem;
    }

    .category-card-large {
        padding: 2rem;
    }
}

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

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

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

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

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

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

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

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