/* assets/oil-price-dashboard.css */

.oil-price-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  background: #0b1727;
  color: #e9f2ff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.oil-price-dashboard h2 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  color: #f5f8ff;
}

.oil-price-dashboard p {
  margin: 0 0 1rem;
  color: #a7b6d9;
  font-size: 0.95rem;
}

.op-header {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 1rem;
  margin-bottom: 1.2rem;
}

.op-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-top: 0.5rem;
}

.op-controls label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #d0ddff;
}

.op-controls select {
  background: #102037;
  color: #e9f2ff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  font-size: 0.9rem;
}

.op-controls input[type="checkbox"] {
  accent-color: #4fa3ff;
}

.op-controls button {
  background: #1b4b9b;
  color: #f5f8ff;
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.op-controls button:hover {
  background: #2460c2;
  transform: translateY(-1px);
}

.op-controls button:active {
  transform: translateY(0);
}

/* Layout: each chart row is full width */
.op-main {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.op-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.op-card {
  background: #101b2b;
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.05);
}

.op-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #f0f4ff;
}

.op-card canvas {
  width: 100% !important;
  max-height: 360px;
}

/* Make the heatmap a bit taller */
#heatChart {
  max-height: 420px;
}

/* Table styles */
.op-table-wrapper {
  max-height: 360px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}

#dataTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#dataTable thead {
  background: #141f32;
  position: sticky;
  top: 0;
  z-index: 1;
}

#dataTable th,
#dataTable td {
  padding: 0.35rem 0.5rem;
  text-align: center; /* center everything for cleaner look */
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}

#dataTable tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.015);
}

#dataTable tbody tr:hover {
  background: rgba(94,148,255,0.12);
}

/* Debug card */
.op-debug {
  font-size: 0.8rem;
  background: #151f33;
  border-left: 3px solid #ffb55c;
  color: #e9f2ff;
  overflow: auto;
}

.op-debug pre {
  margin: 0;
  white-space: pre-wrap;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .oil-price-dashboard {
    padding: 1rem;
  }

  .op-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .op-controls button {
    width: 100%;
    text-align: center;
  }

  .op-card canvas {
    max-height: 320px;
  }
}

/* -------- Day mode (light theme) -------- */

.oil-price-dashboard.day-mode {
  background: #f5f7fb;
  color: #111827;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.oil-price-dashboard.day-mode h2,
.oil-price-dashboard.day-mode h3 {
  color: #111827;
}

.oil-price-dashboard.day-mode p {
  color: #4b5563;
}

.oil-price-dashboard.day-mode .op-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
}

.oil-price-dashboard.day-mode .op-header {
  border-bottom-color: rgba(0,0,0,0.08);
}

.oil-price-dashboard.day-mode .op-controls select {
  background: #ffffff;
  color: #111827;
  border-color: rgba(0,0,0,0.1);
}

.oil-price-dashboard.day-mode .op-controls button {
  background: #2563eb;
  color: #f9fafb;
}

.oil-price-dashboard.day-mode .op-controls button:hover {
  background: #1d4ed8;
}

.oil-price-dashboard.day-mode #dataTable thead {
  background: #e5e7eb;
}

.oil-price-dashboard.day-mode #dataTable tbody tr:nth-child(even) {
  background: #f3f4f6;
}

.oil-price-dashboard.day-mode #dataTable tbody tr:hover {
  background: #dbeafe;
}

.oil-price-dashboard.day-mode .op-debug {
  background: #fef3c7;
  border-left-color: #f59e0b;
  color: #7c2d12;
}
