/* 
 * Custom Elementor Process Steps Flow Widget Stylesheet
 * Brand: Brainfleck
 * Refined based on split Figma SVG curves (Top Round & Bottom Round)
 * Uses proportional aspect-ratio scaling to prevent vertical stretching
 */

.bf-process-flow-wrapper {
    width: 100%;
    position: relative;
    overflow: visible;
}

.bf-process-flow {
    display: flex;
    position: relative;
    width: 100%;
    align-items: stretch;
    overflow: visible;
    z-index: 2;
    padding-top: 200px;
    padding-bottom: 200px;
    min-height: unset !important;
}

.bf-step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    text-align: center;
    text-decoration: none;
    color: inherit;
    outline: none;
    z-index: 2;
    transition: all 0.3s ease;
    height: 273.3px !important;
}

.bf-step-item-wrapper {
    position: absolute;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bf-step-item.bf-pos-bottom .bf-step-item-wrapper {
    top: 0;
    padding-top: 75px;
}

.bf-step-item.bf-pos-top .bf-step-item-wrapper {
    bottom: 0;
    padding-bottom: 75px;
}

/* Three vertical zones per column to align circles perfectly on the centerline */
.bf-step-text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    z-index: 10;
}

.bf-step-text-container:empty {
    display: flex; /* keep taking up space to center the circle */
}

.bf-step-text-top {
    justify-content: flex-end; /* Align top text content close to the middle circle */
}

.bf-step-text-bottom {
    justify-content: flex-start; /* Align bottom text content close to the middle circle */
}

.bf-step-text-container.bf-step-text-top p.bf-step-desc {
    margin-bottom: 2em;
}

.bf-step-content {
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Center circles aligned vertically on desktop */
.bf-step-circle-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    flex-shrink: 0;
    margin: 15px 0; /* Balanced gap between circles and text wrappers */
}

.bf-step-circle-inner {
    border: 2px solid rgba(220, 166, 58, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0d0d0d; /* Matches dark gold/black circle fill from Figma */
    z-index: 5;
    transition: all 0.3s ease;
}

.bf-step-circle-inner i {
    color: #f7ba2b; /* Matches yellow fill color from Figma */
    transition: all 0.3s ease;
}

.bf-step-circle-inner svg {
    display: block;
    transition: all 0.3s ease;
}

.bf-step-circle-inner svg path {
    fill: #f7ba2b;
    transition: all 0.3s ease;
}

/* Concentric Rings (Ripple Effect) */
.bf-step-ring {
    position: absolute;
    border: 1.5px solid #282828; /* Matches dark grey ring stroke color from Figma */
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Sizes set dynamically via inline/Elementor, defaults styled below */
.bf-step-ring-1 { z-index: 4; }
.bf-step-ring-2 { z-index: 3; }
.bf-step-ring-3 { z-index: 2; }

/* Connecting Line Wrapper inside each column with proportional scaling */
.bf-connector-wrapper {
    position: absolute;
    left: -0.8px;
    right: -0.8px;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

.bf-connector-top {
        top: 0;
    bottom: calc(100% - 136.65px - 0.5px);
}

.bf-connector-bottom {
        top: calc(100% - 136.65px - 0.5px);
    bottom: 0;
}

.bf-connector-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.bf-connector-svg path {
    stroke: rgba(255, 255, 255, 0.1); /* stroke-opacity 0.1 from Figma */
    stroke-width: 2px;
    transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

/* HTML-based perfect circular dots, immune to SVG aspect-ratio stretching */
.bf-dot-main, .bf-dot-edge-start, .bf-dot-edge-end {
    position: absolute;
    border-radius: 50%;
    z-index: 6;
    pointer-events: none;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.bf-dot-main {
    width: 9px;
    height: 9px;
    background-color: #282828; /* Matches Figma default dot color */
}

.bf-dot-edge-start, .bf-dot-edge-end {
    width: 7px;
    height: 7px;
    background-color: #514e47; /* Matches Figma edge dot color */
}

/* Placement relative to the Top/Bottom connector boxes */
.bf-connector-top .bf-dot-main {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bf-connector-bottom .bf-dot-main {
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 50%);
}

.bf-connector-top .bf-dot-edge-start {
    left: 0;
    bottom: 0;
    transform: translate(-50%, 50%);
}

.bf-connector-top .bf-dot-edge-end {
    right: 0;
    bottom: 0;
    transform: translate(50%, 50%);
}

.bf-connector-bottom .bf-dot-edge-start {
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
}

.bf-connector-bottom .bf-dot-edge-end {
    right: 0;
    top: 0;
    transform: translate(50%, -50%);
}

/* Text Styling */
.bf-step-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    transition: color 0.3s ease;
}

.bf-step-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #a0a0a0;
}

/* Hover / Active State Animations (Pixel-perfect matches) */
.bf-step-item:hover .bf-step-circle-inner {
    background-color: rgba(247, 186, 43, 0.1); /* Matches Figma fill-opacity 0.1 highlight color */
    border-color: #f7ba2b; /* Glow to gold border */
    transform: scale(1.05);
}

.bf-step-item:hover .bf-step-circle-inner i {
    color: #ffffff; /* Icon changes to white on hover/active */
}

.bf-step-item:hover .bf-step-circle-inner svg path {
    fill: #ffffff;
}

/* Concentric rings glow on hover */
.bf-step-item:hover .bf-step-ring {
    border-color: rgba(247, 186, 43, 0.25);
}

.bf-step-item:hover .bf-step-ring-1 { transform: scale(1.04); }
.bf-step-item:hover .bf-step-ring-2 { transform: scale(1.08); }
.bf-step-item:hover .bf-step-ring-3 { transform: scale(1.12); }

/* Dot glows white/gold on hover */
.bf-step-item:hover .bf-dot-main {
    background-color: #f7ba2b;
    transform: translate(-50%, var(--hover-offset, -50%)) scale(1.3);
    box-shadow: 0 0 8px rgba(247, 186, 43, 0.6);
}

.bf-connector-top .bf-dot-main {
    --hover-offset: -50%;
}

.bf-connector-bottom .bf-dot-main {
    --hover-offset: 50%;
}

/* Subtle ring pulsing on hover */
@keyframes ring-pulse-anim {
    0% { transform: scale(1.08); opacity: 0.6; }
    50% { transform: scale(1.12); opacity: 0.9; }
    100% { transform: scale(1.08); opacity: 0.6; }
}

.bf-step-item:hover .bf-step-ring-2 {
    animation: ring-pulse-anim 2.5s infinite ease-in-out;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .bf-step-title {
        font-size: 18px;
    }
    .bf-step-desc {
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .bf-process-flow {
        flex-direction: column;
        align-items: stretch;
    }

    .bf-step-item {
        margin-bottom: 50px;
        padding-left: 95px;
        text-align: left;
        align-items: flex-start;
        justify-content: flex-start;
        min-height: auto !important; /* Cancel desktop heights */
        flex-direction: row; /* Layout elements naturally */
    }

    .bf-step-item.bf-step-last {
        margin-bottom: 0;
    }

    /* Hide desktop connector items */
    .bf-connector-wrapper, .bf-dot-main, .bf-dot-edge-start, .bf-dot-edge-end {
        display: none;
    }

    /* Vertical line down the left side */
    .bf-process-flow::before {
        content: '';
        position: absolute;
        left: 40px; /* Aligns with center of circles */
        top: 40px;
        bottom: 40px;
        width: 2px;
        background-color: rgba(255, 255, 255, 0.08);
        z-index: 1;
    }

    /* Restructure grid zones into standard block context */
    .bf-step-text-container {
        flex: none;
        width: auto;
        align-items: flex-start;
    }

    .bf-step-text-container:empty {
        display: none; /* Hide top or bottom empty container on mobile */
    }

    .bf-step-circle-container {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
    }

    .bf-step-circle-inner {
        width: 80px !important;
        height: 80px !important;
    }

    .bf-step-ring {
        display: none; /* Hide concentric rings on mobile to fit text space */
    }

    .bf-step-content {
        padding: 10px 0 0 15px;
        text-align: left;
    }

    .bf-step-title {
        margin-bottom: 8px;
    }
}
