/* 
 * SeaNeB Process Snake Widget CSS
 */

.seaneb-process-snake-wrapper {
    --ps-primary: var(--seaneb-primary, #0073e6);
    --ps-node-size: 60px;
    --ps-path-width: 3px;
    width: 100%;
    overflow: hidden;
    position: relative;
    padding-top: 8px; /* reduce top space above desktop SVG */
}

/* =========================================
   DESKTOP SVG LAYOUT 
   ========================================= */
.seaneb-ps-desktop {
    display: none; /* Mobile first -> show below */
    margin: 0 auto;
    height: auto !important;
    min-height: unset !important;
    max-height: none !important;
}

@media (min-width: 1025px) {
    .seaneb-ps-desktop--desktop {
        display: block;
        padding-top: 8px; /* reduce top space above desktop SVG */
        margin-top: 0;
    }

    /* Reduce overall wrapper top gap on large screens only */
    .seaneb-process-snake-wrapper {
        padding-top: 8px;
    }

    /* Make node rows a bit tighter on desktop */
    .seaneb-ps-desktop--desktop .ps-node-wrap {
        margin-top: 8px;
        margin-bottom: 8px;
    }
}

/* Tablet: force mobile card layout instead of desktop SVG */
@media (min-width: 768px) and (max-width: 1024px) {
    .seaneb-ps-desktop--tablet { display: none !important; }
    .seaneb-ps-mobile { display: flex !important; }
}

.seaneb-ps-svg {
    pointer-events: none;
}

.seaneb-ps-path {
    stroke: var(--ps-primary);
    stroke-width: var(--ps-path-width, 3px);
}

/* Node Wrappers */
.ps-node-wrap {
    width: var(--ps-node-size);
    height: var(--ps-node-size);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.ps-node-wrap:hover .ps-node-circle {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.ps-node-circle {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 4px solid var(--node-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.ps-node-circle i,
.ps-node-circle svg {
    color: var(--node-color);
    font-size: calc(var(--ps-node-size) * 0.4);
    transition: all 0.3s ease;
}

.ps-node-circle img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.ps-node-num {
    font-size: calc(var(--ps-node-size) * 0.4);
    font-weight: 700;
    color: var(--node-color);
}

/* Intelligent Label Placing */
.ps-node-label {
    position: absolute;
    width: 200px;
    max-width: calc(100vw - 40px);
    text-align: center;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.03);
    animation: snakeFadeUp 0.6s ease forwards;
    animation-delay: 0.2s;
}

.ps-node-label.is-top {
    bottom: calc(100% + 20px);
}

.ps-node-label.is-bottom {
    top: calc(100% + 20px);
}

.ps-label-title {
    margin: 0 0 5px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--seaneb-heading-color, #111);
}

.ps-label-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--seaneb-text-color, #555);
    line-height: 1.5;
}

.ps-node-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

@keyframes snakeFadeUp {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* =========================================
   MOBILE CARD LAYOUT
   ========================================= */
.seaneb-ps-mobile {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 20px 20px 40px;
    position: relative;
    z-index: 1;
}

.seaneb-ps-mobile::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 40px;
    bottom: 40px;
    width: 0;
    border-left-width: var(--ps-path-width, 3px);
    border-left-style: var(--ps-path-style, solid);
    border-left-color: var(--ps-primary);
    opacity: 0.4;
    z-index: 0;
}

@media (min-width: 768px) {
    .seaneb-ps-mobile {
        display: none;
    }
}

.ps-mob-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    border-left-width: var(--ps-path-width, 3px);
    border-left-style: solid;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    z-index: 2;
    margin-left: -20px;
}

.ps-mob-card:hover {
    transform: translateY(-3px);
}

.ps-mob-badge {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.ps-mob-badge i, .ps-mob-badge svg {
    font-size: 18px;
    color: #fff;
}

.ps-mob-content {
    flex-grow: 1;
}

.ps-mob-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--seaneb-heading-color, #111);
}

.ps-mob-desc {
    margin: 0;
    font-size: 0.95rem;
    color: var(--seaneb-text-color, #555);
    line-height: 1.5;
}
