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

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"] .logo {
    flex-direction: row-reverse;
}

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

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

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

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

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

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

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

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: #2563eb;
}

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

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: #fff;
    color: #333;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Page Header */
.page-header {
    background: #f8fafc;
    padding: 3rem 0;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.page-header p {
    font-size: 1.125rem;
    color: #64748b;
}

/* Books Grid */
.featured-books,
.books-directory {
    padding: 4rem 0;
}

.featured-books h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1e293b;
}

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

.book-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e5e5;
}

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

.book-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f1f5f9;
}

.book-content {
    padding: 1.5rem;
}

.book-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.book-author {
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

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

.book-description {
    color: #475569;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.book-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.book-link:hover {
    text-decoration: underline;
}

/* Directory Controls */
.directory-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

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

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

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

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

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

.categories-preview h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1e293b;
}

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

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

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e5e5;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.category-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.category-card p {
    color: #64748b;
}

.category-detail-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.category-detail-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.category-detail-card p {
    color: #64748b;
    margin-bottom: 1rem;
}

.category-stats {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.category-link {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.category-link:hover {
    background: #1d4ed8;
}

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

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

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

.book-detail-info h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

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

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

.book-detail-description {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 2rem;
}

.key-takeaways {
    margin: 2rem 0;
}

.key-takeaways h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

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

.key-takeaways li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #374151;
}

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

.who-its-for {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 4px solid #2563eb;
}

.who-its-for h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.external-links {
    margin: 2rem 0;
}

.external-links h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

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

.external-link {
    display: block;
    background: #2563eb;
    color: white;
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.external-link:hover {
    background: #1d4ed8;
}

.purchase-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin: 2rem 0;
    color: #92400e;
}

.purchase-notice strong {
    color: #78350f;
}

/* Content Sections */
.content-section {
    padding: 3rem 0;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.content-wrapper h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: #1e293b;
}

.content-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    color: #374151;
}

.content-wrapper p {
    margin-bottom: 1rem;
    color: #4b5563;
    line-height: 1.7;
}

.content-wrapper ul,
.content-wrapper ol {
    margin: 1rem 0;
    padding-left: 2rem;
    color: #4b5563;
}

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

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

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

.contact-info h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

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

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

.contact-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.contact-item p {
    color: #6b7280;
    line-height: 1.6;
}

.contact-form-wrapper {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
}

.contact-form h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    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;
    font-family: inherit;
}

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

.submit-btn {
    background: #2563eb;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

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

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

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f2937;
    color: white;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 -4px 6px rgba(0,0,0,0.1);
}

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

.cookie-content p {
    margin: 0;
    font-size: 0.875rem;
}

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

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

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0 1rem 0;
}

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

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p {
    color: #d1d5db;
    line-height: 1.6;
}

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

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

.footer-section ul li a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

/* Error States */
.no-results,
.book-not-found {
    text-align: center;
    padding: 3rem 0;
}

.not-found-content {
    max-width: 500px;
    margin: 0 auto;
}

.not-found-content h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.not-found-content p {
    color: #64748b;
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .book-detail-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .directory-controls {
        flex-direction: column;
    }
    
    .filter-controls select {
        min-width: auto;
        width: 100%;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .categories-grid.large {
        grid-template-columns: 1fr;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .featured-books,
    .books-directory,
    .categories-preview,
    .categories-listing {
        padding: 2rem 0;
    }
    
    .book-content {
        padding: 1rem;
    }
    
    .contact-form-wrapper {
        padding: 1rem;
    }
}