/* ===== 3D Stacked Card Carousel ===== */

.steps-slider {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0 40px;
    user-select: none;
}

/* 3D Stage — overflow visible so side cards show, clip on wrapper */
.steps3d-stage {
    position: relative;
    width: 100%;
    height: 460px;
    perspective: 1200px;
    perspective-origin: 50% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Clip wrapper so side cards don't bleed into other sections */
.steps-slider::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Individual Card */
.steps3d-card {
    position: absolute;
    width: 400px;
    height: 440px;
    cursor: pointer;
    outline: none;
    transform-style: preserve-3d;
    transition:
        transform 600ms cubic-bezier(0.23, 1, 0.32, 1),
        opacity 500ms cubic-bezier(0.23, 1, 0.32, 1),
        filter 500ms ease;
    will-change: transform, opacity, filter;
}

/* Card positioning via custom properties */
.steps3d-card {
    --tx: calc(var(--offset) * 280px);
    --tz: calc(var(--abs-offset) * -100px);
    --sc: calc(1 - var(--abs-offset) * 0.1);
    --ry: calc(var(--offset) * -6deg);
    --op: calc(1 - var(--abs-offset) * 0.38);

    transform:
        translateX(var(--tx))
        translateZ(var(--tz))
        scale(var(--sc))
        rotateY(var(--ry));
    opacity: var(--op);
    filter: blur(calc(var(--abs-offset) * 1.5px));
}

/* Active center card overrides */
.steps3d-card.is-active {
    --tx: 0px;
    --tz: 40px;
    --sc: 1;
    --ry: 0deg;
    --op: 1;
    z-index: 20;
    filter: blur(0);
    cursor: default;
}

/* Far cards */
.steps3d-card.is-far {
    pointer-events: none;
}

/* Card Inner */
.steps3d-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(20, 22, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 20px 60px -15px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transition: box-shadow 600ms cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

/* Active card glow */
.steps3d-card.is-active .steps3d-card-inner {
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow:
        0 25px 70px -15px rgba(0, 0, 0, 0.6),
        0 0 60px -10px rgba(99, 102, 241, 0.2),
        0 0 0 1px rgba(99, 102, 241, 0.15) inset;
}

/* Image */
.steps3d-img {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.steps3d-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Gradient overlay */
.steps3d-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.15) 100%
    );
    pointer-events: none;
}

/* Content — column: badge top-center, text at bottom */
.steps3d-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 28px 28px;
    pointer-events: none;
}

/* Step number badge — top center */
.steps3d-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    /* Center horizontally at top */
    align-self: center;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    /* Push title/desc to bottom */
    margin-bottom: auto;
}

/* Title & description at bottom */
.steps3d-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.steps3d-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.55;
    max-width: 340px;
}

/* ===== Navigation ===== */
.steps3d-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 28px;
}

.steps3d-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.steps3d-arrow:hover {
    background: rgba(99, 102, 241, 0.5);
    border-color: rgba(99, 102, 241, 0.7);
    color: #fff;
    transform: scale(1.08);
}

.steps3d-arrow:active {
    transform: scale(0.95);
}

/* Dots */
.steps3d-dots {
    display: flex;
    align-items: center;
    gap: 10px;
}

.steps3d-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.steps3d-dot:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.2);
}

.steps3d-dot.is-active {
    width: 28px;
    border-radius: 5px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.5);
}


/* ===== Light Theme ===== */
[data-theme="light"] .steps3d-card-inner {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        0 20px 60px -15px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

[data-theme="light"] .steps3d-card.is-active .steps3d-card-inner {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow:
        0 25px 70px -15px rgba(0, 0, 0, 0.2),
        0 0 50px -10px rgba(99, 102, 241, 0.12),
        0 0 0 1px rgba(99, 102, 241, 0.12) inset;
}

[data-theme="light"] .steps3d-arrow {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(26, 26, 46, 0.6);
}

[data-theme="light"] .steps3d-arrow:hover {
    background: rgba(99, 102, 241, 0.5);
    border-color: rgba(99, 102, 241, 0.7);
    color: #fff;
}

[data-theme="light"] .steps3d-dot {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .steps3d-dot:hover:not(.is-active) {
    background: rgba(0, 0, 0, 0.25);
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 1024px) {
    .steps3d-stage {
        height: 420px;
        perspective: 1000px;
    }

    .steps3d-card {
        width: 340px;
        height: 400px;
        --tx: calc(var(--offset) * 230px);
        --tz: calc(var(--abs-offset) * -80px);
    }
}

/* ===== Responsive: Mobile — horizontal swipe slider ===== */
@media (max-width: 768px) {
    .steps3d-stage {
        height: auto;
        perspective: none;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
        padding: 8px 24px 16px;
        scrollbar-width: none;
    }

    .steps3d-stage::-webkit-scrollbar {
        display: none;
    }

    .steps3d-card {
        position: relative;
        flex: 0 0 85vw;
        max-width: 340px;
        width: 85vw;
        height: 380px;
        scroll-snap-align: center;
        transform: none !important;
        opacity: 1 !important;
        filter: none !important;
        visibility: visible !important;
        pointer-events: auto !important;
        cursor: default;
    }

    .steps3d-card-inner {
        border-radius: 16px;
    }

    .steps3d-content {
        padding: 20px 22px 24px;
    }

    .steps3d-num {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .steps3d-title {
        font-size: 1.25rem;
    }

    .steps3d-desc {
        font-size: 0.85rem;
    }

    /* Hide arrows on mobile, keep dots */
    .steps3d-arrow {
        display: none;
    }

    .steps3d-nav {
        margin-top: 16px;
    }
}

@media (max-width: 480px) {
    .steps3d-card {
        flex: 0 0 88vw;
        max-width: 300px;
        height: 340px;
    }

    .steps3d-content {
        padding: 16px 18px 20px;
    }

    .steps3d-title {
        font-size: 1.1rem;
    }

    .steps3d-desc {
        font-size: 0.82rem;
    }
}
