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

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

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    z-index: 1000;
    display: none;
}

.cookie-banner.show {
    display: block;
}

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

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

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

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

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.5rem;
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    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: #333;
    margin: 3px 0;
    transition: 0.3s;
}

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

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

.btn-secondary {
    background: transparent;
    color: #3498db;
    padding: 12px 24px;
    border: 2px solid #3498db;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #3498db;
    color: white;
}

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

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.2;
}

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

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

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

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

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

/* Book Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.book-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px 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 10px 25px rgba(0,0,0,0.15);
}

.book-image {
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.book-info {
    padding: 20px;
}

.book-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    text-decoration: none;
}

.book-title:hover {
    color: #3498db;
}

.book-author {
    color: #666;
    font-size: 1rem;
    margin-bottom: 10px;
}

.book-category {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 15px;
}

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

/* Filters */
.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

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

.search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
}

.category-filter select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    min-width: 180px;
}

.category-filter select:focus {
    outline: none;
    border-color: #3498db;
}

/* Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

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

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

.category-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.category-card p {
    color: #666;
    margin-bottom: 20px;
}

.category-count {
    background: #3498db;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Categories List */
.categories-list {
    display: grid;
    gap: 40px;
}

.category-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.category-header {
    background: #f8f9fa;
    padding: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.category-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.category-books {
    padding: 30px;
}

/* Book Detail */
.book-detail {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.book-detail-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 40px;
}

.book-detail-image {
    background: #f8f9fa;
    border-radius: 10px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.book-detail-info h1 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.book-detail-info .book-author {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.book-detail-info .book-category {
    margin-bottom: 20px;
}

.book-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.external-link {
    padding: 10px 20px;
    border: 2px solid #3498db;
    color: #3498db;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.external-link:hover {
    background: #3498db;
    color: white;
}

.book-sections {
    display: grid;
    gap: 30px;
}

.book-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.book-section ul {
    padding-left: 20px;
}

.book-section ul li {
    margin-bottom: 10px;
    color: #666;
}

.third-party-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    color: #856404;
}

/* Contact Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin: 40px 0;
}

.contact-info .contact-item {
    margin-bottom: 30px;
}

.contact-info h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.contact-info p {
    color: #666;
    line-height: 1.6;
}

.contact-info a {
    color: #3498db;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.contact-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

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

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

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

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

/* Legal Content */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.content-section p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 15px;
}

.content-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.content-section ul li {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.6;
}

.content-section a {
    color: #3498db;
    text-decoration: none;
}

.content-section a:hover {
    text-decoration: underline;
}

/* About Content */
.about-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.content-grid {
    display: grid;
    gap: 40px;
}

/* Featured Books Section */
.featured-books,
.categories-preview {
    padding: 80px 0;
}

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

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

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

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

.footer-bottom {
    max-width: 1200px;
    margin: 30px auto 0;
    padding: 20px;
    border-top: 1px solid #34495e;
    text-align: center;
    color: #bdc3c7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .book-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .book-detail-content {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .book-links {
        flex-direction: column;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .page-header {
        padding: 40px 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .book-info {
        padding: 15px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .book-section {
        padding: 20px;
    }
}

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

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

[dir="rtl"] .logo {
    margin-right: 0;
    margin-left: 10px;
}

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

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

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

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

[dir="rtl"] .content-section ul {
    padding-right: 20px;
    padding-left: 0;
}