* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: hsl(67, 70%, 50%);
    --primary-dark: hsl(67, 70%, 40%);
    --secondary-color: hsl(220, 13%, 18%);
    --text-color: hsl(0, 0%, 20%);
    --text-light: hsl(0, 0%, 50%);
    --border-color: hsl(0, 0%, 90%);
    --background-color: hsl(0, 0%, 98%);
    --white: hsl(0, 0%, 100%);
    --shadow: 0 2px 10px hsla(0, 0%, 0%, 0.1);
    --shadow-light: 0 1px 3px hsla(0, 0%, 0%, 0.1);
    --border-radius: 8px;
    --max-width: 1200px;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

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

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

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

.cookie-btn {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cookie-btn:hover {
    background: var(--primary-dark);
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    padding: 1rem 0;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: var(--font-size-lg);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.25rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: 0.3s;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: var(--font-size-base);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: hsl(220, 13%, 25%);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
}

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

.hero-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h1 {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    line-height: 1.2;
}

.hero-text p {
    font-size: var(--font-size-lg);
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* Sections */
section {
    padding: 4rem 0;
}

section h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: var(--font-size-lg);
    margin-bottom: 3rem;
}

.text-center {
    text-align: center;
    margin-top: 3rem;
}

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

.book-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px hsla(0, 0%, 0%, 0.15);
}

.book-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.book-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.book-author {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.book-category {
    display: inline-block;
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 1rem;
}

.book-description {
    color: var(--text-light);
    line-height: 1.5;
}

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

.category-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px hsla(0, 0%, 0%, 0.15);
}

.category-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.category-count {
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

/* Search and Filter */
.search-filters {
    background: var(--background-color);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.search-input,
.filter-select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    background: var(--white);
    transition: border-color 0.2s ease;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.filter-select {
    min-width: 150px;
}

/* Book Detail */
.book-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

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

.book-detail-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.book-meta h1 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.book-meta .book-author {
    font-size: var(--font-size-xl);
    margin-bottom: 1rem;
}

.book-meta .book-category {
    margin-bottom: 1.5rem;
}

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

.external-note {
    background: var(--background-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    margin: 2rem 0;
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

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

.book-section h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    text-align: left;
}

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

.key-takeaways li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.key-takeaways li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* Content Pages */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.content-page h1 {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.content-page h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    color: var(--secondary-color);
    text-align: left;
}

.content-page h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    color: var(--secondary-color);
}

.content-page p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

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

.content-page li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 3rem 0 1rem 0;
    margin-top: 4rem;
}

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

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: var(--font-size-lg);
    margin-bottom: 1rem;
}

.footer-section h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section p {
    color: hsl(0, 0%, 80%);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

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

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

.footer-section a {
    color: hsl(0, 0%, 80%);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid hsl(220, 13%, 30%);
    padding-top: 2rem;
    text-align: center;
    color: hsl(0, 0%, 70%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        gap: 1rem;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-text h1 {
        font-size: var(--font-size-3xl);
    }

    .hero-buttons {
        justify-content: center;
    }

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

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

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

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

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

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero-text h1 {
        font-size: var(--font-size-2xl);
    }

    section {
        padding: 2rem 0;
    }

    section h2 {
        font-size: var(--font-size-2xl);
    }

    .book-card,
    .category-card {
        padding: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

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

/* RTL Support */
[dir="rtl"] .nav-logo,
[dir="rtl"] .footer-logo {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-content {
    direction: rtl;
}

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

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

[dir="rtl"] .book-detail-header {
    direction: rtl;
}

[dir="rtl"] .filter-controls {
    direction: rtl;
}