/**
 * Ebook Template CSS
 * 
 * Styles for ebook single and archive pages
 */

/* Single Ebook Page */
.ebook-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ebook-single-article {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Ebook Header */
.ebook-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px;
}

.ebook-header-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.ebook-cover-section {
    flex-shrink: 0;
}

.ebook-cover {
    width: 200px;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.ebook-cover-placeholder {
    background: linear-gradient(45deg, #e9ecef, #f8f9fa);
}

.ebook-cover-icon {
    font-size: 48px;
    color: #adb5bd;
}

.ebook-info-section {
    flex: 1;
    min-width: 0;
}

.ebook-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.ebook-author {
    font-size: 1.2rem;
    margin: 0 0 25px 0;
    opacity: 0.9;
}

.ebook-label {
    font-weight: 600;
    margin-right: 8px;
}

.ebook-value {
    font-weight: 400;
}

.ebook-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.ebook-meta-item {
    font-size: 0.95rem;
    opacity: 0.9;
}

.ebook-taxonomy {
    margin-top: 25px;
}

.ebook-categories,
.ebook-tags {
    margin-bottom: 15px;
}

.ebook-category-link,
.ebook-tag-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    margin: 0 8px 8px 0;
    transition: all 0.2s ease;
}

.ebook-category-link:hover,
.ebook-tag-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

/* Content Sections */
.ebook-description,
.ebook-reader-section,
.ebook-related-section,
.ebook-comments-section {
    padding: 40px;
    border-bottom: 1px solid #e9ecef;
}

.ebook-comments-section {
    border-bottom: none;
}

.ebook-description h2,
.ebook-reader-section h2,
.ebook-related-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 25px 0;
    color: #333;
}

.ebook-description-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

/* Reader Section */
.ebook-reader-wrapper {
    margin: 30px 0;
}

.ebook-download-section {
    margin-top: 30px;
    text-align: center;
}

.ebook-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0073aa;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.ebook-download-btn:hover {
    background: #005a87;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

.ebook-download-icon {
    font-size: 18px;
}

.ebook-no-file-notice {
    background: #fff3cd;
    color: #856404;
    padding: 20px;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    text-align: center;
}

/* Related Ebooks */
.ebook-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.ebook-related-item {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.ebook-related-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ebook-related-cover {
    width: 100%;
    height: 200px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ebook-related-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ebook-related-placeholder {
    background: linear-gradient(45deg, #e9ecef, #f8f9fa);
}

.ebook-related-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 15px 15px 8px 15px;
    color: #333;
    line-height: 1.3;
}

.ebook-related-author {
    font-size: 0.9rem;
    color: #666;
    margin: 0 15px 15px 15px;
}

/* Archive Page */
.ebook-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ebook-archive-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
}

.ebook-archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.ebook-archive-description {
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.ebook-archive-stats {
    font-size: 1rem;
    opacity: 0.8;
}

/* Filters */
.ebook-archive-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.ebook-filter-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ebook-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ebook-filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.ebook-filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    min-width: 150px;
}

.ebook-view-toggle {
    margin-left: auto;
    display: flex;
    gap: 5px;
}

.ebook-view-btn {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ebook-view-btn.active,
.ebook-view-btn:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.ebook-view-icon {
    font-size: 14px;
}

/* Archive Grid */
.ebook-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.ebook-archive-grid.view-list {
    grid-template-columns: 1fr;
}

.ebook-archive-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.ebook-archive-grid.view-list .ebook-archive-item {
    transform: none;
}

.ebook-archive-grid.view-list .ebook-archive-item:hover {
    transform: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.ebook-item-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ebook-archive-grid.view-list .ebook-item-content {
    flex-direction: row;
}

.ebook-item-cover {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    overflow: hidden;
}

.ebook-archive-grid.view-list .ebook-item-cover {
    width: 150px;
    height: 200px;
    flex-shrink: 0;
}

.ebook-item-link {
    display: block;
    width: 100%;
    height: 100%;
}

.ebook-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ebook-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #e9ecef, #f8f9fa);
}

.ebook-item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ebook-item-cover:hover .ebook-item-actions {
    opacity: 1;
}

.ebook-action-btn {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ebook-action-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    transform: scale(1.1);
}

.ebook-action-icon {
    font-size: 14px;
}

.ebook-item-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ebook-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.ebook-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ebook-item-title a:hover {
    color: #0073aa;
}

.ebook-item-author {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 12px 0;
}

.ebook-item-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.ebook-item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #666;
}

.ebook-item-date {
    white-space: nowrap;
}

.ebook-item-categories {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.ebook-category-tag {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.ebook-category-tag:hover {
    background: #0073aa;
    color: #fff;
}

.ebook-item-actions-bottom {
    margin-top: auto;
}

.ebook-read-more-btn {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ebook-read-more-btn:hover {
    background: #005a87;
    color: #fff;
    transform: translateY(-1px);
}

/* Empty state */
.ebook-archive-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.ebook-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.ebook-archive-empty h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.ebook-browse-all-btn {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.2s ease;
}

.ebook-browse-all-btn:hover {
    background: #005a87;
    color: #fff;
    transform: translateY(-2px);
}

/* Pagination */
.ebook-archive-pagination {
    text-align: center;
    margin-top: 40px;
}

.ebook-archive-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ebook-archive-pagination .page-numbers:hover,
.ebook-archive-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ebook-single-container,
    .ebook-archive-container {
        padding: 15px;
    }
    
    .ebook-header {
        padding: 30px 20px;
    }
    
    .ebook-header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .ebook-cover {
        width: 150px;
        height: 225px;
        margin: 0 auto;
    }
    
    .ebook-title {
        font-size: 2rem;
    }
    
    .ebook-meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .ebook-description,
    .ebook-reader-section,
    .ebook-related-section,
    .ebook-comments-section {
        padding: 30px 20px;
    }
    
    .ebook-related-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .ebook-archive-header {
        padding: 30px 15px;
    }
    
    .ebook-archive-title {
        font-size: 2rem;
    }
    
    .ebook-filter-section {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .ebook-filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .ebook-view-toggle {
        margin-left: 0;
        align-self: center;
    }
    
    .ebook-archive-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ebook-archive-grid.view-list .ebook-item-content {
        flex-direction: column;
    }
    
    .ebook-archive-grid.view-list .ebook-item-cover {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .ebook-title {
        font-size: 1.5rem;
    }
    
    .ebook-archive-title {
        font-size: 1.5rem;
    }
    
    .ebook-description,
    .ebook-reader-section,
    .ebook-related-section,
    .ebook-comments-section {
        padding: 20px 15px;
    }
    
    .ebook-archive-filters {
        padding: 15px;
    }
    
    .ebook-item-info {
        padding: 15px;
    }
}

