/* Container for the circular ecosystem */
.ecosystem-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    height: auto;
    aspect-ratio: 1 / 1.3;
    margin: 0 auto;
    }

/* Shared styles for the item bubbles */
.ecosystem-item {
    position: absolute;
    top: 30%;
    left: 35%;
    width: 240px;
    height: 240px;
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    z-index: 1;
}

/* Each item can have its own colour via CSS custom property */
.ecosystem-item[data-color] {
    border: 4px solid var(--colour, #0058a7);
}

.ecosystem-item .number {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--colour, #0058a7);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.ecosystem-item .icon {
    /* Container for the image or icon.  If an <img> is used its
        dimensions will be set via a child rule below. */
    font-size: 2rem;
    color: var(--colour, #0058a7);
    margin-bottom: 0.5rem;
}

/* When using actual images instead of font icons, size and
    constrain them here.  The object-fit ensures they scale
    proportionally within the circular container. */
.ecosystem-item .icon img {
    width: 54px !important;
    height: 54px !important;
    /* object-fit: cover !important; */
    display: block;
    overflow: hidden !important;
}

.ecosystem-item h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.ecosystem-item p {
    font-size: 0.75rem;
    margin: 0;
    line-height: 1.4;
}

/* Positioning of each item around a circle using polar coordinates */
.ecosystem-item[data-step="1"] { --angle: -90deg; --colour: #0058a7; }
.ecosystem-item[data-step="2"] { --angle: -18deg; --colour: #0058a7; }
.ecosystem-item[data-step="3"] { --angle: 54deg;  --colour: #0058a7; }
.ecosystem-item[data-step="4"] { --angle: 126deg; --colour: #0058a7; }
.ecosystem-item[data-step="5"] { --angle: 198deg; --colour: #0058a7; }

.ecosystem-item {
    /* Move the bubble away from the centre along the circle radius */
    transform: rotate(var(--angle)) translate(0, -240px) rotate(calc(-1 * var(--angle)));
}

/* Arrows connecting the items */
.arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border-radius: 50%;
    z-index: 0;
    animation: pulse 8s linear infinite;
}

/* Position and orientation for each arrow.  Coordinates use percentages
    relative to the circular container.  The rotation angles orient the
    arrowheads tangentially along the circular flow (clockwise). */
/* Update arrow positions so each sits neatly between its two
    corresponding bubbles.  The coordinates are calculated from
    the midpoint of the centres of adjacent circles.  A small
    adjustment is applied to prevent overlap with the bubbles.
    The transform rotates the arrow so it points along the
    clockwise flow. */
.arrow[data-arrow="1"] {
    top: 18%;
    left: 12%;
    transform: rotate(-45deg);
}
.arrow[data-arrow="2"] {
    top: 8%;
    left: 65%;
    transform: rotate(30deg);
}
.arrow[data-arrow="3"] {
    top: 41%;
    left: 98%;
    transform: rotate(130deg);
}
.arrow[data-arrow="4"] {
    top: 74%;
    left: 63%;
    transform: rotate(152deg);
}
.arrow[data-arrow="5"] {
    top: 62%;
    left: 12%;
    transform: rotate(225deg);
}

/* Colour assignments for each arrow: colours correspond to their source
    service bubble.  A translucent background creates a soft halo effect
    without overwhelming the design. */
.arrow[data-arrow="1"] {
    color: #ff9f00;
    background-color: #e6b4003d;
}
.arrow[data-arrow="2"] {
    color: #ff9f00;
    background-color: #e6b4003d;
}
.arrow[data-arrow="3"] {
    color: #ff9f00;
    background-color: #e6b4003d;
}
.arrow[data-arrow="4"] {
    color: #ff9f00;
    background-color: #e6b4003d;
}
.arrow[data-arrow="5"] {
    color: #ff9f00;
    background-color: #e6b4003d;
}


/* Each arrow defines its own transform, so the generic transform is not required */


/* Simple pulsing animation on arrows to draw attention */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ecosystem-wrapper {
    height: auto;
    }
    .ecosystem-item {
        position: relative;
        top: 0%;
        left: 0%;
        width: 100%;
        height: auto;
        margin-bottom: 1.5rem;
        border-radius: 16px;
        transform: none !important;
    }
    .ecosystem-item .number {
        position: absolute;
        top: -16px;
        left: 16px;
        transform: none;
    }
    .arrow {
        display: none;
    }
}