/* GBP/JPY Sentiment & News Monitor — Dashboard Styles */

:root {
    --bg-primary: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #1f1f35;
    --border: #2a2a45;
    --text-primary: #e0e0e0;
    --text-secondary: #8888aa;
    --accent: #00d4aa;
    --accent-dim: #00a88533;
    --green: #00c853;
    --red: #ff3d57;
    --orange: #ffab00;
    --yellow: #ffd600;
    --blue: #448aff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header h1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
}
.header-status {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Alert Banner --- */
.alert-banner {
    display: none;
    padding: 10px 20px;
    background: var(--red);
    color: #fff;
    font-weight: 600;
    text-align: center;
    font-size: 13px;
    animation: flash 1s ease-in-out 3;
}
.alert-banner.active { display: block; }
@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Grid Layout --- */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: var(--border);
    min-height: calc(100vh - 50px);
}

/* --- Module Panels --- */
.panel {
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}
.panel-header .count {
    font-size: 11px;
    color: var(--accent);
    font-weight: 400;
}
.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Scrollbar */
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* --- News Items --- */
.news-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.news-item:hover { background: var(--bg-card-hover); }
.news-item .time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 3px;
}
.news-item .headline {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}
.news-item .meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}
.sentiment-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.sentiment-positive { background: #00c85322; color: var(--green); }
.sentiment-negative { background: #ff3d5722; color: var(--red); }
.sentiment-neutral { background: #448aff22; color: var(--blue); }
.relevant-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: var(--accent-dim);
    color: var(--accent);
}

/* --- News Filter --- */
.news-filter {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    flex-wrap: wrap;
}
.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

/* --- Source Type Tags --- */
.source-type-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.source-news { background: #448aff22; color: var(--blue); }
.source-rss { background: #ffab0022; color: var(--orange); }
.source-social { background: #e040fb22; color: #e040fb; }

.filter-separator {
    color: var(--border);
    align-self: center;
    margin: 0 2px;
}

.source-stats {
    display: flex;
    gap: 10px;
    padding: 2px 12px 6px;
    font-size: 10px;
    color: var(--text-secondary);
}
.source-stats span {
    font-variant-numeric: tabular-nums;
}

.social-score {
    font-size: 10px;
    color: var(--text-secondary);
}

/* --- Calendar Events --- */
.calendar-event {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 55px 1fr auto;
    gap: 10px;
    align-items: center;
}
.calendar-event.imminent {
    background: #ffab0011;
    border-left: 3px solid var(--orange);
}
.calendar-event .event-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.calendar-event .event-countdown {
    font-size: 10px;
    color: var(--orange);
}
.calendar-event .event-info .event-title {
    font-size: 13px;
    font-weight: 500;
}
.calendar-event .event-info .event-detail {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.impact-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.impact-High { background: var(--red); }
.impact-Medium { background: var(--orange); }
.impact-Low { background: var(--yellow); }
.impact-Holiday { background: var(--blue); }

.currency-tag {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
}
.currency-GBP { background: #448aff22; color: var(--blue); }
.currency-JPY { background: #ff3d5722; color: var(--red); }

/* Countdown banner */
.next-event-banner {
    padding: 8px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.next-event-banner .countdown {
    font-weight: 700;
    color: var(--orange);
    font-size: 14px;
}

/* --- Price Table --- */
.price-table {
    width: 100%;
    border-collapse: collapse;
}
.price-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
}
.price-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.price-table tr:hover { background: var(--bg-card-hover); }
.price-table .asset-name {
    font-weight: 500;
}
.price-table .asset-symbol {
    font-size: 11px;
    color: var(--text-secondary);
}
.price-table .price-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.price-table .change-positive { color: var(--green); }
.price-table .change-negative { color: var(--red); }
.market-state {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}
.market-state.REGULAR { background: #00c85322; color: var(--green); }
.market-state.CLOSED, .market-state.PRE, .market-state.POST {
    background: #8888aa22; color: var(--text-secondary);
}

/* --- Alerts Section --- */
.alerts-bar {
    padding: 0 8px;
}
.alert-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    font-size: 12px;
}
.alert-unexplained {
    background: #ff3d5718;
    border: 1px solid #ff3d5744;
}
.alert-explained {
    background: #00c85312;
    border: 1px solid #00c85333;
}
.alert-item .alert-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 4px;
}
.alert-item .alert-body {
    color: var(--text-secondary);
    font-size: 11px;
}

/* --- Loading / Error --- */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}
.error-msg {
    text-align: center;
    padding: 20px;
    color: var(--red);
    font-size: 12px;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .dashboard {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 700px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}
