/* frontend-fixed.css - Complete Monetary Policy Dashboard Styling */
/* BBM Dark Theme - Exact Colors */

:root {
    /* BBM Dark Theme - Exact Match */
    --bg: #000000;
    --s1: #141414;
    --s2: #1a1a1a;
    --border: #1e1e1e;
    --text: #dfdedb;
    --muted: #8a8a8a;
    --accent: #e58c17;
    --accent-hover: #e58c17;
    
    /* Signal Colors */
    --bull: #16a34a;
    --bear: #ef4444;
    --neutral: #8a8a8a;
    --hawk: #16a34a;
    --dove: #ef4444;
    
    /* Link Colors */
    --link: #e58c17;
    --link-hover: #e58c17;
    
    /* Input Colors */
    --input-bg: #000000;
    --input-text: #dfdedb;
    --input-placeholder: #dfdedb;
    
    /* Button Colors */
    --btn-bg: #141414;
    --btn-hover: #141414;
    --btn-text: #dfdedb;
    --btn-border: #1e1e1e;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.mpd-dashboard {
    width: 100%;
    height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 13px;
    display: grid;
    grid-template-rows: 70px 1fr;
    overflow: hidden;
}

/* Header - BBM Dark Style */
.mpd-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    z-index: 100;
}

.mpd-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    user-select: none;
}

.mpd-logo-text {
    font-weight: 800;
    font-size: 24px;
    color: var(--text);
}

.mpd-logo-text .mpd-monitor {
    color: var(--accent);
}

.mpd-logo-sub {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.5px;
    font-weight: 500;
}

.mpd-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mpd-live {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

.mpd-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bear);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mpd-tabs {
    display: flex;
    gap: 2px;
    background: var(--s1);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.mpd-tab {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--muted);
    transition: all 0.2s ease;
}

.mpd-tab:hover {
    color: var(--text);
    background: var(--s2);
}

.mpd-tab.active {
    background: var(--s2);
    color: var(--accent);
    border: 1px solid var(--border);
}

/* Links */
a, .mpd-link {
    color: var(--link);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover, .mpd-link:hover {
    color: var(--link-hover);
    text-decoration: none;
}

/* Input Fields */
.mpd-input {
    background: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.mpd-input::placeholder {
    color: var(--input-placeholder);
    opacity: 0.7;
}

.mpd-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Buttons */
.mpd-button {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-border);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mpd-button:hover {
    background: var(--btn-hover);
    color: var(--btn-text);
    border-color: var(--accent);
}

/* Main Content */
.mpd-main {
    position: relative;
    height: 100%;
    overflow: hidden;
    display: grid;
}

/* Loading State */
.mpd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

.mpd-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip - BBM Dark Style */
#mpd-tooltip {
    position: fixed;
    background: var(--s1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    max-width: 200px;
    line-height: 1.5;
    color: var(--text);
}

/* ========== OVERVIEW VIEW ========== */
.mpd-overview {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
}

/* Left Panel - Currency Selector (BBM Dark Style) */
.mpd-left-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg);
}

.mpd-panel-header {
    padding: 16px 20px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--s1);
}

.mpd-currency-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
}

.mpd-currency-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 64px;
    border-left: 4px solid transparent;
    background: var(--bg);
}

.mpd-currency-item:last-child {
    border-bottom: none;
}

.mpd-currency-item.active {
    background: var(--s1);
    border-left-color: var(--accent);
}

.mpd-currency-item:hover:not(.active) {
    background: var(--s1);
    border-left-color: var(--border);
}

.mpd-currency-item.USD { border-left-color: var(--bull); }
.mpd-currency-item.EUR { border-left-color: var(--accent); }
.mpd-currency-item.GBP { border-left-color: var(--bull); }
.mpd-currency-item.JPY { border-left-color: var(--bear); }
.mpd-currency-item.CHF { border-left-color: var(--bear); }
.mpd-currency-item.CAD { border-left-color: var(--neutral); }
.mpd-currency-item.AUD { border-left-color: var(--accent); }
.mpd-currency-item.NZD { border-left-color: var(--neutral); }

.mpd-currency-flag {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--s2);
    flex-shrink: 0;
    color: var(--text);
    border: 1px solid var(--border);
}

.mpd-currency-info {
    min-width: 0;
}

.mpd-currency-code {
    font-weight: 700;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    margin-bottom: 2px;
    color: var(--text);
}

.mpd-currency-bank {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpd-currency-rate-col {
    text-align: right;
}

.mpd-currency-rate {
    font-weight: 700;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    color: var(--accent);
}

.mpd-stance-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    margin-top: 4px;
    display: inline-block;
    font-weight: 600;
}

.mpd-stance-badge.h {
    background: rgba(22, 163, 74, 0.15);
    color: var(--bull);
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.mpd-stance-badge.d {
    background: rgba(239, 68, 68, 0.15);
    color: var(--bear);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.mpd-stance-badge.n {
    background: rgba(107, 114, 128, 0.15);
    color: var(--neutral);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Center Panel */
.mpd-center-panel {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    overflow: hidden;
    background: var(--bg);
    border-right: 1px solid var(--border);
}

.mpd-hero {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: var(--s1);
    border-bottom: 1px solid var(--border);
}

.mpd-hero-flag {
    font-size: 40px;
}

.mpd-hero-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.mpd-hero-bank {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.mpd-hero-rate {
    text-align: right;
}

.mpd-hero-rate-value {
    font-size: 36px;
    font-weight: 900;
    color: var(--accent);
    line-height: 1.2;
}

.mpd-hero-rate-label {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mpd-hero-stance {
    text-align: center;
}

.mpd-stance-chip {
    font-size: 12px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    letter-spacing: 0.5px;
}

.mpd-stance-chip.h {
    background: rgba(22, 163, 74, 0.15);
    color: var(--bull);
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.mpd-stance-chip.d {
    background: rgba(239, 68, 68, 0.15);
    color: var(--bear);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.mpd-stance-chip.n {
    background: rgba(107, 114, 128, 0.15);
    color: var(--neutral);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.mpd-hero-vote {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.mpd-spectrum-section {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.mpd-spectrum-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mpd-spectrum-track {
    position: relative;
    height: 32px;
    background: linear-gradient(90deg, 
        rgba(239, 68, 68, 0.2) 0%, 
        rgba(107, 114, 128, 0.1) 50%, 
        rgba(22, 163, 74, 0.2) 100%);
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.mpd-spectrum-marker {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.mpd-spectrum-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    padding: 0 16px;
    pointer-events: none;
    width: 100%;
    position: absolute;
}

.mpd-chart-section {
    padding: 16px 24px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.mpd-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mpd-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mpd-chart-toggles {
    display: flex;
    gap: 6px;
    background: var(--s1);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.mpd-chart-toggle {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
}

.mpd-chart-toggle:hover {
    background: var(--s2);
    color: var(--text);
}

.mpd-chart-toggle.active {
    background: var(--s2);
    color: var(--accent);
    border: 1px solid var(--border);
}

.mpd-chart-container {
    flex: 1;
    min-height: 0;
    position: relative;
    background: var(--s1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.mpd-stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--border);
    background: var(--s1);
}

.mpd-stat-cell {
    padding: 12px 16px;
    border-right: 1px solid var(--border);
}

.mpd-stat-cell:last-child {
    border-right: none;
}

.mpd-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mpd-stat-value {
    font-size: 16px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--text);
}

.mpd-stat-value.up { color: var(--bull); }
.mpd-stat-value.dn { color: var(--bear); }
.mpd-stat-value.ok { color: var(--accent); }

/* Right Panel - Signals (BBM Dark Style) */
.mpd-right-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.mpd-right-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.mpd-right-header {
    padding: 16px 20px 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: var(--s1);
}

/* Cut Probabilities */
.mpd-probability-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    background: var(--bg);
}

.mpd-probability-item {
    display: grid;
    grid-template-columns: 60px 1fr 50px;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.mpd-probability-item:last-child {
    border-bottom: none;
}

.mpd-prob-month {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.mpd-prob-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.mpd-prob-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.mpd-prob-value {
    font-weight: 700;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    text-align: right;
    color: var(--text);
}

/* Vote Display */
.mpd-vote-container {
    padding: 12px 16px;
    background: var(--bg);
}

.mpd-vote-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.mpd-vote-row:last-child {
    border-bottom: none;
}

.mpd-vote-key {
    color: var(--muted);
    font-weight: 500;
    font-size: 13px;
}

.mpd-vote-value {
    font-weight: 700;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    color: var(--text);
}

.mpd-vote-bar {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border);
    margin: 12px 0;
    display: flex;
}

.mpd-vote-for {
    background: var(--bull);
    height: 100%;
}

.mpd-vote-against {
    background: var(--bear);
    height: 100%;
}

/* SEP List */
.mpd-sep-list {
    padding: 8px 16px;
    background: var(--bg);
}

.mpd-sep-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.mpd-sep-item:last-child {
    border-bottom: none;
}

.mpd-sep-key {
    color: var(--muted);
    font-weight: 500;
}

.mpd-sep-value {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--text);
}

.mpd-sep-value.up { color: var(--bull); }
.mpd-sep-value.dn { color: var(--bear); }
.mpd-sep-value.ok { color: var(--accent); }

/* Decisions List */
.mpd-decisions-list {
    padding: 8px 16px;
    background: var(--bg);
}

.mpd-decision-item {
    display: grid;
    grid-template-columns: 90px 1fr 70px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.mpd-decision-item:last-child {
    border-bottom: none;
}

.mpd-decision-date {
    color: var(--muted);
    font-weight: 500;
}

.mpd-decision-action {
    font-weight: 600;
    color: var(--text);
}

.mpd-decision-change {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-align: right;
}

.mpd-decision-change.up { color: var(--bull); }
.mpd-decision-change.dn { color: var(--bear); }

/* Scrollbar Styling - BBM Dark */
.mpd-currency-list::-webkit-scrollbar,
.mpd-fx-pairs-list::-webkit-scrollbar,
.mpd-probability-list::-webkit-scrollbar {
    width: 6px;
}

.mpd-currency-list::-webkit-scrollbar-track,
.mpd-fx-pairs-list::-webkit-scrollbar-track,
.mpd-probability-list::-webkit-scrollbar-track {
    background: var(--s1);
}

.mpd-currency-list::-webkit-scrollbar-thumb,
.mpd-fx-pairs-list::-webkit-scrollbar-thumb,
.mpd-probability-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.mpd-currency-list::-webkit-scrollbar-thumb:hover,
.mpd-fx-pairs-list::-webkit-scrollbar-thumb:hover,
.mpd-probability-list::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Error State */
.mpd-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--bear);
    font-size: 14px;
    background: var(--s1);
    padding: 20px;
    border-radius: 8px;
    margin: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}