/**
 * Process Timeline - Desktop mit Slider, Mobile vertikal
 * Desktop: Horizontaler Slider mit 4 Karten
 * Mobile: Vertikales Layout mit Scroll-Animationen
 */

/* ================================
   DESKTOP STYLES - Horizontal Slider
   ================================ */
@media (min-width: 769px) {
    .process-timeline {
        position: relative;
        padding: 2rem 0;
        max-width: 1200px;
        margin: 0 auto;
    }

    /* Slider Track Container */
    .process-timeline-track {
        position: relative;
        height: 8px;
        background: rgba(0, 212, 255, 0.15);
        border-radius: 4px;
        margin: 0 auto 3rem;
        cursor: pointer;
    }

    /* Progress Fill */
    .process-timeline-progress {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, var(--primary-cyan, #00d4ff), var(--primary-purple, #7c3aed));
        border-radius: 4px;
        transition: none; /* No transition for smooth dragging */
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    }

    /* Draggable Handle */
    .process-timeline-handle {
        position: absolute;
        top: 50%;
        left: 0%;
        transform: translate(-50%, -50%);
        width: 28px;
        height: 28px;
        background: linear-gradient(135deg, var(--primary-cyan, #00d4ff), var(--primary-purple, #7c3aed));
        border: 3px solid white;
        border-radius: 50%;
        cursor: grab;
        z-index: 10;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    }

    .process-timeline-handle:hover {
        transform: translate(-50%, -50%) scale(1.15);
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
    }

    .process-timeline-handle:active,
    .process-timeline-handle.is-dragging {
        cursor: grabbing;
        transform: translate(-50%, -50%) scale(1.1);
        transition: none; /* Instant response while dragging */
    }

    /* Step Markers on Track - aligned with card centers */
    .process-timeline-markers {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100%;
        display: flex;
        justify-content: space-between;
        /* Align markers exactly above card number circles */
        padding: 0 calc(12.5% - 8px);
    }

    .process-timeline-marker {
        position: relative;
        width: 16px;
        height: 16px;
        background: rgba(255, 255, 255, 0.3);
        border: 2px solid rgba(0, 212, 255, 0.5);
        border-radius: 50%;
        transform: translateY(-4px);
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .process-timeline-marker.is-active {
        background: var(--primary-cyan, #00d4ff);
        border-color: white;
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.7);
        transform: translateY(-4px) scale(1.2);
    }

    .process-timeline-marker:hover:not(.is-active) {
        background: rgba(0, 212, 255, 0.5);
        transform: translateY(-4px) scale(1.1);
    }

    /* Step Labels - hidden, info is in cards */
    .process-timeline-labels {
        display: none;
    }

    /* Cards Grid */
    .process-timeline-cards {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        margin-top: 2rem;
    }

    /* Individual Step */
    .process-step {
        display: flex;
        flex-direction: column;
        align-items: center;
        opacity: 0.4;
        transform: scale(0.95);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Cards that have been "passed" by the slider stay expanded */
    .process-step.is-passed,
    .process-step.is-active {
        opacity: 1;
        transform: scale(1);
    }

    .process-step.is-visible {
        opacity: 0.6;
        transform: scale(0.98);
    }

    .process-step.is-passed.is-visible,
    .process-step.is-active.is-visible {
        opacity: 1;
        transform: scale(1);
    }

    /* Step Number Circle */
    .process-step-number {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
        border: 3px solid rgba(0, 212, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1.5rem;
        transition: all 0.4s ease;
    }

    .process-step-number span {
        font-size: 1.4rem;
        font-weight: 800;
        color: var(--primary-cyan, #00d4ff);
        font-family: 'Orbitron', sans-serif;
    }

    .process-step.is-passed .process-step-number,
    .process-step.is-active .process-step-number {
        border-color: var(--primary-cyan, #00d4ff);
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(124, 58, 237, 0.25));
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
        transform: scale(1.1);
    }

    /* Step Card */
    .process-step-card {
        background: linear-gradient(160deg, rgba(0, 8, 18, 0.9), rgba(0, 28, 38, 0.8));
        border: 2px solid rgba(0, 212, 255, 0.15);
        border-radius: 16px;
        padding: 1.5rem;
        text-align: center;
        transition: all 0.4s ease;
        width: 100%;
    }

    .process-step.is-passed .process-step-card,
    .process-step.is-active .process-step-card {
        border-color: rgba(0, 212, 255, 0.5);
        transform: translateY(-8px);
        box-shadow:
            0 20px 40px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(0, 212, 255, 0.15);
    }

    /* Icon */
    .process-step-card .process-step-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
        display: block;
        transition: transform 0.4s ease;
    }

    .process-step.is-passed .process-step-icon,
    .process-step.is-active .process-step-icon {
        transform: scale(1.15);
    }

    /* Title */
    .process-step-card h3 {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary, #fff);
        margin: 0 0 0.75rem 0;
    }

    /* Description */
    .process-step-card p {
        font-size: 0.9rem;
        color: var(--text-secondary, rgba(255,255,255,0.7));
        line-height: 1.6;
        margin: 0;
    }

    /* Hide mobile elements on desktop */
    .process-timeline-line {
        display: none;
    }

    /* Hide direct child steps on desktop (these are for mobile) */
    .process-timeline > .process-step {
        display: none !important;
    }
}

/* ================================
   MOBILE STYLES (Vertical Layout)
   ================================ */
@media (max-width: 768px) {
    .process-timeline {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }

    /* Hide desktop slider elements on mobile */
    .process-timeline-track,
    .process-timeline-labels,
    .process-timeline-cards {
        display: none !important;
    }

    .process-step {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        padding: 1.5rem 0;
        position: relative;
        opacity: 0;
        transform: translateX(-30px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }

    .process-step.is-visible {
        opacity: 1;
        transform: translateX(0);
    }

    /* Vertical line on mobile */
    .process-step::before {
        content: '';
        position: absolute;
        left: 28px;
        top: 0;
        bottom: 0;
        width: 3px;
        background: linear-gradient(180deg,
            rgba(0, 212, 255, 0.3) 0%,
            rgba(124, 58, 237, 0.3) 100%
        );
        z-index: 0;
    }

    .process-step:first-child::before {
        top: 50%;
    }

    .process-step:last-child::before {
        bottom: 50%;
    }

    .process-step-number {
        width: 48px;
        height: 48px;
        min-width: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(124, 58, 237, 0.15));
        border: 3px solid rgba(0, 212, 255, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 1.25rem;
        z-index: 2;
    }

    .process-step-number span {
        font-size: 1.2rem;
        font-weight: 800;
        color: var(--primary-cyan, #00d4ff);
        font-family: 'Orbitron', sans-serif;
    }

    .process-step-card {
        text-align: left;
        padding: 1.25rem;
        flex: 1;
        background: linear-gradient(160deg, rgba(0, 8, 18, 0.9), rgba(0, 28, 38, 0.8));
        border: 2px solid rgba(0, 212, 255, 0.2);
        border-radius: 16px;
    }

    .process-step-card .process-step-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
        display: block;
    }

    .process-step-card h3 {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-primary, #fff);
        margin: 0 0 0.5rem 0;
    }

    .process-step-card p {
        font-size: 0.85rem;
        color: var(--text-secondary, rgba(255,255,255,0.7));
        line-height: 1.6;
        margin: 0;
    }

    /* Staggered animation delays */
    .process-step[data-step="1"].is-visible { transition-delay: 0s; }
    .process-step[data-step="2"].is-visible { transition-delay: 0.1s; }
    .process-step[data-step="3"].is-visible { transition-delay: 0.2s; }
    .process-step[data-step="4"].is-visible { transition-delay: 0.3s; }
}

/* Tablet - 2 columns without slider */
@media (min-width: 769px) and (max-width: 1024px) {
    .process-timeline-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1.5rem;
    }

    .process-timeline-track {
        display: none;
    }

    .process-timeline-labels {
        display: none;
    }

    .process-step {
        opacity: 1 !important;
        transform: scale(1) !important;
    }

    .process-step-card {
        padding: 1.25rem;
    }
}

/* Touch feedback */
@media (hover: none) {
    .process-step-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .process-step-number:active {
        transform: scale(0.95);
    }
}
