/* DATA101M — E. coli AMR Dashboard Styles
   Matching the approved HTML mockup (mockup.html) */

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

body {
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f2f2f2;
    color: #333;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
    background: #119DFF;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
    flex-wrap: wrap;
}
.navbar h1 { font-size: 20px; font-weight: 600; }
.navbar .subtitle { font-size: 13px; opacity: .85; }

/* ── Tab bar (override Dash default tabs) ───────────── */
.tab-bar {
    border-bottom: 2px solid #e8e8e8 !important;
    background: #fff;
    padding: 0 24px;
}
.tab-bar .tab {
    padding: 12px 24px !important;
    border: none !important;
    background: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #666 !important;
    border-bottom: 3px solid transparent !important;
    transition: all .2s;
}
.tab-bar .tab:hover { color: #119DFF !important; }
.tab-bar .tab--selected {
    color: #119DFF !important;
    border-bottom-color: #119DFF !important;
    background: none !important;
}

/* ── Content area ───────────────────────────────────── */
.content { padding: 20px 24px; max-width: 1400px; margin: 0 auto; }

/* ── Cards ──────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    padding: 16px;
    margin-bottom: 16px;
    min-width: 0;
}
.card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

/* ── Controls row ───────────────────────────────────── */
.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.control-group { min-width: 140px; }
.control-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ── Year slider ────────────────────────────────────── */
.year-slider-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    flex: 1;
}
.year-badge {
    display: inline-block;
    background: #119DFF;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 3px 12px;
    border-radius: 14px;
    min-width: 52px;
    text-align: center;
}

/* Style the Dash slider (Dash 4.x uses Radix UI — dash-slider-* classes) */
.dash-slider-range { background-color: transparent !important; }
.dash-slider-thumb {
    border-color: #119DFF !important;
    background-color: #119DFF !important;
    width: 18px !important;
    height: 18px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.25) !important;
}
.dash-slider-thumb:hover,
.dash-slider-thumb:active {
    border-color: #0d7cc0 !important;
}
.dash-slider-track { background-color: #dde4ea !important; }

/* ── Grid layouts ───────────────────────────────────── */
.grid-2col {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 16px;
}
.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Summary table row interaction ──────────────────── */
.dash-spreadsheet-container .dash-spreadsheet-inner td {
    cursor: pointer;
    transition: background .15s;
}

/* ── Floating tooltip (Dash DataTable tooltip) ──────── */
.dash-table-tooltip {
    position: fixed !important;
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 14px 16px !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    max-width: 420px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.35) !important;
    border: none !important;
    pointer-events: none;
    z-index: 9999 !important;
}
.dash-table-tooltip .dash-tooltip-content {
    max-width: 420px;
}
.dash-table-tooltip strong {
    color: #fff;
}
.dash-table-tooltip em {
    color: #7eb8da;
    font-size: 11px;
}
.dash-table-tooltip hr {
    border: none;
    border-top: 1px solid #333;
    margin: 8px 0;
}
.dash-table-tooltip p {
    margin: 2px 0;
}

/* ── Chips ──────────────────────────────────────────── */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 4px;
}

/* ── Source badge ────────────────────────────────────── */
.source-badge {
    display: inline-block;
    background: #eef6ed;
    color: #2d7d2d;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    margin-top: 6px;
}

/* ── Raw data tables ────────────────────────────────── */
.raw-data-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.raw-scroll {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* ── Empty state ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
    font-style: italic;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .grid-2col { grid-template-columns: 1fr; }
    .grid-2x2 { grid-template-columns: 1fr; }
    .controls-row { flex-direction: column; }
}

/* ── Raw table export button ────────────────────────── */
.table-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}
.btn-export {
    background: #119DFF;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 0.3px;
}
.btn-export:hover { background: #0d82d8; }
