/* Money Flows - Global Liquidity World Map */

.mf-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - 120px);
}

/* ─── Regime Banner ─── */
.mf-regime-banner {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
}

.mf-regime-bullish {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.12), rgba(0, 200, 120, 0.06));
    border-color: rgba(0, 255, 157, 0.3);
}

.mf-regime-bearish {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.12), rgba(200, 50, 50, 0.06));
    border-color: rgba(255, 68, 68, 0.3);
}

.mf-regime-transitional {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.12), rgba(200, 150, 0, 0.06));
    border-color: rgba(255, 193, 7, 0.3);
}

.mf-regime-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.mf-regime-bullish .mf-regime-label { color: #00ff9d; }
.mf-regime-bearish .mf-regime-label { color: #ff4444; }
.mf-regime-transitional .mf-regime-label { color: #ffc107; }

.mf-regime-outlook {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
}

/* ─── World Map Container ─── */
.mf-viz-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 550px;
    margin: 0 auto 2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.mf-viz-canvas {
    width: 100%;
    height: 100%;
}

.mf-viz-canvas svg {
    width: 100%;
    height: 100%;
}

.mf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.mf-loading.hidden { display: none; }

.mf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00ff9d;
    border-radius: 50%;
    animation: mf-spin 0.8s linear infinite;
}

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

/* ─── Map Legend ─── */
.mf-map-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    z-index: 5;
}

.mf-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mf-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.mf-legend-item.expanding .mf-legend-dot { background: #00ff9d; }
.mf-legend-item.contracting .mf-legend-dot { background: #ff4444; }
.mf-legend-item.neutral .mf-legend-dot { background: #ffc107; }

/* ─── D3 World Map Styles ─── */
.mf-country {
    fill: rgba(255, 255, 255, 0.04);
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 0.5;
    transition: fill 0.3s ease;
}

.mf-country-highlight {
    cursor: pointer;
}

.mf-country-highlight:hover {
    filter: brightness(1.5);
}

.mf-country-expanding {
    fill: rgba(0, 255, 157, 0.12);
    stroke: rgba(0, 255, 157, 0.2);
}

.mf-country-contracting {
    fill: rgba(255, 68, 68, 0.12);
    stroke: rgba(255, 68, 68, 0.2);
}

.mf-country-neutral {
    fill: rgba(255, 193, 7, 0.1);
    stroke: rgba(255, 193, 7, 0.15);
}

.mf-graticule {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 0.5;
}

/* ─── Flow Arcs ─── */
.mf-flow-arc {
    stroke-linecap: round;
}

.mf-flow-particle {
    pointer-events: none;
}

/* ─── Center Orb (Global Total) ─── */
.mf-center-orb {
    fill: rgba(0, 255, 157, 0.08);
    stroke: rgba(0, 255, 157, 0.25);
    stroke-width: 2;
}

.mf-center-total {
    fill: rgba(255, 255, 255, 0.7);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 9px;
    text-anchor: middle;
    letter-spacing: 0.1em;
}

.mf-center-amount {
    fill: #00ff9d;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 13px;
    text-anchor: middle;
}

/* ─── Central Bank Markers ─── */
.mf-bank-marker {
    cursor: pointer;
}

.mf-bank-marker:hover .mf-bank-circle {
    stroke-width: 3;
    filter: brightness(1.4);
}

.mf-bank-pulse {
    stroke-width: 1.5;
    opacity: 0.4;
    animation: mf-pulse 2s ease-in-out infinite;
}

@keyframes mf-pulse {
    0%, 100% { r: 22; opacity: 0.4; }
    50% { r: 26; opacity: 0.15; }
}

.mf-bank-circle {
    stroke-width: 2;
    transition: all 0.3s ease;
}

.mf-bank-arrow {
    font-size: 12px;
    text-anchor: middle;
    pointer-events: none;
}

.mf-bank-name {
    fill: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 11px;
    text-anchor: middle;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.mf-bank-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-anchor: middle;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* Component mini-dots around banks */
.mf-comp-dot {
    cursor: pointer;
}

.mf-comp-dot:hover circle {
    r: 7;
    opacity: 1;
}

/* ─── Macro Stance ─── */
.mf-stance {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mf-stance-headline {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.mf-stance-metrics {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.mf-stance-metric {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mf-stance-metric-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mf-stance-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #00ff9d;
}

.mf-stance-inference {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Time Horizon Filters ─── */
.mf-time-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mf-time-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.03em;
}

.mf-time-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.mf-time-btn.active {
    background: rgba(0, 255, 157, 0.12);
    border-color: rgba(0, 255, 157, 0.4);
    color: #00ff9d;
}

/* ─── Confirmation Indicators Grid ─── */
.mf-indicators-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.mf-indicator-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: border-color 0.2s;
}

.mf-indicator-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.mf-indicator-name {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.mf-indicator-value-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.mf-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.mf-indicator-dot.green { background: #00ff9d; box-shadow: 0 0 6px rgba(0, 255, 157, 0.4); }
.mf-indicator-dot.red { background: #ff4444; box-shadow: 0 0 6px rgba(255, 68, 68, 0.4); }
.mf-indicator-dot.yellow { background: #ffc107; box-shadow: 0 0 6px rgba(255, 193, 7, 0.4); }
.mf-indicator-dot.neutral { background: rgba(255, 255, 255, 0.3); }

.mf-indicator-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.mf-indicator-desc {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}

/* ─── Related Markets Section ─── */
.mf-markets-section {
    margin-bottom: 1.5rem;
}

.mf-markets-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.mf-markets-scroll::-webkit-scrollbar {
    height: 4px;
}

.mf-markets-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 2px;
}

.mf-markets-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.mf-market-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.mf-market-card:hover {
    border-color: rgba(0, 255, 157, 0.3);
    transform: translateY(-2px);
}

.mf-market-card-img {
    width: 100%;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.mf-market-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mf-market-card-odds {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #00ff9d;
}

/* ─── Flow Stream Animations ─── */
@keyframes mf-flow-stream {
    to { stroke-dashoffset: -40; }
}

.mf-flow-stream {
    stroke-linecap: round;
    fill: none;
    animation: mf-flow-stream 1.5s linear infinite;
}

/* ─── ISM Gauge ─── */
.mf-ism-section {
    max-width: 500px;
    margin: 0 auto 2rem;
    text-align: center;
}

.mf-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.mf-ism-gauge {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.mf-ism-bar {
    position: relative;
    height: 12px;
    background: linear-gradient(90deg, #ff4444 0%, #ff4444 45%, #ffc107 50%, #00ff9d 55%, #00ff9d 100%);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    overflow: visible;
}

.mf-ism-fill {
    display: none;
}

.mf-ism-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 20px;
    background: #fff;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.8s ease;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    left: 50%;
}

.mf-ism-labels {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.mf-ism-divider {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.mf-ism-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* ─── Detail Panel ─── */
.mf-detail-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #0d1117;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 1001;
    transition: right 0.3s ease;
}

.mf-detail-panel.open {
    right: 0;
}

.mf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mf-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mf-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.mf-detail-close:hover {
    color: #fff;
}

.mf-detail-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    padding-right: 2rem;
}

.mf-detail-desc {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.mf-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.mf-detail-stat {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.mf-detail-stat-label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mf-detail-stat-value {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.mf-detail-sparkline {
    height: 80px;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.mf-detail-sparkline svg {
    width: 100%;
    height: 100%;
}

.mf-detail-why {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid rgba(0, 255, 157, 0.4);
}

.mf-detail-inference {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #00ff9d;
    line-height: 1.5;
    padding: 0.75rem;
    background: rgba(0, 255, 157, 0.05);
    border-radius: 8px;
}

/* ─── Mobile Cards ─── */
.mf-mobile-cards {
    display: none;
}

.mf-mobile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.mf-mobile-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

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

.mf-mobile-card-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.mf-mobile-card-direction {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.mf-mobile-card-direction.expanding {
    color: #00ff9d;
    background: rgba(0, 255, 157, 0.12);
}

.mf-mobile-card-direction.contracting {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.12);
}

.mf-mobile-card-direction.neutral {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.12);
}

.mf-mobile-card-components {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mf-mobile-component {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mf-mobile-component-name {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.mf-mobile-component-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.mf-mobile-component-change {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.mf-mobile-component-change.positive { color: #00ff9d; }
.mf-mobile-component-change.negative { color: #ff4444; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .mf-viz-container {
        display: none;
    }

    .mf-mobile-cards {
        display: block;
    }

    .mf-regime-label {
        font-size: 1rem;
    }

    .mf-regime-outlook {
        font-size: 0.8rem;
    }

    .mf-detail-panel {
        width: 100%;
        right: -100%;
    }

    .mf-detail-stats {
        grid-template-columns: 1fr 1fr;
    }

    .mf-indicators-grid {
        grid-template-columns: 1fr;
    }

    .mf-stance-metrics {
        flex-direction: column;
        gap: 0.75rem;
    }

    .mf-time-filters {
        flex-wrap: wrap;
    }

    .mf-market-card {
        flex: 0 0 180px;
    }
}

@media (max-width: 480px) {
    .mf-main {
        padding: 0.75rem;
    }

    .mf-regime-banner {
        padding: 1rem;
    }

    .mf-regime-label {
        font-size: 0.9rem;
    }

    .mf-detail-stats {
        grid-template-columns: 1fr;
    }

    .mf-stance {
        padding: 1rem;
    }

    .mf-stance-headline {
        font-size: 0.9rem;
    }

    .mf-time-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.75rem;
    }

    .mf-market-card {
        flex: 0 0 160px;
    }
}
