/* 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;
    background-color: #f5f5f5;
    line-height: 1.6;
}

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

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 300;
}

.main-header nav {
    display: flex;
    gap: 2rem;
}

.main-header nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.main-header nav a:hover {
    opacity: 0.8;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 120px);
    padding: 20px 0;
}

/* Section Styles */
.section {
    margin-bottom: 40px;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
}

.see-all {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.see-all:hover {
    color: #333;
}

/* Colored Section Headers */
.section.stories .section-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    margin: -30px -30px 25px -30px;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.section.poetry .section-header {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    margin: -30px -30px 25px -30px;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.section.essays .section-header {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
    margin: -30px -30px 25px -30px;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.section.categories .section-header {
    background: linear-gradient(135deg, #8BC34A, #689F38);
    color: white;
    margin: -30px -30px 25px -30px;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.section.authors .section-header {
    background: linear-gradient(135deg, #E91E63, #C2185B);
    color: white;
    margin: -30px -30px 25px -30px;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

/* Layout Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.book-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.book-cover {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    text-align: center;
    padding: 10px;
    position: relative;
    overflow: hidden;
}

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

.book-cover.no-image {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.book-category {
    background: #e8f5e8;
    color: #4CAF50;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    display: inline-block;
}

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

.category-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.category-count {
    color: #666;
    font-size: 0.9rem;
}

/* Authors Grid */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.author-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.author-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.author-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    overflow: hidden;
}

.author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.author-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.2;
}

.author-count {
    color: #666;
    font-size: 0.8rem;
}

.book-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 8px;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    background: white;
    border: 1px solid #ddd;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.pagination a:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.pagination .current {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    font-weight: 600;
}

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Page Info */
.page-info {
    text-align: center;
    color: #666;
    margin: 20px 0;
    font-size: 0.9rem;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

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

    .authors-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .main-header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .main-header nav {
        justify-content: center;
    }

    .container {
        padding: 0 15px;
    }

    .section {
        padding: 20px;
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .book-cover {
        height: 150px;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .main-header h1 a {
        font-size: 1.5rem;
    }
}

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

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.no-books {
    text-align: center;
    color: #999;
    font-size: 1.1rem;
    margin: 40px 0;
}