/* ============================
   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(120deg, #c0392b 0%, #e74c3c 40%, #e67e22 100%);
    color: white;
    padding: 0;
    margin: 2rem 0;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(192, 57, 43, 0.35);
    overflow: hidden;
}

.bundle-banner .container {
    padding: 0;
}

.bundle-content {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0;
}

.bundle-text {
    padding: 2rem 2.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.bundle-text h2 {
    font-size: 1.6rem;
    margin: 0 0 0.4rem 0;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.bundle-text p {
    margin: 0 0 1rem 0;
    font-size: 0.92rem;
    opacity: 0.85;
    line-height: 1.4;
}

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

.bundle-note {
    background: rgba(255, 255, 255, 0.18);
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    white-space: nowrap;
}

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

.original-price {
    text-decoration: line-through;
    opacity: 0.6;
    font-size: 1rem;
    font-weight: 500;
}

.bundle-price {
    font-size: 1.9rem;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: -0.5px;
    line-height: 1;
}

.savings {
    background: #ffd700;
    color: #7a4800;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.8rem;
    white-space: nowrap;
}

.bundle-action {
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    align-self: stretch;
}

.btn-bundle-purchase {
    display: inline-block;
    background: #ffd700;
    color: #7a3800 !important;
    border: none;
    padding: 0.85rem 1.8rem;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    text-decoration: none !important;
    white-space: nowrap;
    text-align: center;
}

.btn-bundle-purchase:hover {
    background: #ffe433;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    color: #7a3800 !important;
    text-decoration: none !important;
}

/* Featured Bundle treatment — escalates the banner so it reads as the
   "first" item readers should consider regardless of the active toggle. */
.bundle-banner-featured {
    margin: 1rem 0 2.5rem;
    border: 3px solid #ffd700;
    box-shadow: 0 12px 48px rgba(192, 57, 43, 0.4);
    transform: scale(1.01);
}
.bundle-featured-badge {
    display: inline-block;
    background: #ffd700;
    color: #7a3800;
    padding: 5px 14px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.bundle-banner-featured .bundle-text h2 {
    font-size: 1.85rem;
}
@media (max-width: 720px) {
    .bundle-banner-featured { transform: none; }
}

/* 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 {
    display: inline-block;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white !important;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

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

.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 {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .bundle-text {
        padding: 1.5rem 1.5rem 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .bundle-action {
        padding: 1.25rem 1.5rem 1.5rem;
    }

    .bundle-pricing {
        justify-content: center;
    }
    
    .bundle-text h2 {
        font-size: 1.4rem;
    }
    
    .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.3rem;
    }
    
    .modal-content {
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    .bundle-price-large {
        font-size: 1.8rem;
    }
}

/* ============================
   P0 Additions: First Book + Reading Order Toggle
   ============================ */

/* Your First Book Section */
.first-book-section {
    padding: 40px 0 30px;
}

.first-book-wrapper {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.first-book-wrapper h2 {
    font-family: var(--font-secondary, serif);
    font-size: 1.6rem;
    color: #1a2e4a;
    margin-bottom: 8px;
}

.first-book-intro {
    font-size: 1rem;
    color: #5a6a7e;
    margin-bottom: 24px;
}

.first-book-highlight {
    background: #ffffff;
    border-radius: 12px;
    padding: 28px 24px;
    text-align: left;
    border: 2px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.first-book-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: #8a6d1b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.first-book-highlight h3 {
    font-size: 1.2rem;
    color: #1a2e4a;
    margin-bottom: 6px;
}

.first-book-meta {
    font-size: 0.9rem;
    color: #d4af37;
    font-weight: 600;
    margin-bottom: 12px;
}

.first-book-why {
    font-size: 0.9rem;
    color: #5a6a7e;
    line-height: 1.6;
    margin-bottom: 16px;
}

.btn-first-book {
    display: inline-block;
    padding: 10px 22px;
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    color: #111 !important;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #a88734;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-first-book:hover {
    background: linear-gradient(to bottom, #f0c14b, #e5a80a);
    text-decoration: none;
    color: #111 !important;
}

/* Reading Order Toggle */
.reading-order-section {
    padding: 40px 0 24px;
    text-align: center;
}

.reading-order-heading {
    font-family: var(--font-secondary, serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #1a2e4a;
    margin: 0 0 8px;
}

.reading-order-tagline {
    color: #5a6a7e;
    margin: 0 0 1.25rem;
    font-size: 1rem;
}

/* Modern Guides callout — replaces the original "first-book-section". */
.modern-guides-section {
    padding: 24px 0 8px;
}
.modern-guides-heading {
    font-family: var(--font-secondary, serif);
    font-size: 1.4rem;
    color: #1a2e4a;
    text-align: center;
    margin: 0 0 6px;
}
.modern-guides-intro {
    text-align: center;
    color: #5a6a7e;
    margin: 0 auto 1.75rem;
    max-width: 640px;
}
.modern-guides-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 940px;
    margin: 0 auto;
}
.modern-guide-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(46, 78, 126, 0.12);
    border-radius: 12px;
    padding: 28px 24px;
    transition: box-shadow 0.2s ease, transform 0.18s ease;
}
.modern-guide-card:hover {
    box-shadow: 0 6px 20px rgba(46, 78, 126, 0.12);
    transform: translateY(-2px);
}
.modern-guide-rank {
    position: absolute;
    top: 14px;
    right: 18px;
    font-family: var(--font-secondary, serif);
    font-size: 1.5rem;
    color: rgba(46, 78, 126, 0.18);
    font-weight: 700;
    letter-spacing: 0.04em;
}
.modern-guide-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.modern-guide-badge-now {
    background: #e8f4e8;
    color: #2e7d32;
}
.modern-guide-badge-soon {
    background: #fff3e0;
    color: #e65100;
}
.modern-guide-card h4 {
    margin: 0 0 8px;
    color: #1a2e4a;
    font-family: var(--font-secondary, serif);
    font-size: 1.15rem;
    line-height: 1.3;
}
.modern-guide-meta {
    color: #6c7a8a;
    font-size: 0.88rem;
    margin: 0 0 12px;
}
.modern-guide-why {
    color: #2e4e7e;
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 18px;
}
.btn-modern-guide {
    display: inline-block;
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    color: #111 !important;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 6px;
    border: 1px solid #a88734;
    text-decoration: none !important;
    font-size: 0.92rem;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.btn-modern-guide:hover {
    background: linear-gradient(to bottom, #f0c14b, #e5a80a);
    box-shadow: 0 2px 8px rgba(168, 135, 52, 0.4);
    text-decoration: none !important;
}
@media (max-width: 720px) {
    .modern-guides-grid { grid-template-columns: 1fr; }
}

/* Single-column variant — used when the Roadmap stands alone above the
   pre-orders split below. */
.modern-guides-grid-single {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

/* Pre-orders split — Books on the left, Courses on the right.
   Visually distinguishes book pre-orders from course pre-orders so
   readers don't mistake the Skool course for an upcoming book. */
.preorders-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 2.5rem;
    max-width: 940px;
    margin-left: auto;
    margin-right: auto;
}
.preorders-column { min-width: 0; }
.preorders-heading {
    font-family: var(--font-secondary, serif);
    font-size: 1.1rem;
    color: #1a2e4a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(46, 78, 126, 0.15);
}

.modern-guide-badge-course {
    background: #fdf7e8;
    color: #b8860b;
    border: 1px solid #d4af37;
}
.preorder-course-card {
    border-color: rgba(212, 175, 55, 0.5);
    background: linear-gradient(135deg, #fdfbf3 0%, #ffffff 100%);
}
.preorder-course-card .modern-guide-rank {
    color: rgba(212, 175, 55, 0.5);
}
.btn-modern-guide-course {
    background: #1a2e4a !important;
    color: #fff !important;
    border-color: #1a2e4a !important;
}
.btn-modern-guide-course:hover {
    background: #d4af37 !important;
    border-color: #d4af37 !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4) !important;
}

@media (max-width: 720px) {
    .preorders-split { grid-template-columns: 1fr; gap: 1.5rem; }
}

.reading-order-toggle {
    display: inline-flex;
    gap: 0;
    background: #e9ecef;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 12px;
}

.order-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: #5a6a7e;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.order-tab.active {
    background: #2e4e7e;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(46, 78, 126, 0.25);
}

.order-tab:hover:not(.active) {
    color: #2e4e7e;
}

.reading-order-desc {
    font-size: 0.9rem;
    color: #7a8a9e;
}

@media (max-width: 768px) {
    .first-book-highlight {
        padding: 20px 16px;
    }

    .reading-order-toggle {
        flex-direction: column;
    }

    .order-tab {
        width: 100%;
    }
}
