/* =========================================
   Process Steps Widget - Frontend CSS
   ========================================= */

/* Base Wrapper */
.psw-wrapper {
    width: 100%;
    overflow: visible;
    position: relative;
}

/* =========================================
   HORIZONTAL LAYOUT
   ========================================= */
.psw-layout-horizontal .psw-steps-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
}

.psw-layout-horizontal .psw-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.psw-layout-horizontal .psw-connector {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 0 0 auto;
    min-width: 40px;
    max-width: 120px;
    width: 100%;
    margin-top: 50px; /* align with circle center */
    position: relative;
    z-index: 0;
}

/* =========================================
   VERTICAL LAYOUT
   ========================================= */
.psw-layout-vertical .psw-steps-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.psw-layout-vertical .psw-step-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 24px;
    align-items: start;
}

.psw-layout-vertical .psw-step-circle-wrap {
    grid-column: 1;
    grid-row: 1;
}

.psw-layout-vertical .psw-step-content {
    grid-column: 2;
    grid-row: 1;
}

.psw-layout-vertical .psw-connector {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60px;
}

.psw-layout-vertical .psw-connector-track {
    width: 2px;
    height: 100%;
    min-height: 60px;
    flex: 1;
}

.psw-layout-vertical .psw-connector-progress {
    width: 100%;
    height: 0;
    transition: height 1s ease;
}

.psw-layout-vertical .psw-arrow-head {
    transform: rotate(90deg);
}

/* =========================================
   ZIGZAG LAYOUT
   ========================================= */
.psw-layout-zigzag .psw-steps-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.psw-layout-zigzag .psw-step-item:nth-child(odd) {
    flex-direction: row;
    display: flex;
    align-items: center;
    gap: 24px;
}

.psw-layout-zigzag .psw-step-item:nth-child(even) {
    flex-direction: row-reverse;
    display: flex;
    align-items: center;
    gap: 24px;
}

.psw-layout-zigzag .psw-connector {
    display: none;
}

/* =========================================
   STEP ITEM
   ========================================= */
.psw-step-item {
    opacity: 0;
    transition: opacity 0.1s;
}

.psw-step-item.psw-animated {
    opacity: 1;
}

/* =========================================
   CIRCLE
   ========================================= */
.psw-step-circle-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.psw-step-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.psw-step-circle i,
.psw-step-circle svg {
    color: inherit;
}

.psw-circle-img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    border-radius: 50%;
}

.psw-text-icon {
    font-size: 36px;
    line-height: 1;
}

/* Number Badge */
.psw-step-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    z-index: 10;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* =========================================
   PULSE ANIMATION
   ========================================= */
.psw-pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid;
    width: 100%;
    height: 100%;
    z-index: 1;
    animation: psw-pulse 2.5s ease-out infinite;
}

.psw-pulse-ring-2 {
    animation-delay: 1s;
}

@keyframes psw-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* =========================================
   HOVER EFFECTS
   ========================================= */
/* Lift */
.psw-hover-lift .psw-step-item:hover .psw-step-circle {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.2);
}

/* Glow */
.psw-hover-glow .psw-step-item:hover .psw-step-circle {
    filter: brightness(1.15) drop-shadow(0 0 12px currentColor);
}

/* Scale */
.psw-hover-scale .psw-step-item:hover .psw-step-circle {
    transform: scale(1.1);
}

/* Pulse on hover */
.psw-hover-pulse .psw-step-item:hover .psw-step-circle {
    animation: psw-hover-pulse 0.6s ease-in-out;
}

@keyframes psw-hover-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.12); }
}

/* =========================================
   CONTENT CARD
   ========================================= */
.psw-step-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.psw-step-item:hover .psw-step-content {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.psw-step-label {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.psw-step-title {
    font-size: 16px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 10px;
    display: none; /* hidden by default - label serves as title */
}

.psw-step-description {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    margin: 0;
}

.psw-step-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #3B82F6;
    text-decoration: none;
    transition: color 0.2s;
}

.psw-step-link:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

/* =========================================
   CONNECTOR - ANIMATED ARROW
   ========================================= */
.psw-connector {
    display: flex;
    align-items: center;
    flex: 1;
}

.psw-connector-track {
    flex: 1;
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.psw-connector-progress {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 1s ease;
    position: relative;
}

.psw-connector-progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: inherit;
    box-shadow: 0 0 6px 2px currentColor;
}

/* Connector Arrow Head */
.psw-arrow-head {
    font-size: 16px;
    flex-shrink: 0;
    margin-left: 2px;
    line-height: 1;
}

/* =========================================
   CONNECTOR - DASHED LINE
   ========================================= */
.psw-connector-dashed_line .psw-connector-line {
    flex: 1;
    height: 0;
    border-top: 2px dashed #ccc;
}

/* =========================================
   CONNECTOR - SOLID LINE
   ========================================= */
.psw-connector-solid_line .psw-connector-line {
    flex: 1;
    height: 2px;
    background: #ccc;
}

/* =========================================
   CONNECTOR - DOTTED PROGRESS
   ========================================= */
.psw-connector-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.psw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.psw-dot.psw-dot-active {
    opacity: 1;
    transform: scale(1.2);
}

/* =========================================
   CONNECTOR - WAVE
   ========================================= */
.psw-connector-svg {
    flex: 1;
    height: 20px;
    width: 100%;
}

.psw-wave-animated {
    animation: psw-wave-draw 2s ease forwards;
}

@keyframes psw-wave-draw {
    to { stroke-dashoffset: 0; }
}

/* =========================================
   GSAP ANIMATION STATES
   ========================================= */
.psw-step-item[data-gsap-ready] {
    opacity: 0;
    visibility: hidden;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .psw-layout-horizontal .psw-steps-container {
        flex-wrap: wrap;
        gap: 20px;
    }

    .psw-layout-horizontal .psw-step-item {
        flex: 0 0 calc(50% - 10px);
    }

    .psw-layout-horizontal .psw-connector {
        display: none;
    }
}

@media (max-width: 640px) {
    .psw-layout-horizontal .psw-steps-container,
    .psw-layout-zigzag .psw-steps-container {
        flex-direction: column;
        gap: 24px;
    }

    .psw-layout-horizontal .psw-step-item {
        flex: 0 0 100%;
    }

    .psw-layout-horizontal .psw-connector {
        display: none;
    }

    .psw-layout-zigzag .psw-step-item:nth-child(odd),
    .psw-layout-zigzag .psw-step-item:nth-child(even) {
        flex-direction: column;
        align-items: center;
    }

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

/* =========================================
   EDITOR PREVIEW
   ========================================= */
.psw-editor-preview .psw-step-item {
    opacity: 1 !important;
    transform: none !important;
}
