/* =========================================
   1. GLOBALS & LAYOUT
   ========================================= */
html, body { 
    width: 100%; 
    overflow-x: hidden; 
    margin: 0; 
    padding: 0; 
}
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background-color: #1a1a1a; 
    color: white; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh; 
    padding: 20px; 
    box-sizing: border-box; 
}
.card { 
    background: #2d2d2d; 
    padding: 1.2rem 2rem 2rem 2rem; 
    border-radius: 15px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    text-align: center; 
}
.card h3 { 
    margin-top: 0; 
    margin-bottom: 20px; 
}

/* =========================================
   2. TAB NAVIGATION
   ========================================= */
.tabs-nav { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    width: 100%; 
    max-width: 1200px; 
    justify-content: center; 
    flex-wrap: wrap; 
}
.tab-btn { 
    background: #2d2d2d; 
    color: #ccc; 
    border: 2px solid #444; 
    padding: 10px 25px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: 600; 
    transition: all 0.2s ease; 
    outline: none; 
}
.tab-btn:hover { 
    background: #383838; 
    color: #fff; 
    border-color: #555; 
}
.tab-btn.active { 
    background: #2ecc71; 
    color: #1a1a1a; 
    border-color: #27ae60; 
}
.tab-content { 
    display: none; 
    width: 100%; 
    max-width: 1200px; 
    flex-direction: column; 
    gap: 20px; 
    box-sizing: border-box; 
}
.tab-content.active { 
    display: flex; 
    animation: fadeIn 0.3s ease; 
}
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* =========================================
   3. MAIN DASHBOARD PANELS (TOP SPLIT)
   ========================================= */
.split-container { 
    display: flex; 
    flex-direction: row; 
    gap: 20px; 
    align-items: stretch; 
    width: 100%; 
}
.panel { 
    flex: 1; 
    min-width: 250px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-start; 
}
.panel-title { 
    font-size: 1.5rem; 
    font-weight: 300; 
    margin: 0; 
    color: #ddd; 
    text-align: center; 
}
.indicator { 
    width: 120px; 
    height: 120px; 
    border-radius: 50%; 
    margin: 0 auto 20px; 
    border: 5px solid #444; 
    flex-shrink: 0; 
    transition: all 0.5s;
    background: #111; /* Default dark background before JS loads */
}
.status-info { 
    margin-top: 15px; 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
    align-items: center; 
    text-align: center; 
}
.reason-text { font-size: 0.9rem; color: #ccc; }
.mw-text { font-size: 0.9rem; color: #2ecc71; line-height: 1.4; }

/* Dashboard Legend */
.legend { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    flex-wrap: wrap; 
    margin-top: 15px; 
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: #ccc; }
.legend-color { width: 14px; height: 14px; border-radius: 3px; }
.leg-green { background: #2ecc71; }
.leg-yellow { background: #f1c40f; }
.leg-red { background: #e74c3c; }

/* =========================================
   4. BANNERS
   ========================================= */
#banners-container {
    display: flex;
    flex-direction: column;
    gap: 12px; /* This adds space BETWEEN the banners, not outside them */
}
.status-banner {
    background-color: #2a2a2a; 
    color: #eeeeee;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    border-left: 6px solid transparent; 
}
.status-banner strong { color: #ffffff; }
.border-red { border-left-color: #e74c3c; }
.border-yellow { border-left-color: #f1c40f; }

/* =========================================
   5. STATS GRID
   ========================================= */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; 
}
.stat-box { 
    background: #383838; 
    padding: 10px; 
    border-radius: 10px; 
    text-align: center; 
}
.stat-value { font-size: 1.8rem; font-weight: 700; color: #fff; margin-bottom: 5px; }
.stat-label { font-size: 0.85rem; color: #aaa; text-transform: uppercase; letter-spacing: 1px; }
.stat-sub { font-size: 0.75rem; color: #666; margin-top: 3px; }

/* =========================================
   6. YEARLY CHART
   ========================================= */
.yearly-chart-container { width: 100%; }
.chart-area { position: relative; height: 80px; width: 100%; }
.chart-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.75rem; color: #888; }
.chart-label-item { position: relative; cursor: help; }

/* =========================================
   7. OPERATIONAL HISTORY (HEATMAP)
   ========================================= */
.heatmap-container { display: flex; flex-direction: column; gap: 15px; width: 100%; }
.year-block { display: flex; flex-direction: row; border-bottom: 1px solid #444; padding-bottom: 10px; }
.year-label { width: 50px; font-size: 1.2rem; font-weight: bold; color: #888; margin-right: 15px; flex-shrink: 0; }
.quarters-container { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.quarter-row { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.q-label { font-size: 0.7rem; color: #555; width: 20px; text-align: center; }

/* Heatmap Dots */
.day { width: 8px; height: 8px; background: #444; border-radius: 2px; position: relative; cursor: help; }
.d-green { background: #26662f; }
.d-yellow { background: #c7a20c; }
.d-red { background: #ba1c0d; }
.d-withmessage { background: #26662f; box-shadow: inset 0 0 0 1px #1fad30; }

.heatmap-legend-desc {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    text-align: left;
    max-width: 800px;
}

/* =========================================
   8. TOOLTIPS (Shared by Heatmap & Yearly)
   ========================================= */
.day::before, .chart-label-item::before { 
    content: attr(data-tooltip); 
    position: absolute; 
    bottom: 140%; 
    left: 50%; 
    transform: translateX(-50%); 
    background: rgba(0,0,0,0.9); 
    color: #fff; 
    padding: 6px 10px; 
    border-radius: 4px; 
    font-size: 0.8rem; 
    white-space: pre; 
    text-align: center; 
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.2s; 
    min-width: 120px; 
    z-index: 1001; 
    pointer-events: none;
}
.day:hover::before, .chart-label-item:hover::before { 
    opacity: 1; 
    visibility: visible; 
}

/* =========================================
   9. ABOUT / CHANGELOG TAB
   ========================================= */
.text-card { 
    background: #2d2d2d; 
    padding: 2.5rem; 
    border-radius: 15px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    text-align: left; 
    line-height: 1.7; 
    color: #ddd; 
}
.text-card h2 { margin-top: 0; color: #fff; border-bottom: 1px solid #444; padding-bottom: 10px; margin-bottom: 20px; font-size: 1.8rem; }
.text-card h3 { color: #2ecc71; margin-top: 35px; margin-bottom: 15px; font-size: 1.3rem; }
.text-card p { margin-bottom: 15px; }

/* Changelog Entries */
.changelog-entry { margin-bottom: 25px; padding-left: 20px; border-left: 3px solid #444; }
.changelog-date { font-size: 0.85rem; color: #888; margin-bottom: 5px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.changelog-title { font-size: 1.1rem; color: #fff; margin-bottom: 5px; font-weight: bold; }
.changelog-desc { font-size: 0.95rem; color: #bbb; }

/* =========================================
   10. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .split-container { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .text-card { padding: 1.5rem; }
    
    /* Rotate Yearly Chart labels on small screens */
    .chart-labels { margin-top: 15px; height: 45px; }
    .chart-label-item { 
        transform: rotate(90deg) translate(5px, 11px); 
        transform-origin: left center; 
        width: 0; 
        white-space: nowrap; 
    }
}

/* =========================================
   11. MARKET CHART LOADER
   ========================================= */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: #2ecc71;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}
.market-loader-text {
    color: #aaa;
    font-size: 1rem;
    margin-bottom: 5px;
}
.market-loader-sub {
    color: #666;
    font-size: 0.85rem;
}
