/**
 * Finale Section Styles
 * Bringing everything together with Stripe-inspired elegance
 */

/* ===========================
   Section Container & Layout
   =========================== */

.finale-section {
    position: relative;
    min-height: 100vh;
    padding: 4rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 50%, #ffffff 100%);
    overflow: hidden;
}

.section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

/* ===========================
   Section Header
   =========================== */

.section-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 6rem;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #0f172a;
    margin: 0 0 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #017ACA 0%, #0096E5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.375rem;
    line-height: 1.7;
    color: #475569;
    margin: 0;
}

/* ===========================
   Platform Showcase
   =========================== */

.platform-showcase {
    position: relative;
    min-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6rem;
}

.showcase-content {
    position: relative;
    width: 100%;
    max-width: 1600px;
    height: 800px;
}

/* Platform Source */
.platform-source {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.source-logo {
    width: 70px;
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 12px rgba(1, 122, 202, 0.25));
}


/* Connection Network */
.connection-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.network-line {
    /* Lines are initialized and animated via JavaScript */
    stroke-linecap: round;
    fill: none;
    stroke: #017ACA;
    stroke-opacity: 0.4;
    stroke-width: 1.5;
}

/* Stagger line animations - vein pattern */
.line-trunk { animation-delay: 0s; animation-duration: 0.8s; }
.dot-trunk { animation-delay: 0.8s; }

/* CSS timing classes removed - all timing controlled by JavaScript */

.network-dot {
    opacity: 0;
    /* Dots appear when lines reach them - controlled by JS */
}

@keyframes dotAppear {
    to {
        opacity: 1;
    }
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
}

/* Feature Nodes */
.feature-node {
    position: absolute;
    transform: translate(-50%, -50%) scale(0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 5;
    opacity: 0;
    /* Animation controlled by JavaScript */
}

/* Position nodes based on data attributes - using percentages that match SVG viewBox (1400x600) */
/* Row 1: Payments (top left) and Messages (top right) */
.feature-node[data-row="1"][data-position="left"] {
    top: 41.5%; /* 250/600 - Payments */
    left: 22.86%; /* 320/1400 */
}

.feature-node[data-row="1"][data-position="right"] {
    top: 41.5%; /* 250/600 - Messages */
    left: 77.14%; /* 1080/1400 */
}

/* Row 2: Files (bottom left) and Analytics (bottom right) */
.feature-node[data-row="2"][data-position="left"] {
    top: 66.5%; /* 400/600 - Files */
    left: 14.29%; /* 200/1400 */
}

.feature-node[data-row="2"][data-position="right"] {
    top: 66.5%; /* 400/600 - Analytics */
    left: 85.71%; /* 1200/1400 */
}

/* Row 3: Contracts (center-left) and Clients (center-right) */
.feature-node[data-row="3"][data-position="left"] {
    top: 84.5%; /* 510/600 - Contracts */
    left: 35.71%; /* 500/1400 */
}

.feature-node[data-row="3"][data-position="right"] {
    top: 84.5%; /* 510/600 - Clients */
    left: 64.29%; /* 900/1400 */
}

.node-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.5rem;
    color: #017ACA;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.node-icon:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(1, 122, 202, 0.15);
    border-color: rgba(1, 122, 202, 0.3);
}

.node-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: -0.01em;
}

/* ===========================
   Benefits Grid
   =========================== */

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 6rem;
}

.benefit-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 91, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.benefit-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #017ACA 0%, #0096E5 100%);
    color: #ffffff;
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.benefit-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.75rem;
    letter-spacing: -0.01em;
}

.benefit-description {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #64748b;
    margin: 0;
}

/* ===========================
   Stats Bar
   =========================== */

.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 3rem;
    background: rgba(99, 91, 255, 0.05);
    border: 1px solid rgba(99, 91, 255, 0.1);
    border-radius: 16px;
    margin-bottom: 6rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #017ACA 0%, #0096E5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, transparent, rgba(99, 91, 255, 0.2), transparent);
}

/* ===========================
   Final CTA
   =========================== */

.final-cta {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.final-cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 1rem;
}

.final-cta-description {
    font-size: 1.25rem;
    color: #475569;
    margin: 0 0 2.5rem;
}

.final-cta-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.final-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.final-cta-button--primary {
    background: linear-gradient(135deg, #017ACA 0%, #0096E5 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(99, 91, 255, 0.3);
}

.final-cta-button--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 91, 255, 0.4);
}

.final-cta-note {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0;
}

/* ===========================
   Background Elements
   =========================== */

.section-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 1;
    animation: floatOrb 25s ease-in-out infinite;
}

.bg-orb-finale-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(1, 122, 202, 0.12) 0%, transparent 70%);
    top: 20%;
    left: -250px;
}

.bg-orb-finale-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 150, 229, 0.10) 0%, transparent 70%);
    bottom: 30%;
    right: -200px;
    animation-delay: -12s;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(40px, -40px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

.bg-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(250, 251, 252, 0.5) 70%);
}

/* ===========================
   Animations
   =========================== */

[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 1024px) {
    .platform-showcase {
        min-height: 600px;
    }

    .showcase-content {
        max-width: 1200px;
        height: 650px;
        transform: scale(0.9);
        transform-origin: center top;
    }

    .node-icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    
    .node-label {
        font-size: 0.8125rem;
    }
}

@media (max-width: 768px) {
    .finale-section {
        padding: 6rem 0;
    }

    .section-header {
        margin-bottom: 4rem;
    }

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

    .section-description {
        font-size: 1.125rem;
    }

    .platform-showcase {
        display: none; /* Hide on mobile and small screens */
    }

    .showcase-content {
        max-width: 100%;
        height: 800px;
        transform: scale(0.95);
        transform-origin: center top;
        margin: 0 auto;
    }

    .node-icon {
        width: 52px;
        height: 52px;
        font-size: 1.1rem;
    }

    .node-label {
        font-size: 0.8rem;
    }
    
    /* Adjust bottom row nodes to prevent them from dropping below dots */
    .feature-node[data-row="3"][data-position="left"],
    .feature-node[data-row="3"][data-position="right"] {
        top: 84.5%; /* Fine-tune Y position */
    }

    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 4rem;
    }

    .stats-bar {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem;
        margin-bottom: 4rem;
    }

    .stat-divider {
        width: 60px;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(99, 91, 255, 0.2), transparent);
    }

    .final-cta-title {
        font-size: 1.75rem;
    }

    .final-cta-description {
        font-size: 1rem;
    }

    .final-cta-button {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
    }
}

@media (max-width: 480px) {
    .section-container {
        padding: 0 1rem;
    }

    .benefit-card {
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }
    
    .platform-showcase {
        min-height: 600px;
    }
    
    .showcase-content {
        height: 800px;
        transform: scale(0.85);
    }
    
    /* Further adjust bottom row for very small screens */
    .feature-node[data-row="3"][data-position="left"],
    .feature-node[data-row="3"][data-position="right"] {
        top: 84%;
    }
    
    .node-icon {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
    
    .node-label {
        font-size: 0.75rem;
    }
}

