/* GraphGuard v2 — Stitch Design System Overrides */

@media (prefers-reduced-motion: no-preference) {
    .glass-panel {
        background: rgba(26, 28, 35, 0.7);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, background 0.3s ease;
    }
    .glass-panel:hover {
        transform: translateY(-2px);
        border-color: rgba(163, 220, 236, 0.2);
        background: rgba(26, 28, 35, 0.85);
    }
    .slide-in-alert {
        animation: slide-in-alert 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards, 
                   flash-highlight 2s ease-out forwards;
    }
    @keyframes slide-in-alert {
        from { transform: translateY(-20px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    @keyframes flash-highlight {
        0% { background-color: rgba(163, 220, 236, 0.15); }
        100% { background-color: transparent; }
    }
    .critical-pulse {
        animation: ambient-pulse 2s infinite alternate ease-in-out;
    }
    @keyframes ambient-pulse {
        from { box-shadow: 0 0 0px rgba(191, 97, 106, 0); border-color: rgba(191, 97, 106, 0.3); }
        to { box-shadow: 0 0 12px rgba(191, 97, 106, 0.3); border-color: rgba(191, 97, 106, 0.8); }
    }
    .breathing-node {
        animation: breathing 4s infinite ease-in-out;
    }
    @keyframes breathing {
        0%, 100% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 0px transparent); }
        50% { transform: scale(1.1) translateY(-5px); filter: drop-shadow(0 0 8px currentColor); }
    }
    #cursor-glow {
        pointer-events: none;
        position: fixed;
        width: 400px;
        height: 400px;
        background: radial-gradient(circle, rgba(163, 220, 236, 0.08) 0%, rgba(163, 220, 236, 0) 70%);
        border-radius: 50%;
        z-index: 10;
        transform: translate(-50%, -50%);
        mix-blend-mode: screen;
    }
    .progress-bar-fill {
        width: 0;
        transition: width 1.2s cubic-bezier(0.65, 0, 0.35, 1);
    }
    #detail-panel {
        transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    }
}

.graph-grid {
    background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 16px 16px;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* vis-network overrides to make the graph fit in nicely */
.vis-network {
    outline: none !important;
    border: none !important;
}

/* Loading overlay styles (re-implementing from old styles as it might be needed by app.js) */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: #11131a; /* bg-background */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 24px;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #a3dcec; /* primary */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-size: 0.9rem;
    color: #c0c8cb; /* on-surface-variant */
    animation: fadeInOut 2s ease infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #8a9295;
    text-align: center;
    gap: 8px;
}

.empty-state .icon { font-size: 2rem; opacity: 0.4; }
.empty-state p { font-size: 0.8rem; }

/* ── Graph Mode Toggle ──────────────────────────────────────── */
.graph-mode-btn {
    color: #8a9295;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    background: transparent;
}
.graph-mode-btn:hover {
    color: #a3dcec;
    background: rgba(163, 220, 236, 0.08);
}
.graph-mode-btn.graph-mode-active {
    color: #a3dcec;
    background: rgba(163, 220, 236, 0.15);
    box-shadow: inset 0 -2px 0 #a3dcec;
}

/* ── Suspicious Path Glow ───────────────────────────────────── */
@keyframes path-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.suspicious-path-legend {
    background: linear-gradient(90deg, #ef4444, #f97316, #ef4444);
    background-size: 200% 100%;
    animation: legend-shimmer 2s ease infinite;
    height: 3px;
    border-radius: 2px;
}

@keyframes legend-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── Fraud Pattern Badges ───────────────────────────────────── */
.pattern-badge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(17, 19, 26, 0.6);
    transition: border-color 0.3s ease;
}
.pattern-badge:hover {
    border-color: rgba(163, 220, 236, 0.3);
}
.pattern-badge .pattern-name {
    font-size: 10px;
    font-weight: 600;
    color: #e2e2ec;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pattern-badge .pattern-name .check {
    color: #4ade80;
    font-size: 12px;
}
.pattern-badge .confidence-bar {
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}
.pattern-badge .confidence-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.65, 0, 0.35, 1);
}
.pattern-badge .confidence-fill.high { background: linear-gradient(90deg, #ef4444, #f97316); }
.pattern-badge .confidence-fill.medium { background: linear-gradient(90deg, #f97316, #eab308); }
.pattern-badge .confidence-fill.low { background: linear-gradient(90deg, #eab308, #22c55e); }
.pattern-badge .confidence-text {
    font-size: 9px;
    color: #8a9295;
    font-family: 'Geist Mono', monospace;
}

/* ── Investigation Mode Graph Enhancements ──────────────────── */
.investigation-active .vis-network {
    background: radial-gradient(circle at center, rgba(239,68,68,0.03) 0%, transparent 70%) !important;
}

