.flowchart-section {
    width: 100%;
    padding: 5rem 3rem;
    background-color: #1a1a2e;
    /* Dark blue background */
    color: #ffffff;
    /* White text for dark background */
    overflow-x: hidden;
}

/* For full-width layout, remove grid-template-columns for .flowchart-layout */
.flowchart-layout {
    display: flex;
    /* Changed to flex for full width */
    justify-content: center;
    /* Center content horizontally */
    align-items: center;
    width: 100%;
    max-width: none;
    /* Full width */
    margin: 0;
}

.flowchart-diagram-col {
    min-width: 0;
    flex-grow: 1;
    /* Allow diagram to take available space */
}

/* .flowchart-text-col is now moved outside, so this block can be removed or repurposed if needed */

.flowchart-heading {
    color: #f97316;
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.flowchart-desc {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.95;
}

/* .flowchart-content is no longer relevant with full-width flowchart layout */

/* LEFT — FLOWCHART */
.flowchart-diagram {
    width: 100%;
    height: 600px;
    /* Adjusted height */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* RIGHT — TEXT (This section is now for "How it works" below the flowchart) */
.flowchart-text {
    text-align: left;
}

.flowchart-text h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.flowchart-text p {
    font-size: 1rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.flowchart-text ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}

.flowchart-text ul li {
    font-size: 0.95rem;
    color: #e0e0e0;
    margin-bottom: 0.6rem;
    padding-left: 22px;
    position: relative;
}

.flowchart-text ul li::before {
    content: '•';
    color: #f97316;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* SVG */
#flowchart-container {
    width: 100%;
    height: 100%;
}

.flowchart-section svg {
    display: block;
}

/* Flowchart wrapper layout (inputs | center | outputs) */
.flowchart-wrapper {
    width: 100%;
    max-width: 1200px;
    /* Constrain inner content if needed */
    margin: 0 auto;
    /* Center the wrapper */
    padding: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 120px;
    /* Increased gap for full width */
    align-items: center;
    position: relative;
}

.flow-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Compact gap */
    justify-content: center;
}


.flow-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 12px;
}


.flow-node {
    display: flex;
    flex-direction: row;
    /* Horizontal layout: Logo Left, Text Right */
    align-items: center;
    gap: 12px;
    height: auto;
    width: 20vw;
    min-width: 130px;
    /* Reduced width */
    border-radius: 8px;
    padding: 10px 16px;
    /* Compact padding */
    justify-content: flex-start;
    /* Revert to start alignment */
    background-color: #1e293b;
    border: 1px solid #334155;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.flow-node span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
    text-align: left;
    /* Left align text */
    line-height: normal;
    white-space: nowrap;
}


.flow-node:hover {
    transform: translateY(-4px);
    background-color: #263345;
    /* Slightly lighter card on hover */
    border-color: #f97316;
    /* Orange highlight border */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.flow-node:hover span {
    color: #ffffff;
}


.flow-node img {
    width: 36px;
    /* Slightly smaller for horizontal layout */
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}


.flow-node-out {
    display: flex;
    flex-direction: row;
    /* Horizontal layout: Logo Left, Text Right */
    align-items: center;
    gap: 12px;
    height: auto;
    width: 20vw;
    min-width: 100px;
    /* Reduced width */
    border-radius: 8px;
    padding: 10px 16px;
    /* Compact padding */
    justify-content: flex-start;
    /* Revert to start alignment */
    background-color: #1e293b;
    border: 1px solid #334155;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.flow-node-out img {
    width: 60px;
    /* Slightly smaller for horizontal layout */
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}


.flow-center {
    width: 180px;
    /* Smaller central node */
    height: 180px;
    border-radius: 50%;
    background: #ffffff;
    color: #222;
    border: 4px solid #f97316;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.flow-center img {
    width: 120px;
    /* Smaller logo */
    margin-bottom: 8px;
}

.flow-center strong {
    font-size: 14px;
    /* Smaller text */
}

.flow-center p {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.flow-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    /* Lines behind nodes */
}

/* Apply arrowheads */
.flow-lines path[stroke="#4da3ff"] {
    /* Blue input lines */
    marker-end: url(#arrow-blue);
    stroke-dasharray: 6 6;
    animation: flowAnimation 1s linear infinite;
    /* Animate dashed lines */
}

.flow-lines path[stroke="#f97316"] {
    /* Orange output lines */
    marker-end: url(#arrow-orange);
}

@keyframes flowAnimation {
    from {
        stroke-dashoffset: 24;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* Styles for text outside the flowchart diagram */
.flowchart-text-outside-section {
    background-color: #1a1a2e;
    /* Dark blue background */
    padding: 2rem 3rem;
    text-align: center;
    color: #ffffff;
    /* White text for dark background */
    border-bottom: none;
    /* No border for dark theme */
}

.flowchart-text-outside-section .flowchart-heading {
    color: #f97316;
    /* Orange color for heading */
    margin-bottom: 1rem;
}

.flowchart-text-outside-section .flowchart-desc {
    color: #ffffff;
    /* White text for dark background */
    max-width: 800px;
    margin: 0 auto;
}

/* MOBILE */
@media (max-width: 1100px) {
    /* No longer applies directly as flowchart-content is removed */
}

@media (max-width: 1000px) {
    .flowchart-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .flow-center {
        margin: 40px auto;
    }

    .flowchart-text-outside-section {
        padding: 1.5rem;
    }
}

@media (max-width: 950px) {
    .flowchart-section {
        padding: 4rem 1.5rem;
    }
}

/* NEW mobile styles */
@media (max-width: 768px) {
    .flowchart-layout {
        flex-direction: column;
        /* Stack columns on small screens */
    }

    /* .flowchart-text-col is removed */
    .flowchart-heading,
    .flowchart-desc {
        text-align: center;
    }

    .flowchart-wrapper {
        grid-template-columns: 1fr;
        /* Stack input/output columns */
    }

    .flow-column {
        align-items: center;
        /* Center nodes in stacked columns */
    }

    .flow-center {
        margin: 2rem auto;
        /* Center central node */
    }
}