/* =============================================================================
   MULTI-PATH CONSENSUS VISUALIZATION
   Premium styling for divergent reasoning display
   ============================================================================= */

/* --- Variables --- */
:root {
    --mp-navy-950: #0f172a;
    --mp-navy-900: #1e293b;
    --mp-blue-600: #2563eb;
    --mp-blue-500: #3b82f6;
    --mp-blue-400: #60a5fa;
    --mp-emerald-500: #10b981;
    --mp-amber-500: #f59e0b;
    --mp-rose-500: #f43f5e;
    --mp-slate-400: #94a3b8;
    --mp-slate-500: #64748b;
    --mp-glass: rgba(30, 41, 59, 0.7);
    --mp-glass-border: rgba(96, 165, 250, 0.2);
}

/* --- Container --- */
.multipath-viz {
    position: relative;
    width: 100%;
    padding: 2rem;
    background: var(--mp-navy-950);
    border-radius: 1.5rem;
    overflow: hidden;
}

.multipath-viz::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

/* --- Header --- */
.multipath-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.multipath-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mp-blue-400);
}

.multipath-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-family: 'SF Mono', monospace;
    color: var(--mp-slate-400);
}

.multipath-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mp-blue-500);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

/* --- SVG Flow Lines --- */
.multipath-flow {
    position: relative;
    height: 120px;
    margin-bottom: 1.5rem;
}

.multipath-flow svg {
    width: 100%;
    height: 100%;
}

.flow-path {
    fill: none;
    stroke: var(--mp-blue-500);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.4;
}

.flow-path.active {
    opacity: 1;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: draw-path 1.5s ease forwards;
}

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

.flow-node {
    fill: var(--mp-navy-900);
    stroke: var(--mp-blue-500);
    stroke-width: 2;
}

.flow-node-label {
    fill: var(--mp-blue-400);
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
}

/* --- Path Cards Grid --- */
.multipath-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

/* --- Individual Path Card --- */
.path-card {
    background: var(--mp-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--mp-glass-border);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.path-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mp-blue-600), var(--mp-blue-400));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.path-card:hover {
    transform: translateY(-2px);
    border-color: var(--mp-blue-500);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15);
}

.path-card:hover::before {
    opacity: 1;
}

.path-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.path-stance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.path-stance-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: rgba(37, 99, 235, 0.15);
    color: var(--mp-blue-400);
}

.path-stance-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.path-number {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--mp-slate-500);
    font-family: 'SF Mono', monospace;
}

/* --- Confidence Meter --- */
.path-confidence {
    margin-bottom: 0.75rem;
}

.path-confidence-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--mp-slate-400);
    margin-bottom: 0.35rem;
}

.path-confidence-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.path-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mp-blue-600), var(--mp-emerald-500));
    border-radius: 2px;
    transition: width 1s ease;
}

.path-confidence-fill.medium {
    background: linear-gradient(90deg, var(--mp-amber-500), var(--mp-blue-500));
}

.path-confidence-fill.low {
    background: linear-gradient(90deg, var(--mp-rose-500), var(--mp-amber-500));
}

/* --- Path Summary --- */
.path-summary {
    font-size: 0.75rem;
    color: var(--mp-slate-400);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

/* --- Key Insights --- */
.path-insights {
    list-style: none;
    padding: 0;
    margin: 0;
}

.path-insight {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--mp-slate-400);
    padding: 0.35rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.path-insight::before {
    content: '▸';
    color: var(--mp-blue-400);
    flex-shrink: 0;
}

/* --- Consensus Footer --- */
.multipath-consensus {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid var(--mp-glass-border);
    border-radius: 1rem;
    position: relative;
    z-index: 1;
}

.consensus-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--mp-slate-400);
}

.consensus-score {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--mp-emerald-500);
    font-family: 'SF Mono', monospace;
}

.consensus-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--mp-emerald-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Animations --- */
.multipath-viz.animating .path-card {
    animation: fade-in-up 0.5s ease forwards;
    opacity: 0;
}

.multipath-viz.animating .path-card:nth-child(1) {
    animation-delay: 0.1s;
}

.multipath-viz.animating .path-card:nth-child(2) {
    animation-delay: 0.2s;
}

.multipath-viz.animating .path-card:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.multipath-consensus {
    animation: fade-in 0.6s ease 0.5s forwards;
    opacity: 0;
}

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

/* --- Glow Effects --- */
.multipath-viz::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .multipath-viz {
        padding: 1.5rem;
        border-radius: 1.25rem;
    }

    .multipath-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .multipath-flow {
        height: 90px;
    }
}

@media (max-width: 480px) {
    .multipath-viz {
        padding: 1.1rem;
        border-radius: 1rem;
    }

    .multipath-flow {
        height: 70px;
        margin-bottom: 1rem;
    }

    .multipath-cards {
        grid-template-columns: 1fr;
    }

    .multipath-consensus {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .consensus-score {
        font-size: 1.4rem;
    }
}
