/* Flow Visualization Styles */
.flow-container {
    width: 500px;
    height: 800px;
    flex: 1 1 500px;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: transparent;
    max-width: calc(100vw - 460px - 60px);
}

.flow-columns-container {
    display: flex;
    gap: 20px;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.flow-column {
    height: 100%;
    overflow-y: auto;
    padding: 15px;
    border-radius: 16px;
    background: rgba(11, 0, 51, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(157, 70, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.flow-column:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(157, 70, 255, 0.1);
}

.flow-column.active-flow-column {
    flex: 1;
    min-width: 200px;
    max-width: 450px;
}

.flow-column.journey-column {
    flex: 2;
    min-width: 200px;
}

.flow-column-header {
    font-size: 18px;
    padding: 10px 0;
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    background: rgba(11, 0, 51, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    letter-spacing: 1px;
}

#flowCanvas,
#flowStack {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 5px 100px 5px;
}

/* Event Nodes */
.event-node {
    display: flex;
    position: relative;
    margin-left: 30px;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 1.8s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    margin-bottom: 30px;
}

.event-node.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Journey Line */
.event-journey-line {
    position: absolute;
    left: -30px;
    top: 0;
    bottom: -30px;
    width: 3px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.2));
    z-index: 0;
}

/* Event Dots */
.event-dot {
    position: absolute;
    left: -37px;
    top: 30px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    z-index: 1;
    transform: scale(0);
    animation: dotAppear 0.6s 0.4s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dotAppear {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.event-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Event Dot Colors */
.event-dot.flow_started {
    background: #4fc3f7;
}

.event-dot.flow_cancelled {
    background: #ef5350;
}

.event-dot.flow_interrupted {
    background: #ffca28;
}

.event-dot.flow_resumed {
    background: #66bb6a;
}

.event-dot.slot {
    background: #ab47bc;
}

.event-dot.action {
    background: #ff7043;
}

.event-dot.user {
    background: #64b5f6;
}

.event-dot.bot {
    background: #7c4dff;
}

/* Event Cards */
.event-card {
    background: rgba(11, 0, 51, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 15px var(--card-glow);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(157, 70, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--secondary), transparent);
}

.event-card:hover {
    transform: translateY(-5px) scale(1.02);
    background: rgba(30, 8, 82, 0.6);
    border-color: rgba(157, 70, 255, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 25px var(--card-glow);
}

/* Event Card Glows */
.event-card.flow_started {
    box-shadow: 0 5px 20px rgba(79, 195, 247, 0.1);
}

.event-card.flow_cancelled {
    box-shadow: 0 5px 20px rgba(239, 83, 80, 0.1);
}

.event-card.flow_interrupted {
    box-shadow: 0 5px 20px rgba(255, 202, 40, 0.1);
}

.event-card.flow_resumed {
    box-shadow: 0 5px 20px rgba(102, 187, 106, 0.1);
}

.event-card.slot {
    box-shadow: 0 5px 20px rgba(171, 71, 188, 0.1);
}

.event-card.action {
    box-shadow: 0 5px 20px rgba(255, 112, 67, 0.1);
}

.event-card.user {
    box-shadow: 0 5px 20px rgba(100, 181, 246, 0.1);
}

.event-card.bot {
    box-shadow: 0 5px 20px rgba(124, 77, 255, 0.1);
}

/* Event Icon */
.event-icon {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.event-icon i {
    font-size: 16px;
    margin-right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.event-icon-title {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Event Details */
.event-details {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    font-weight: 300;
}

.event-details strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Event Time */
.event-time {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.event-time i {
    font-size: 10px;
    margin-right: 5px;
    opacity: 0.7;
}

/* Flow Stack Styles */
.flow-card {
    background: rgba(30, 8, 82, 0.7);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(157, 70, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.flow-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--accent), transparent);
}

.flow-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(157, 70, 255, 0.3);
}

.flow-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.flow-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    box-shadow: 0 0 15px rgba(255, 171, 64, 0.3);
}

.flow-card-title {
    font-size: 18px;
    font-weight: 500;
    color: white;
}

.flow-card-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 3px;
}

.flow-card-content {
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.8);
}

.flow-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.flow-time {
    display: flex;
    align-items: center;
}

.flow-time i {
    margin-right: 5px;
    font-size: 10px;
}

.flow-id {
    font-family: monospace;
    opacity: 0.7;
}

/* Flow Status */
.flow-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.flow-status.active {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.flow-status.cancelled,
.flow-status.completed {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.flow-status.interrupted {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* Flow Animations */
@keyframes stackEnter {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes stackExit {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-30px);
        opacity: 0;
    }
}

@keyframes flowExit {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    20% {
        background: rgba(76, 175, 80, 0.1);
        border-color: rgba(76, 175, 80, 0.3);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.stack-enter {
    animation: stackEnter 0.5s forwards;
}

.stack-exit {
    animation: stackExit 0.5s forwards;
}

.flow-card.flow-exit {
    animation: flowExit 1.5s forwards;
    pointer-events: none;
}

/* Column Update Animation */
@keyframes columnUpdateGlow {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 30px rgba(157, 70, 255, 0.2);
    }
}

.column-updated {
    animation: columnUpdateGlow 2s ease;
}

/* Flow Hierarchy */
.flow-child {
    position: relative;
    padding-left: 10px;
    border-left: 3px solid var(--accent);
    margin-bottom: 20px;
    margin-left: 70px !important;
}

.flow-child::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(to bottom,
            rgba(255, 171, 64, 0.8),
            rgba(255, 171, 64, 0.4));
    z-index: 2;
}

.flow-child::after {
    content: '';
    position: absolute;
    left: -40px;
    top: 30px;
    width: 40px;
    height: 3px;
    background: rgba(255, 171, 64, 0.6);
    z-index: 2;
}

.flow-badge {
    position: absolute;
    left: -60px;
    top: 25px;
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 171, 64, 0.5);
    z-index: 10;
}

/* Shake Animation */
@keyframes shakeAnimation {
    0% {
        transform: translateX(0);
    }

    10% {
        transform: translateX(-5px);
    }

    20% {
        transform: translateX(5px);
    }

    30% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    50% {
        transform: translateX(-2px);
    }

    60% {
        transform: translateX(2px);
    }

    70% {
        transform: translateX(-2px);
    }

    80% {
        transform: translateX(2px);
    }

    90% {
        transform: translateX(-1px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake-animation {
    animation: shakeAnimation 0.8s ease;
}