/**
 * Stylesheet for EP KU Treatment Steps Widget
 * Premium visual aesthetics, fully responsive, and highly animated.
 */

/* ========================================
   WIDGET WRAPPER
   ======================================== */
.ep-ku-steps-wrapper {
    width: 100%;
}

.ep-ku-steps-header {
    margin-bottom: 48px;
}

.ep-ku-steps-header__title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #0f172a;
}

/* ========================================
   GRID CONTAINER & LINE CONNECTORS
   ======================================== */
.ep-ku-steps-grid {
    display: grid;
    /* Respect Rule 2.2: Do not mix flex and grid. Controlled via CSS variables */
    grid-template-columns: repeat(var(--ep-ku-steps-cols, 5), 1fr);
    column-gap: var(--ep-ku-steps-gap, 20px);
    row-gap: 40px;
    width: 100%;
    position: relative;
    
    /* Stepper Line settings */
    --ep-ku-step-line-style: dashed;
    --ep-ku-step-line-color: rgba(236, 0, 140, 0.25);
    --ep-ku-step-line-width: 1px;
}

/* ========================================
   STEP ITEM CONTAINER
   ======================================== */
.ep-ku-steps__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ========================================
   GRAPHIC WRAP (CIRCLE + BADGE + LINE)
   ======================================== */
.ep-ku-steps__graphic-wrap {
    width: 120px;
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2; /* Sits above the connecting dotted lines */
}

/* Concentric circular step borders (solid outer, dashed inner) */
.ep-ku-steps__circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--ep-ku-step-circle-bg, #fffcfd);
    border: 1px solid var(--ep-ku-step-border-outer, rgba(236, 0, 140, 0.35));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0px 8px 24px rgba(236, 0, 140, 0.03);
    transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.4s ease,
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease;
}

/* Dashed Inner ring concentric border */
.ep-ku-steps__circle::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 50%;
    border: 1px dashed var(--ep-ku-step-border-inner, rgba(236, 0, 140, 0.12));
    transition: border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Inner concentric ring hover animations */
.ep-ku-steps__item:hover .ep-ku-steps__circle {
    transform: scale(1.04);
    box-shadow: 0px 12px 30px rgba(236, 0, 140, 0.10);
}

.ep-ku-steps__item:hover .ep-ku-steps__circle::before {
    transform: rotate(45deg); /* Subtle spinning dashed border on hover! */
}

/* Main Step Icon */
.ep-ku-steps__icon {
    font-size: 32px;
    color: var(--ep-ku-circle-icon-color, var(--color-primary, #EC008C));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ep-ku-steps__item:hover .ep-ku-steps__icon {
    transform: scale(1.1);
}

/* SVG Rendering compatibility */
.ep-ku-steps__icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

/* ========================================
   TOP-RIGHT MINI FLOATING BADGE
   ======================================== */
.ep-ku-steps__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--ep-ku-step-badge-bg, #fffcfd);
    border: 1px solid var(--ep-ku-step-badge-border, rgba(236, 0, 140, 0.25));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 3;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ep-ku-steps__badge i {
    font-size: 11px;
    color: var(--ep-ku-step-badge-icon, var(--color-primary, #EC008C));
}

.ep-ku-steps__badge svg {
    width: 11px;
    height: 11px;
    fill: var(--ep-ku-step-badge-icon, var(--color-primary, #EC008C));
}

/* Hover pop micro-animation for the mini badge */
.ep-ku-steps__item:hover .ep-ku-steps__badge {
    transform: scale(1.15) translate(2px, -2px);
}

/* ========================================
   HORIZONTAL CONNECTING DOTTED LINE
   ======================================== */
/* Conforming to responsive connecting line:
   Draw connector line on .ep-ku-steps__item to allow dynamic 100% grid width matching. */
.ep-ku-steps__item::after {
    content: '';
    position: absolute;
    top: 60px; /* Center of the 120px circle */
    left: 50%;
    width: calc(100% + var(--ep-ku-steps-gap, 20px));
    height: 0;
    border-top: var(--ep-ku-step-line-width, 1px) var(--ep-ku-step-line-style, dashed) var(--ep-ku-step-line-color, rgba(236, 0, 140, 0.25));
    transform: translateY(-50%);
    z-index: 0; /* Behind circles which have solid backgrounds and z-index: 1 */
}

/* Last step item should not extend any connecting lines */
.ep-ku-steps__item--last::after {
    display: none !important;
}

/* ========================================
   STEP TEXTS & SEQUENTIAL NUMBERS
   ======================================== */
.ep-ku-steps__content {
    width: 100%;
}

.ep-ku-steps__number {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-primary, #EC008C);
}

.ep-ku-steps__title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #1e293b;
    margin: 0;
    transition: color 0.3s ease;
}

.ep-ku-steps__desc {
    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
}

.ep-ku-steps__item:hover .ep-ku-steps__title {
    color: var(--color-primary, #EC008C);
}

/* ========================================
   RESPONSIVE SCALING & MOBILE TIMELINE
   ======================================== */
@media (max-width: 1024px) {
    .ep-ku-steps-grid {
        grid-template-columns: repeat(var(--ep-ku-steps-cols-tablet, 3), 1fr);
    }
    
    /* Since columns break, traditional horizontal connectors are hidden */
    .ep-ku-steps__item::after {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .ep-ku-steps-grid {
        grid-template-columns: repeat(var(--ep-ku-steps-cols-mobile, 1), 1fr);
        row-gap: 30px;
    }
    
    /* Convert horizontal stepper into a vertical elegant list */
    .ep-ku-steps__item {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }

    .ep-ku-steps__graphic-wrap {
        margin-right: 20px;
        flex-shrink: 0;
    }

    .ep-ku-steps__content {
        text-align: left;
        padding-top: 10px !important;
    }
    
    /* Build vertical dotted timeline connector on mobile */
    .ep-ku-steps__item::after {
        display: block !important;
        content: '';
        position: absolute;
        top: 60px; /* Center of the circle */
        left: 60px; /* Horizontal center of the 120px circle (aligned left on mobile) */
        width: 0;
        height: calc(100% + 30px); /* Stretch downwards past the mobile gap */
        border-top: none;
        border-left: var(--ep-ku-step-line-width, 1px) var(--ep-ku-step-line-style, dashed) var(--ep-ku-step-line-color, rgba(236, 0, 140, 0.25));
        transform: translateX(-50%);
        z-index: 0;
    }
    
    .ep-ku-steps__item--last::after {
        display: none !important;
    }
}
