/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', 'Tahoma', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    direction: rtl;
    text-align: right;
}

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

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

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
}

h2 {
    font-size: 2rem;
    color: #34495e;
}

h3 {
    font-size: 1.5rem;
    color: #34495e;
}

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

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #2980b9;
    color: white;
}

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    color: white;
}

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

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

.cookie-banner .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

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

.cookie-banner a {
    color: #3498db;
}

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

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

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

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

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

.nav-link:hover,
.nav-link.active {
    color: #3498db;
}

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

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

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

.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: #2c3e50;
}

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

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

.hero-bg {
    max-width: 100%;
    height: auto;
}

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

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
}

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

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

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px 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: #2c3e50;
}

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

.book-category {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.book-description {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

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

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

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

.category-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.category-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.book-count {
    background-color: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Filters Section */
.filters-section {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: center;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.search-box button {
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background-color: #2980b9;
}

.category-filters select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
}

/* Book Details */
.book-details {
    padding: 3rem 0;
}

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

.book-cover {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

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

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

.book-meta p {
    margin-bottom: 0.5rem;
}

.book-meta strong {
    color: #2c3e50;
}

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

.external-links a {
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.external-links a:hover {
    background-color: #c0392b;
}

.disclaimer-note {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 1rem;
    margin: 2rem 0;
    color: #856404;
}

.book-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.content-section h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.key-takeaways ul {
    padding-right: 1.5rem;
}

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

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

.featured-books h2,
.categories-preview h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

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

/* Content Sections */
.content-section {
    margin-bottom: 2rem;
}

.content-section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.content-section ul {
    padding-right: 2rem;
    margin-bottom: 1rem;
}

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

/* About, Contact, Policy Pages */
.about-content,
.contact-content,
.policy-content {
    padding: 3rem 0;
}

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

.contact-info h2,
.contact-form h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

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

.contact-item h3 {
    color: #3498db;
    margin-bottom: 0.5rem;
}

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

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

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

.form-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #3498db;
}

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

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

.footer-section ul li a {
    color: #bdc3c7;
    transition: color 0.3s ease;
}

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

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
    text-align: center;
    color: #bdc3c7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 2rem;
        transition: left 0.3s ease;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

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

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

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

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

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

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

    .filters-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .search-box {
        flex-direction: column;
    }

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

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

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

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

    .external-links {
        justify-content: center;
    }

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

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

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

    .hero {
        padding: 2rem 0;
    }

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

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

    .category-card {
        padding: 1.5rem;
    }

    .filters-section {
        padding: 1.5rem;
    }

    .featured-books,
    .categories-preview,
    .books-directory,
    .categories-page,
    .about-content,
    .contact-content,
    .policy-content {
        padding: 2rem 0;
    }

    .page-header {
        padding: 2rem 0;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.show {
    display: block;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

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

.no-results h3 {
    margin-bottom: 1rem;
    color: #999;
}