/* EPA Ozone Dashboard — TSF Demand */

#epa-ozone-dashboard-root * { box-sizing: border-box; }

.eod-header {
  background: #820a02;
  color: #fff;
  padding: 20px 30px;
  margin-bottom: 20px;
}
.eod-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: #fde047;
}
.eod-header-sub {
  font-size: 14px;
  color: #fff;
  margin: 5px 0 0;
}
.eod-header-date {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-top: 8px;
}

.eod-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Controls */
.eod-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}
.eod-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.eod-control-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.eod-control-group select,
.eod-control-group input[type="date"] {
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
}
.eod-control-group select:focus,
.eod-control-group input[type="date"]:focus {
  outline: none;
  border-color: #fde047;
  box-shadow: 0 0 0 2px rgba(14,124,107,0.15);
}
.eod-download-btn {
  padding: 8px 16px;
  background: #0e5c3a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.eod-download-btn:hover { background: #0a4a2e; }
.eod-download-btn:disabled { background: #94a3b8; cursor: not-allowed; }

/* Legend */
.eod-legend-box {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 15px;
  font-size: 12px;
  color: #555;
}
.eod-legend-box strong { color: #1a1a2e; }
.eod-exceedance { color: #b91c1c; font-weight: 600; }
.eod-consecutive { color: #9a3412; font-weight: 600; }

/* Cards */
.eod-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.eod-card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.eod-card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.eod-card-header h3 {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 400;
  margin: 0;
}
.eod-card-body {
  padding: 20px;
}

/* Metric grid */
.eod-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.eod-metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.eod-metric-card.alert {
  background: #fff1f1;
  border-color: #fca5a5;
}
.eod-metric-card.warning {
  background: #fff7ed;
  border-color: #fdba74;
}
.eod-metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
  margin-bottom: 4px;
}
.eod-metric-card.alert .eod-metric-value { color: #b91c1c; }
.eod-metric-card.warning .eod-metric-value { color: #c2410c; }
.eod-metric-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.eod-metric-consec {
  font-size: 0.72rem;
  color: #b91c1c;
  font-weight: 600;
  margin-top: 4px;
}

/* Chart */
.eod-chart-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 8px;
}

/* Table */
.eod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}
.eod-table th {
  background: #f1f5f9;
  padding: 9px 12px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.eod-table th.right,
.eod-table td.right { text-align: right; }
.eod-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.eod-table tbody tr:hover { background: #f8fafc; cursor: pointer; }
.eod-table tbody tr:last-child td { border-bottom: none; }
.eod-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.eod-badge-red { background: #fee2e2; color: #b91c1c; }
.eod-badge-orange { background: #ffedd5; color: #c2410c; }
.eod-badge-green { background: #dcfce7; color: #15803d; }

/* Loading */
.eod-loading {
  padding: 40px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
  .eod-header { padding: 20px 16px 14px; }
  .eod-header h1 { font-size: 1.3rem; }
  .eod-metric-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Walmart-style chart legend */
.wmd-legend { display: flex; gap: 20px; justify-content: center; margin-top: 10px; font-size: 12px; flex-wrap: wrap; }
.wmd-legend-item { display: flex; align-items: center; gap: 6px; }

.eod-back-btn { background: #1a1a2e; color: #fde047; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; }
.eod-back-btn:hover { background: #2a2a4e; }
.eod-table tr.clickable { cursor: pointer; }
.eod-table tr.clickable:hover td { background: #f0f9f6; }
