/* IBD LitMonitor — Stanford color palette (verified from aimi.stanford.edu) */
/* Cardinal #8C1515 | Bright Cardinal #B1040E | Black #2e2d29 | Link blue #006CB8 */

:root {
  --brand-primary:   #8C1515;   /* Stanford Cardinal (brand bar) */
  --brand-hover:     #B1040E;   /* Stanford Bright Cardinal (hover/active) */
  --brand-dark:      #2e2d29;   /* Stanford Black */
  --brand-light:     #f9f6f6;   /* Warm off-white */
  --brand-fog:       #f4f4f4;   /* Stanford Fog */
  --brand-sand:      #d2c295;   /* Stanford Sandstone */
  --brand-secondary: #175E54;   /* Stanford Palo Alto (teal) */
  --brand-link:      #006CB8;   /* AIMI link blue */
  --text-dark:       #2e2d29;
  --text-muted:      #6b6b6b;
}

/* Navbar */
.navbar {
  background-color: var(--brand-primary) !important;
  font-weight: 600;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Stat boxes */
.stat-box {
  background: linear-gradient(135deg, #B1040E 0%, #8C1515 100%);
  color: white;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px rgba(177, 4, 14, 0.25);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  margin: 0;
}

.stat-label {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Paper expand cards */
.paper-card {
  background: white;
  border-left: 4px solid var(--brand-primary);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease;
}

.paper-card:hover {
  box-shadow: 0 3px 12px rgba(140, 21, 21, 0.12);
}

/* Abstract panels */
details > div {
  border-left-color: var(--brand-primary) !important;
  background: var(--brand-light) !important;
}

/* Links */
a {
  color: var(--brand-primary);
}

a:hover {
  color: var(--brand-hover);
}

/* Buttons */
.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}

/* DataTables download buttons */
.dt-button {
  background: var(--brand-primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
  padding: 5px 14px !important;
  margin-right: 6px !important;
}

.dt-button:hover {
  background: var(--brand-hover) !important;
}

/* Category filters */
.category-btn {
  background: white;
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-btn:hover,
.category-btn.active {
  background: var(--brand-primary);
  color: white;
}

/* Footer */
.page-footer {
  background-color: var(--brand-light);
  padding: 2rem 0;
  margin-top: 4rem;
  border-top: 3px solid var(--brand-sand);
}

/* Callout accent */
.callout-note {
  border-left-color: var(--brand-primary) !important;
}

.callout-tip {
  border-left-color: var(--brand-secondary) !important;
}

/* Badges */
.badge-rct {
  background-color: var(--brand-primary);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-left: 0.4rem;
}

/* Hide code blocks */
.cell-code {
  display: none;
}

/* ── Dashboard filter bar ──────────────────────────────────────────────── */

.ibd-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  background: var(--brand-fog);
  border: 1px solid #e0ddd8;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.ibd-filter-group {
  display: flex;
  flex-direction: column;
  min-width: 160px;
}

.ibd-filter-group.ibd-filter-dates {
  min-width: 260px;
}

.ibd-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.ibd-filter-select {
  height: 36px;
  padding: 4px 10px;
  border: 1px solid #c8c4be;
  border-radius: 5px;
  background: white;
  font-size: 0.88rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: border-color 0.15s;
}

.ibd-filter-select:focus,
.ibd-filter-select:hover {
  border-color: var(--brand-primary);
  outline: none;
}

.ibd-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ibd-filter-date {
  height: 36px;
  padding: 4px 8px;
  border: 1px solid #c8c4be;
  border-radius: 5px;
  background: white;
  font-size: 0.86rem;
  color: var(--text-dark);
  width: 130px;
  transition: border-color 0.15s;
}

.ibd-filter-date:focus,
.ibd-filter-date:hover {
  border-color: var(--brand-primary);
  outline: none;
}

.ibd-date-sep {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ibd-flagship-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-dark);
  cursor: pointer;
  height: 36px;
}

.ibd-flagship-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.ibd-clear-btn {
  height: 36px;
  padding: 0 16px;
  background: white;
  border: 1px solid #c8c4be;
  border-radius: 5px;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.ibd-clear-btn:hover {
  border-color: var(--brand-hover);
  color: var(--brand-hover);
  background: #fff5f5;
}

.ibd-filter-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: help;
  margin-left: 3px;
}

.ibd-filter-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 3px;
  line-height: 1.2;
}

/* Responsive */
@media (max-width: 768px) {
  .paper-card { padding: 1rem; }
  .stat-number { font-size: 2rem; }
  .ibd-filter-bar { flex-direction: column; }
  .ibd-filter-group { min-width: 100%; }
  .ibd-filter-date { width: 100%; }
}

/* ── Dark mode ─────────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .ibd-filter-bar {
  background: #1e1e1e;
  border-color: #444;
}

[data-bs-theme="dark"] .ibd-filter-select,
[data-bs-theme="dark"] .ibd-filter-date {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #555;
}

[data-bs-theme="dark"] .ibd-filter-select:focus,
[data-bs-theme="dark"] .ibd-filter-select:hover,
[data-bs-theme="dark"] .ibd-filter-date:focus,
[data-bs-theme="dark"] .ibd-filter-date:hover {
  border-color: var(--brand-hover);
}

[data-bs-theme="dark"] .ibd-clear-btn {
  background: #2a2a2a;
  color: #aaa;
  border-color: #555;
}

[data-bs-theme="dark"] .ibd-clear-btn:hover {
  border-color: var(--brand-hover);
  color: var(--brand-hover);
  background: #2a0000;
}

[data-bs-theme="dark"] .ibd-flagship-label {
  color: #e0e0e0;
}

[data-bs-theme="dark"] .ibd-filter-label,
[data-bs-theme="dark"] .ibd-date-sep,
[data-bs-theme="dark"] .ibd-filter-note,
[data-bs-theme="dark"] .ibd-filter-hint {
  color: #aaa;
}

[data-bs-theme="dark"] .paper-card {
  background: #1e1e1e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

[data-bs-theme="dark"] details > div {
  background: #1e1e1e !important;
}

/* DataTable dark mode — ensure text is readable */
[data-bs-theme="dark"] table.dataTable tbody td,
[data-bs-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] .dataTables_wrapper,
[data-bs-theme="dark"] .dataTables_info,
[data-bs-theme="dark"] .dataTables_length,
[data-bs-theme="dark"] .dataTables_filter,
[data-bs-theme="dark"] .dataTables_paginate {
  color: #e0e0e0 !important;
}

[data-bs-theme="dark"] table.dataTable tbody tr {
  background-color: #1a1a1a !important;
}

[data-bs-theme="dark"] table.dataTable tbody tr:hover {
  background-color: #2a2a2a !important;
}

[data-bs-theme="dark"] table.dataTable thead {
  background-color: #111 !important;
}
