/**
 * Chapters Page V2 - Compact Cards Design
 * File: platform/assets/css/chapters.css
 */

/* ========================================
   VARIABLES
   ======================================== */
:root {
    --chapter-primary: #667eea;
    --chapter-secondary: #764ba2;
    --chapter-success: #10b981;
    --chapter-warning: #f59e0b;
    --chapter-info: #3b82f6;
}

/* ========================================
   HERO SECTION
   ======================================== */
.chapters-hero-v2 {
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.hero-badge-v2 {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--chapter-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pricing Toggle */
.pricing-toggle-v2 {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.625rem 1.25rem;
    border-radius: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider-v2 {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e2e8f0;
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider-v2:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider-v2 {
    background: linear-gradient(135deg, var(--chapter-primary), var(--chapter-secondary));
}

.toggle-switch input:checked + .toggle-slider-v2:before {
    transform: translateX(24px);
}

/* ========================================
   SUBSCRIBE WORKFLOW ANIMATION (COMPACT)
   ======================================== */
.subscribe-workflow-v2 {
    position: relative;
}

.workflow-timeline-v2 {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.workflow-step-v2 {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

.workflow-step-v2:nth-child(1) { animation-delay: 0s; }
.workflow-step-v2:nth-child(3) { animation-delay: 0.2s; }
.workflow-step-v2:nth-child(5) { animation-delay: 0.4s; }

.step-number-v2 {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--chapter-primary), var(--chapter-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.step-content-v2 {
    background: white;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.step-content-v2:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.step-icon-v2 {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.75rem;
    color: white;
}

.gradient-primary {
    background: linear-gradient(135deg, var(--chapter-primary), var(--chapter-secondary));
}

.gradient-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gradient-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.gradient-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.step-title-v2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.375rem;
}

.step-description-v2 {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

/* Workflow Connector */
.workflow-connector-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chapter-primary);
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* Workflow Stats (COMPACT) */
.workflow-stats-v2 {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.stat-item-v2 {
    padding: 0.75rem;
}

.stat-value-v2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--chapter-primary);
    line-height: 1;
    margin-bottom: 0.375rem;
}

.stat-label-v2 {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 600;
}

/* ========================================
   CHAPTER CARDS - COMPACT DESIGN
   ======================================== */
.chapters-grid-v2 {
    background: white;
}

.chapter-card-v2 {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chapter-card-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--chapter-primary), var(--chapter-secondary));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.chapter-card-v2:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--chapter-primary);
}

.chapter-card-v2:hover::before {
    transform: scaleX(1);
}

.chapter-card-v2.popular {
    border-color: var(--chapter-primary);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.15);
}

/* Popular Badge (SMALLER) */
.popular-badge-v2 {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--chapter-primary), var(--chapter-secondary));
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    z-index: 1;
}

.popular-badge-v2 i {
    font-size: 0.625rem;
}

/* Card Header (COMPACT) */
.card-header-v2 {
    text-align: center;
    margin-bottom: 1rem;
}

.chapter-icon-v2 {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chapter-primary), var(--chapter-secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.25);
    transition: all 0.3s ease;
}

.chapter-card-v2:hover .chapter-icon-v2 {
    transform: scale(1.08) rotate(3deg);
}

.chapter-title-v2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0;
    line-height: 1.3;
}

/* Features List (COMPACT - 4 items max) */
.card-features-v2 {
    flex: 1;
    margin-bottom: 1rem;
}

.feature-item-v2 {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    color: #475569;
}

.feature-item-v2 i {
    color: var(--chapter-success);
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* Pricing (COMPACT) */
.card-pricing-v2 {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
}

.price-display-v2 {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.price-amount-v2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--chapter-primary);
    line-height: 1;
}

.price-period-v2 {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.savings-badge-v2 {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.625rem;
    border-radius: 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
}

/* Action Buttons (COMPACT) */
.card-actions-v2 {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-subscribe-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--chapter-primary), var(--chapter-secondary));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.btn-subscribe-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
    color: white;
}

.btn-subscribe-v2 i {
    font-size: 1rem;
}

.btn-learn-more-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    background: transparent;
    color: var(--chapter-primary);
    border: none;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-learn-more-v2:hover {
    background: #f1f5f9;
    color: var(--chapter-primary);
}

/* ========================================
   BENEFITS SECTION
   ======================================== */
.chapters-benefits-v2 {
    background: #f8fafc;
}

.benefit-card-v2 {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.benefit-card-v2:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.benefit-icon-v2 {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: white;
}

.benefit-card-v2 h5 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.625rem;
}

.benefit-card-v2 p {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   FINAL CTA
   ======================================== */
.chapters-cta-v2 {
    background: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1199.98px) {
    /* 4 columns on large desktop */
    .chapters-grid-v2 .col-xl-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

@media (max-width: 991.98px) {
    .workflow-timeline-v2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .workflow-connector-v2 {
        display: none;
    }
    
    .chapter-card-v2 {
        padding: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .chapters-hero-v2 {
        padding: 2.5rem 0 1.5rem;
    }
    
    .pricing-toggle-v2 {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .step-content-v2 {
        padding: 1.25rem 0.875rem;
    }
    
    .step-icon-v2 {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .step-title-v2 {
        font-size: 1rem;
    }
    
    .price-amount-v2 {
        font-size: 1.5rem;
    }
    
    .stat-value-v2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .hero-badge-v2 {
        font-size: 0.75rem;
        padding: 0.5rem 0.875rem;
    }
    
    .display-3 {
        font-size: 1.75rem;
    }
    
    .chapter-card-v2 {
        padding: 1rem;
    }
    
    .chapter-icon-v2 {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .chapter-title-v2 {
        font-size: 1rem;
    }
}