/* BrickPulse — VS Code-inspired theme */

/* ── VS Code color tokens ──────────────────────────────────────────────── */
:root {
  --vscode-blue:         #007acc;
  --vscode-blue-dark:    #0e639c;
  --vscode-blue-bright:  #3794ff;
  --vscode-teal:         #4ec9b0;
  --vscode-soon:         #569cd6;   /* VS Code keyword blue — "not yet open" */
  --vscode-error:        #f48771;
}

/* ── Dark mode (default) — exact VS Code editor palette ───────────────── */
[data-bs-theme="dark"] {
  /* Bootstrap overrides */
  --bs-body-bg:              #1e1e1e;   /* VS Code editor bg */
  --bs-body-color:           #d4d4d4;   /* VS Code editor foreground */
  --bs-secondary-color:      #858585;   /* VS Code comments */
  --bs-border-color:         #3c3c3c;   /* VS Code panel border */
  --bs-card-bg:              #252526;   /* VS Code sidebar bg */
  --bs-table-color:          #d4d4d4;
  --bs-table-bg:             transparent;
  --bs-table-hover-bg:       rgba(255,255,255,.04);
  --bs-table-striped-bg:     rgba(255,255,255,.025);
  --bs-input-bg:             #3c3c3c;
  --bs-form-select-bg:       #3c3c3c;

  /* Custom */
  --card-shadow:     0 2px 8px rgba(0,0,0,.5);
  --stat-open-border:     var(--vscode-teal);
  --stat-soon-border:     var(--vscode-soon);
  --stat-delisted-border: var(--vscode-error);
}

/* ── Light mode ─────────────────────────────────────────────────────────── */
[data-bs-theme="light"] {
  --card-shadow:     0 1px 4px rgba(0,0,0,.1);
  --stat-open-border:     #22c55e;
  --stat-soon-border:     var(--vscode-soon);
  --stat-delisted-border: #ef4444;
}

/* ── Navbar — VS Code status-bar blue ──────────────────────────────────── */
.bam-navbar {
  background: var(--vscode-blue) !important;
  border-bottom: none;
}

.bam-navbar .navbar-brand {
  color: #ffffff !important;
  font-size: 1.15rem;
  letter-spacing: .01em;
}

.bam-navbar .nav-link {
  color: rgba(255,255,255,.82) !important;
  border-radius: 3px;
  transition: background .12s;
}

.bam-navbar .nav-link.active,
.bam-navbar .nav-link:hover {
  color: #ffffff !important;
  background: rgba(255,255,255,.15);
}

/* ── Scrape button ──────────────────────────────────────────────────────── */
.bam-btn-scrape {
  background-color: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.35);
  color: #ffffff;
  font-weight: 600;
}
.bam-btn-scrape:hover:not(:disabled) {
  background-color: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.5);
  color: #fff;
}
.bam-btn-scrape:disabled {
  opacity: .5;
}

/* ── Theme toggle ───────────────────────────────────────────────────────── */
.theme-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 3px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background .12s;
}
.theme-toggle:hover {
  background: rgba(255,255,255,.22);
  color: #fff;
}

/* ── Cards — VS Code panel style ───────────────────────────────────────── */
.card {
  border: 1px solid var(--bs-border-color) !important;
  border-radius: 3px;
  box-shadow: var(--card-shadow);
}

.card-header {
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.6rem 1rem;
  border-radius: 3px 3px 0 0 !important;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--bs-secondary-color);
}

/* ── Stat cards ─────────────────────────────────────────────────────────── */
.stat-card .stat-number {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--vscode-blue-bright);
}

[data-bs-theme="light"] .stat-card .stat-number {
  color: var(--vscode-blue-dark);
}

.stat-card .stat-label {
  font-size: 0.78rem;
  margin-top: 4px;
  color: var(--bs-secondary-color);
}

.stat-open     { border-top: 3px solid var(--stat-open-border)     !important; }
.stat-soon     { border-top: 3px solid var(--stat-soon-border)     !important; }
.stat-delisted { border-top: 3px solid var(--stat-delisted-border) !important; }

/* ── Social link buttons ────────────────────────────────────────────────── */
.btn-xs {
  padding: 2px 7px;
  font-size: 0.8rem;
  border-radius: 3px;
}

/* BaM page — VS Code blue family */
.bam-link-btn {
  background-color: rgba(0, 122, 204, .15);
  border-color:     rgba(55, 148, 255, .35);
  color: var(--vscode-blue-bright);
}
.bam-link-btn:hover {
  background-color: rgba(0, 122, 204, .30);
  color: #60bfff;
}

/* Facebook — softer blue */
.bam-fb-btn {
  background-color: rgba(59, 130, 246, .12);
  border-color:     rgba(59, 130, 246, .28);
  color: #60a5fa;
}
.bam-fb-btn:hover {
  background-color: rgba(59, 130, 246, .25);
  color: #93c5fd;
}

/* Instagram — pink */
.bam-ig-btn {
  background-color: rgba(236, 72, 153, .12);
  border-color:     rgba(236, 72, 153, .28);
  color: #f472b6;
}
.bam-ig-btn:hover {
  background-color: rgba(236, 72, 153, .25);
  color: #f9a8d4;
}

/* ── Light-mode button overrides ────────────────────────────────────────── */
[data-bs-theme="light"] .bam-link-btn               { background-color:#dbeafe; border-color:#93c5fd;  color:#1d4ed8; }
[data-bs-theme="light"] .bam-link-btn:hover         { background-color:#bfdbfe; }
[data-bs-theme="light"] .bam-fb-btn                 { background-color:#dbeafe; border-color:#bfdbfe;  color:#1d4ed8; }
[data-bs-theme="light"] .bam-fb-btn:hover           { background-color:#bfdbfe; }
[data-bs-theme="light"] .bam-ig-btn                 { background-color:#fce7f3; border-color:#fbcfe8;  color:#9d174d; }
[data-bs-theme="light"] .bam-ig-btn:hover           { background-color:#fbcfe8; }

/* ── State badge — VS Code variable-name colour ─────────────────────────── */
[data-bs-theme="dark"] .badge.bg-secondary {
  background-color: #37373d !important;
  color: #9cdcfe !important;   /* VS Code variable blue */
}

/* ── Rating state tags ──────────────────────────────────────────────────── */
.rating-state-tag {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
[data-bs-theme="dark"] .progress { background-color: #37373d; }

/* ── Spin animation ─────────────────────────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.spin { display: inline-block; animation: spin 1s linear infinite; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer { font-size: 0.78rem; }

/* ── Media page ─────────────────────────────────────────────────────────── */

.section-heading {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bs-border-color);
}

/* Video cards */
.video-card {
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}

.video-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
  border-radius: 3px 3px 0 0;
}
.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .15s;
}
.video-card:hover .video-thumb { opacity: .85; }

.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  font-size: 2.5rem;
  color: rgba(255,255,255,.9);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.video-card:hover .video-play-overlay { opacity: 1; }

.video-title {
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--bs-body-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-channel {
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.video-meta { font-size: .72rem; }

/* News cards */
.news-card {
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.news-source {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--vscode-blue-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-ago { font-size: .72rem; }
.news-title {
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--bs-body-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-snippet {
  font-size: .78rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Featured channel (Reckless Ben) */
.featured-channel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--vscode-error);
  color: #fff;
  font-size: .7rem;
}

.video-card-featured {
  border-color: rgba(244, 135, 113, .3) !important;
}
.video-card-featured:hover {
  border-color: var(--vscode-error) !important;
  box-shadow: 0 6px 20px rgba(244, 135, 113, .2);
}

/* ── Dashboard additions ────────────────────────────────────────────────── */

/* Disabled reviews callout inside Data Quality card */
.disabled-callout {
  background: rgba(244,135,113,.08);
  border: 1px solid rgba(244,135,113,.25);
  border-radius: 4px;
  padding: .5rem .7rem;
}
.disabled-callout-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--vscode-error);
  line-height: 1;
  margin-right: .3rem;
}
.disabled-callout-label {
  font-size: .75rem;
  color: var(--bs-body-color);
}

/* Spotlight news items */
.spotlight-news-item {
  padding: .75rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.spotlight-news-item:hover { background: var(--bs-border-color); }
.spotlight-news-title {
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--bs-body-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Comment Wall ───────────────────────────────────────────────────────── */

.wall-form-card { border-top: 3px solid var(--vscode-blue) !important; }

.wall-textarea {
  resize: vertical;
  min-height: 80px;
  font-size: .88rem;
}

.wall-submit-btn {
  background: var(--vscode-blue);
  border-color: var(--vscode-blue);
  color: #fff;
  font-weight: 600;
}
.wall-submit-btn:hover {
  background: var(--vscode-blue-dark);
  border-color: var(--vscode-blue-dark);
  color: #fff;
}

/* Comment list */
.wall-comments { display: flex; flex-direction: column; gap: 1rem; }

.wall-comment {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}

.wall-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--vscode-blue-dark);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.wall-body { flex: 1; min-width: 0; }

.wall-meta {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .25rem;
}

.wall-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--bs-body-color);
}

.wall-time { font-size: .72rem; }

.wall-message {
  font-size: .88rem;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--bs-body-color);
}

/* ── Admin panel ────────────────────────────────────────────────────────── */

.admin-comment-card { transition: box-shadow .12s; }
.admin-comment-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.25); }

.admin-btn-approve {
  background: rgba(78,201,176,.12);
  border-color: rgba(78,201,176,.3);
  color: var(--vscode-teal);
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 3px;
}
.admin-btn-approve:hover { background: rgba(78,201,176,.25); color: var(--vscode-teal); }

.admin-btn-flag {
  background: rgba(86,156,214,.12);
  border-color: rgba(86,156,214,.3);
  color: var(--vscode-soon);
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 3px;
}
.admin-btn-flag:hover { background: rgba(86,156,214,.25); color: var(--vscode-soon); }

.admin-control-card {
  background: var(--bs-border-color);
  border-radius: 4px;
  padding: .75rem;
  height: 100%;
}

[data-bs-theme="light"] .admin-control-card { background: #f8f9fa; }

.admin-btn-control {
  background: rgba(0, 122, 204, .15);
  border-color: rgba(0, 122, 204, .35);
  color: var(--vscode-blue-bright);
  font-size: .75rem;
  padding: 3px 10px;
  border-radius: 3px;
}
.admin-btn-control:hover {
  background: rgba(0, 122, 204, .28);
  color: var(--vscode-blue-bright);
}
.admin-btn-control:disabled { opacity: .5; }

.spin-badge { font-size: .65rem; }

.admin-btn-delete {
  background: rgba(244,135,113,.12);
  border-color: rgba(244,135,113,.3);
  color: var(--vscode-error);
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 3px;
}
.admin-btn-delete:hover { background: rgba(244,135,113,.25); color: var(--vscode-error); }

/* ── About page ─────────────────────────────────────────────────────────── */

/* Sticky sidebar TOC */
.about-toc-wrap {
  position: sticky;
  top: 1.5rem;
}
.about-toc {
  border-left: 2px solid var(--bs-border-color);
  padding-left: 1rem;
}
.about-toc-heading {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bs-secondary-color);
  margin-bottom: .5rem;
}
.about-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.about-toc-list li { margin-bottom: .25rem; }
.about-toc-link {
  font-size: .8rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  transition: color .12s;
  display: block;
}
.about-toc-link:hover { color: var(--vscode-blue-bright); }

/* Rendered markdown body */
.about-content { line-height: 1.7; }

.about-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  scroll-margin-top: 1rem;
}

.about-content p {
  font-size: .9rem;
  margin-bottom: .9rem;
  color: var(--bs-body-color);
}

.about-content ul,
.about-content ol {
  font-size: .9rem;
  padding-left: 1.4rem;
  margin-bottom: .9rem;
}
.about-content li { margin-bottom: .35rem; }

.about-content strong { color: var(--bs-body-color); }

.about-content blockquote {
  margin: 1rem 0;
  padding: .6rem 1rem;
  border-left: 3px solid var(--vscode-blue);
  background: rgba(0, 122, 204, .06);
  border-radius: 0 4px 4px 0;
  font-size: .88rem;
  color: var(--bs-secondary-color);
}
.about-content blockquote p { margin: 0; color: inherit; font-size: inherit; }

/* Footnote references (superscripts) */
.about-content sup a {
  color: var(--vscode-blue-bright);
  text-decoration: none;
  font-size: .7rem;
  font-weight: 600;
}
.about-content sup a:hover { text-decoration: underline; }

/* Footnotes section at the bottom */
.about-content .footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bs-border-color);
  font-size: .78rem;
  color: var(--bs-secondary-color);
}
.about-content .footnotes ol { padding-left: 1.2rem; }
.about-content .footnotes li { margin-bottom: .5rem; line-height: 1.5; }
.about-content .footnotes a { color: var(--vscode-blue-bright); }

/* ── Controversy Timeline ───────────────────────────────────────────────── */

.tl-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Executive summary */
.tl-summary-card { border-left: 3px solid var(--vscode-blue) !important; }

.tl-disclaimer {
  font-size: .78rem;
  color: var(--bs-secondary-color);
  line-height: 1.55;
  background: rgba(0,0,0,.15);
  border-left: 3px solid #555;
  border-radius: 0 3px 3px 0;
  padding: .45rem .7rem;
}

.tl-key-question {
  background: rgba(86, 156, 214, .08);
  border-left: 3px solid var(--vscode-soon);
  border-radius: 0 4px 4px 0;
  padding: .5rem .75rem;
  font-size: .85rem;
  font-style: italic;
  color: var(--bs-body-color);
}

/* Track (vertical line) */
.tl-track {
  position: relative;
  padding-left: 2rem;
}
.tl-track::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--bs-border-color);
}

/* Individual entry */
.tl-entry {
  position: relative;
  padding-bottom: 1.5rem;
}

.tl-dot {
  position: absolute;
  left: -1.6rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bs-card-bg);
  box-shadow: 0 0 0 2px var(--bs-border-color);
  z-index: 1;
}

/* Entry card */
.tl-card {
  border-radius: 4px;
  transition: box-shadow .15s;
}
.tl-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* Date badge */
.tl-date {
  font-size: .72rem;
  font-weight: 700;
  color: var(--bs-body-color);
  background: var(--bs-border-color);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Category chip */
.tl-cat-chip {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .07em;
  border: 1px solid;
  border-radius: 3px;
  padding: 1px 6px;
}

/* Event text */
.tl-event-text {
  font-size: .88rem;
  line-height: 1.55;
  color: var(--bs-body-color);
}

/* Why it matters */
.tl-why {
  font-size: .78rem;
  color: var(--bs-secondary-color);
  line-height: 1.5;
  border-top: 1px solid var(--bs-border-color);
  padding-top: .5rem;
}
.tl-why-label {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bs-secondary-color);
  margin-right: .4rem;
}

/* Source links inside cards */
.tl-sources { display: flex; flex-wrap: wrap; gap: .4rem; }
.tl-source-link {
  font-size: .72rem;
  color: var(--vscode-blue-bright);
  text-decoration: none;
  border: 1px solid rgba(55,148,255,.25);
  border-radius: 3px;
  padding: 1px 6px;
  transition: background .12s;
}
.tl-source-link:hover {
  background: rgba(55,148,255,.1);
  color: var(--vscode-blue-bright);
}

/* Source reference list at the bottom */
.tl-source-ref {
  font-size: .75rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  padding: .2rem .3rem;
  border-radius: 3px;
  transition: background .12s;
}
.tl-source-ref:hover {
  background: var(--bs-border-color);
  color: var(--bs-body-color);
}

/* ── Store name link in table ───────────────────────────────────────────── */
.store-name-link {
  color: inherit;
  text-decoration: none;
}
.store-name-link:hover {
  color: var(--vscode-blue-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Store detail page ──────────────────────────────────────────────────── */

/* Contact / detail rows */
.detail-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--bs-border-color);
}
.detail-row:last-child { border-bottom: none; }
.detail-row i { width: 14px; text-align: center; flex-shrink: 0; }

/* WPSL hours table override for dark theme */
.hours-wrap { flex: 1; }
.wpsl-opening-hours { width: 100%; border-collapse: collapse; }
.wpsl-opening-hours td {
  padding: 1px 6px 1px 0;
  font-size: 0.8rem;
  color: var(--bs-body-color);
  vertical-align: top;
}
.wpsl-opening-hours td:first-child {
  color: var(--bs-secondary-color);
  width: 42%;
  white-space: nowrap;
}

/* Rating chips */
.rating-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bs-card-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 4px;
  min-width: 90px;
}
.rating-chip-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--bs-body-color);
}
.rating-chip-label {
  font-size: 0.68rem;
  color: var(--bs-secondary-color);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Timeline */
.timeline { padding: 0.25rem 0; }
.timeline-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding-bottom: 0.9rem;
  position: relative;
}
.timeline-item:not(.timeline-item-last)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--bs-border-color);
}
.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.timeline-label {
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
  line-height: 1;
}
.timeline-date {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 2px;
}

/* Leaflet dark-mode map tile overlay */
[data-bs-theme="dark"] .leaflet-tile {
  filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9);
}
[data-bs-theme="dark"] .leaflet-container {
  background: #1e1e1e;
}
[data-bs-theme="dark"] .leaflet-popup-content-wrapper,
[data-bs-theme="dark"] .leaflet-popup-tip {
  background: #252526;
  color: #d4d4d4;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
[data-bs-theme="dark"] .leaflet-popup-close-button { color: #858585; }
