/* ============================
   Books Page Styling
   ============================ */

/* 基础样式 */
.books-main {
    background-image: url('./assets/images/front-page/homepage/background.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 100%;
    position: relative;
    min-height: 100vh;
}

.books-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(3px);
    z-index: 1;
}

.books-main > * {
    position: relative;
    z-index: 2;
}

/* Hero Section */
.books-hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.books-hero h1 {
    font-size: 3rem;
    color: #1e3c72;
    margin-bottom: 1rem;
    font-weight: 700;
}

.books-hero .subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0;
}

/* Bundle Banner */
.bundle-banner {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 2rem 0;
    margin: 2rem 0;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.3);
}

.bundle-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.bundle-text h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.bundle-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.bundle-pricing {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bundle-note {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.price-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.original-price {
    text-decoration: line-through;
    opacity: 0.7;
    font-size: 1.2rem;
}

.bundle-price {
    font-size: 2rem;
    font-weight: 700;
    color: #ffd700;
}

.savings {
    background: #ffd700;
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.9rem;
}

.btn-bundle-purchase {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #333;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.btn-bundle-purchase:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.5);
}

/* Books Display */
.books-display {
    padding: 2rem 0;
}

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

.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

/* 移除hover效果 */

.book-thumb {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.book-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* 移除hover效果 */

.book-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    z-index: 3;
}

.book-tag.beginner {
    background: #28a745;
}

.book-tag.intermediate {
    background: #ffc107;
    color: #333;
}

.book-tag.advanced {
    background: #dc3545;
}

.book-tag.expert {
    background: #6f42c1;
}

.book-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* 移除hover效果 */

.book-overlay-content {
    background: white;
    color: #333;
    border-radius: 15px;
    overflow: hidden;
    max-width: 800px;
    width: 90%;
    display: flex;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
}

.book-overlay-image {
    flex: 0 0 300px;
    height: 400px;
}

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

.book-overlay-info {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-overlay-title {
    font-size: 1.8rem;
    color: #1e3c72;
    margin-bottom: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* 移除hover效果 */

.book-overlay-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.book-overlay-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.book-overlay-meta span {
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

.book-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.book-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-buy-single,
.btn-add-bundle {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-buy-single {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.btn-buy-single:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

.btn-add-bundle {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #333;
}

.btn-add-bundle:hover {
    background: linear-gradient(135deg, #ffed4a 0%, #ffd700 100%);
}

.book-info {
    padding: 1.5rem;
}

.book-title {
    font-size: 1.3rem;
    color: #1e3c72;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* 移除hover效果 */

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

.book-author {
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Bundle Modal */
.bundle-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    color: #1e3c72;
    margin: 0;
    font-size: 1.8rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 2rem;
}

.bundle-offer {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border-radius: 15px;
}

.bundle-offer h3 {
    color: #1e3c72;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.bundle-savings {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.savings-text {
    text-decoration: line-through;
    color: #999;
    font-size: 1.1rem;
}

.bundle-price-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff6b6b;
}

.savings-percent {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-weight: 700;
}

.bundle-includes h4 {
    color: #1e3c72;
    margin-bottom: 1rem;
}

.bundle-book-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

.bundle-book-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.bundle-book-list li:last-child {
    border-bottom: none;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-purchase-bundle {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-purchase-bundle:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    transform: translateY(-2px);
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .books-hero h1 {
        font-size: 2.5rem;
    }
    
    .books-hero .subtitle {
        font-size: 1rem;
    }
    
    .bundle-content {
        flex-direction: column;
        text-align: center;
    }
    
    .bundle-text h2 {
        font-size: 1.8rem;
    }
    
    .book-grid {
        grid-template-columns: 1fr;
    }
    
    .bundle-savings {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .bundle-price-large {
        font-size: 2rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .book-overlay-content {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .book-overlay-image {
        flex: none;
        height: 250px;
    }
    
    .book-overlay-info {
        padding: 1.5rem;
    }
    
    .book-overlay-title {
        font-size: 1.5rem;
    }
    
    .book-overlay-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .books-hero h1 {
        font-size: 2rem;
    }
    
    .mode-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .bundle-text h2 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    .bundle-price-large {
        font-size: 1.8rem;
    }
}
