/* ═══════════════════════════════════════════════════════════════════════════
   min-kanal-tier1.css — Min-kanal-panel + Tier 1 styling
   Patch 11 (udvidelse af patch 10-styling)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────────
   #myChannelPanel — Hovedpanel øverst på Søg-fanen
   ────────────────────────────────────────────────────────────────────────── */
#myChannelPanel {
  background: linear-gradient(135deg,
    rgba(255, 69, 0, 0.04),
    rgba(30, 35, 50, 0.4));
  border: 1px solid rgba(255, 140, 50, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 12px 0 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mcp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.mcp-header-info {
  flex: 1;
  min-width: 0;
}

.mcp-handle {
  font-size: 18px;
  font-weight: 700;
  color: #ff8c4a;
  margin-bottom: 4px;
}

.mcp-meta {
  font-size: 13px;
  color: #a0a8b0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.mcp-stat b {
  color: #e0e8f0;
  font-weight: 600;
}

.mcp-fetched {
  color: #7a8290;
  font-size: 11px;
  font-style: italic;
}

.mcp-refresh-btn {
  background: rgba(255, 140, 50, 0.15);
  color: #ff8c4a;
  border: 1px solid rgba(255, 140, 50, 0.4);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mcp-refresh-btn:hover:not(:disabled) {
  background: rgba(255, 140, 50, 0.25);
  border-color: rgba(255, 140, 50, 0.7);
}

.mcp-refresh-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ──────────────────────────────────────────────────────────────────────────
   Panel-layout: grid af sub-sektioner
   ────────────────────────────────────────────────────────────────────────── */
.mcp-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.mcp-body > .mcp-top-videos {
  grid-column: 1 / 2;
  grid-row: 1 / 4;
}

.mcp-body > .mcp-niche-median {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.mcp-body > .mcp-format-mix {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

/* Upload-frekvens-boksen sidder nu som 3. boks i højre kolonne — danner
   en sammenhængende KPI-spalte med niche-median + format-mix. */
.mcp-body > .mcp-upload-freq {
  grid-column: 2 / 3;
  grid-row: 3 / 4;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
}

@media (max-width: 900px) {
  .mcp-body {
    grid-template-columns: 1fr;
  }
  .mcp-body > .mcp-top-videos,
  .mcp-body > .mcp-niche-median,
  .mcp-body > .mcp-format-mix,
  .mcp-body > .mcp-upload-freq {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

.mcp-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b98a8;
  font-weight: 600;
  margin-bottom: 8px;
}

.mcp-empty {
  color: #7a8290;
  font-size: 13px;
  font-style: italic;
  padding: 12px;
  text-align: center;
}

/* ──────────────────────────────────────────────────────────────────────────
   Top 5-videoer grid (#74)
   ────────────────────────────────────────────────────────────────────────── */
.mcp-tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.mcp-tv-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.mcp-tv-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 140, 50, 0.4);
}

.mcp-tv-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #1a1d25;
  display: block;
}

.mcp-tv-nothumb {
  background: linear-gradient(135deg, #1a1d25, #2a2f3d);
}

.mcp-tv-meta {
  padding: 8px 10px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.mcp-tv-title {
  font-size: 12px;
  line-height: 1.35;
  color: #e0e8f0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.mcp-tv-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #a0a8b0;
  margin-top: auto;
}

.mcp-tv-shorts {
  background: rgba(255, 0, 0, 0.15);
  color: #ff6b6b;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────────────────
   Channel×-badges på top-videoer (#74)
   vidIQ outlier-terminologi
   ────────────────────────────────────────────────────────────────────────── */
.cm-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
  cursor: help;
}

.cm-under {
  background: rgba(128, 128, 128, 0.25);
  color: #888;
  border: 1px solid rgba(128, 128, 128, 0.4);
}

.cm-normal {
  background: rgba(90, 120, 150, 0.2);
  color: #a0b8d0;
  border: 1px solid rgba(90, 120, 150, 0.4);
}

.cm-outlier {
  background: rgba(46, 160, 67, 0.25);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.5);
}

.cm-viral {
  background: linear-gradient(135deg,
    rgba(255, 195, 0, 0.3),
    rgba(255, 140, 0, 0.3));
  color: #ffd43b;
  border: 1px solid rgba(255, 180, 0, 0.6);
  box-shadow: 0 0 6px rgba(255, 180, 0, 0.4);
}

.cm-unknown {
  background: rgba(100, 100, 100, 0.15);
  color: #777;
  border: 1px dashed rgba(100, 100, 100, 0.35);
}

/* ──────────────────────────────────────────────────────────────────────────
   Outliers-sektion (#79) — dine videoer med Channel× ≥ 3
   ────────────────────────────────────────────────────────────────────────── */
.mcp-outliers {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 180, 0, 0.18);
  grid-column: 1 / -1;  /* full width under top 5 */
}

.mcp-section-meta {
  font-size: 10px;
  color: #7a8290;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin-left: 8px;
}

.mcp-outlier-card {
  border-color: rgba(255, 180, 0, 0.3) !important;
  background: linear-gradient(
    135deg,
    rgba(255, 195, 0, 0.04),
    rgba(255, 255, 255, 0.04)
  ) !important;
}

.mcp-outlier-card:hover {
  border-color: rgba(255, 180, 0, 0.6) !important;
}

.mcp-outliers-empty {
  font-size: 12px;
  color: #8b98a8;
  line-height: 1.6;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  max-width: 640px;
}

/* ──────────────────────────────────────────────────────────────────────────
   Content-gap-sektion (#78) — emner nichen elsker, som du ikke dækker
   ────────────────────────────────────────────────────────────────────────── */
.mcp-content-gap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(168, 85, 247, 0.22);
  grid-column: 1 / -1;
}

.cg-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}

.cg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  min-height: 30px;
}

.cg-phrase {
  color: #e0d0ff;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cg-count {
  color: #a0a8b0;
  font-size: 10px;
  white-space: nowrap;
}

.cg-example {
  color: #c084fc;
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.cg-example:hover {
  background: rgba(168, 85, 247, 0.15);
  color: #e0d0ff;
}

/* ──────────────────────────────────────────────────────────────────────────
   Inspirations-videoer (Patch 13c) — konkrete outlier-videoer
   ────────────────────────────────────────────────────────────────────────── */
.mcp-inspiration-videos {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(168, 85, 247, 0.22);
  grid-column: 1 / -1;
}

.mcp-iv-grid {
  /* Lidt smallere kort end top-5 så 4 passer i bredden på desktops */
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* ── Algrow Outliers — fast 6 spalter × 2 rækker (12 per side via pagination) ─ */
.mcp-algrow-outliers-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 10px;
}
@media (max-width: 1400px) {
  .mcp-algrow-outliers-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}
@media (max-width: 1100px) {
  .mcp-algrow-outliers-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
@media (max-width: 850px) {
  .mcp-algrow-outliers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 600px) {
  .mcp-algrow-outliers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Pagination — grøn tone (matcher Algrow-branding). Bruges af outliers + trending */
.mcp-algrow-outliers-pagination,
.mcp-algrow-trending-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.mcp-algrow-outliers-pagination .alg-page-info,
.mcp-algrow-trending-pagination .alg-page-info {
  color: #888;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  margin-right: 8px;
}
.mcp-algrow-outliers-pagination button,
.mcp-algrow-trending-pagination button {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #86efac;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s;
}
.mcp-algrow-outliers-pagination button:hover:not(:disabled):not(.alg-page-active),
.mcp-algrow-trending-pagination button:hover:not(:disabled):not(.alg-page-active) {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.55);
  color: #fff;
}
.mcp-algrow-outliers-pagination button.alg-page-active,
.mcp-algrow-trending-pagination button.alg-page-active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.4), rgba(22, 163, 74, 0.4));
  border-color: rgba(34, 197, 94, 0.7);
  color: #fff;
  cursor: default;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.3);
}
.mcp-algrow-outliers-pagination button:disabled,
.mcp-algrow-trending-pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.mcp-algrow-outliers-pagination .alg-page-ellipsis,
.mcp-algrow-trending-pagination .alg-page-ellipsis {
  color: #666;
  padding: 0 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.mcp-inspiration-card {
  border-color: rgba(168, 85, 247, 0.25) !important;
  background: linear-gradient(
    135deg,
    rgba(168, 85, 247, 0.06),
    rgba(255, 255, 255, 0.03)
  ) !important;
}

.mcp-inspiration-card:hover {
  border-color: rgba(168, 85, 247, 0.55) !important;
}

.iv-channel {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #8b98a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcp-iv-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.mcp-iv-algrow,
.mcp-iv-deepdive {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
}
.mcp-iv-algrow {
  border: 1px solid rgba(76, 175, 80, 0.5);
  color: #81c784;
}
.mcp-iv-algrow:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.8);
  color: #c8e6c9;
}
.mcp-iv-deepdive {
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
}
.mcp-iv-deepdive:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.8);
  color: #bae6fd;
}

/* ──────────────────────────────────────────────────────────────────────────
   Multi-kanal sammenligningstabel (Patch 14, Task #77)
   ────────────────────────────────────────────────────────────────────────── */
.mcp-multi-channel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(100, 180, 220, 0.22);
  grid-column: 1 / -1;
}

.mc-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mc-add-input {
  flex: 1;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #e0e8f0;
  font-family: inherit;
}

.mc-add-input:focus {
  outline: none;
  border-color: rgba(100, 180, 220, 0.5);
}

.mc-add-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mc-add-btn,
.mc-refresh-all-btn {
  background: rgba(100, 180, 220, 0.15);
  color: #6cb3dc;
  border: 1px solid rgba(100, 180, 220, 0.4);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.mc-add-btn:hover:not(:disabled),
.mc-refresh-all-btn:hover:not(:disabled) {
  background: rgba(100, 180, 220, 0.25);
  border-color: rgba(100, 180, 220, 0.7);
}

.mc-add-btn:disabled,
.mc-refresh-all-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.mc-table-wrap {
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.mc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 700px;
}

.mc-table thead th {
  background: rgba(100, 180, 220, 0.08);
  color: #8b98a8;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(100, 180, 220, 0.15);
  white-space: nowrap;
}

.mc-table tbody td {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #d0d8e0;
  white-space: nowrap;
  font-size: 12px;
}

.mc-table tbody tr:last-child td {
  border-bottom: none;
}

.mc-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.mc-row-self {
  background: rgba(255, 140, 50, 0.05);
}

.mc-row-self:hover {
  background: rgba(255, 140, 50, 0.08) !important;
}

.mc-cell-handle {
  font-weight: 600;
}

.mc-handle-link {
  color: #6cb3dc;
  text-decoration: none;
}

.mc-handle-link:hover {
  text-decoration: underline;
}

.mc-row-self .mc-handle-link {
  color: #ff8c4a;
}

.mc-self-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255, 140, 50, 0.2);
  color: #ff8c4a;
  border: 1px solid rgba(255, 140, 50, 0.4);
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mc-fm-shorts {
  color: #ff6b6b;
  font-weight: 600;
}

.mc-fm-long {
  color: #6cb3dc;
  font-weight: 600;
}

.mc-outlier-mid {
  color: #3fb950;
  font-weight: 700;
}

.mc-outlier-high {
  color: #ffd43b;
  font-weight: 700;
  text-shadow: 0 0 4px rgba(255, 212, 59, 0.4);
}

.mc-actions {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.mc-action-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
  color: #a0a8b0;
  transition: all 0.15s ease;
}

.mc-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e8f0;
}

.mc-action-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.mc-action-algrow {
  border-color: rgba(76, 175, 80, 0.4);
  color: #81c784;
}
.mc-action-algrow:hover:not(:disabled) {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.7);
  color: #c8e6c9;
}

.mc-action-deepdive {
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.mc-action-deepdive:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.7);
  color: #bae6fd;
}

.mc-remove-btn:hover:not(:disabled) {
  border-color: rgba(229, 83, 75, 0.5);
  color: #e5534b;
}

.mc-action-disabled {
  display: inline-block;
  padding: 2px 6px;
  color: #555;
  font-size: 12px;
}

.mc-empty {
  text-align: center;
  color: #7a8290;
  font-style: italic;
  padding: 14px;
}

@media (max-width: 640px) {
  .mc-table {
    font-size: 11px;
  }
  .mc-table thead th,
  .mc-table tbody td {
    padding: 6px 8px;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   Tier 1 info-bokse (#75 og #76)
   ────────────────────────────────────────────────────────────────────────── */
.tier1-box,
.mcp-niche-median,
.mcp-format-mix {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
}

.tier1-box-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b98a8;
  margin-bottom: 6px;
  font-weight: 600;
}

.tier1-box-value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 4px;
}

.tier1-box-help {
  font-size: 11px;
  color: #a0a8b0;
  line-height: 1.5;
  margin-top: 6px;
}

/* Farvning til niche-median ratio */
.tier1-strong { color: #ffd43b; }
.tier1-above  { color: #3fb950; }
.tier1-below  { color: #f0883e; }
.tier1-weak   { color: #e5534b; }
.tier1-unknown { color: #777; font-style: italic; }

/* Farvning til format-mix afvigelse */
.fm-aligned   { color: #3fb950; }
.fm-moderate  { color: #e3a008; }
.fm-divergent { color: #e5534b; }
.fm-unknown   { color: #777; font-style: italic; }

/* ──────────────────────────────────────────────────────────────────────────
   Patch 14 (Opgave 7) — Algrow Content-Gap enrichment sektioner
   ────────────────────────────────────────────────────────────────────────── */
.mcp-algrow-outliers,
.mcp-algrow-trending,
.mcp-algrow-terminated,
.mcp-algrow-explosions {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(76, 175, 80, 0.28);
  background: rgba(76, 175, 80, 0.04);
  border-radius: 8px;
  grid-column: 1 / -1;
}

/* Algrow-sektioner skal placeres UNDER hele 3-rækkers KPI-spalten (top-videos +
   højre kolonne). Tving dem til række 4 og opefter via auto-row så de stacker. */
.mcp-body > .mcp-algrow-outliers,
.mcp-body > .mcp-algrow-trending,
.mcp-body > .mcp-algrow-terminated,
.mcp-body > .mcp-algrow-explosions,
.mcp-body > .mcp-outliers,
.mcp-body > .mcp-content-gap,
.mcp-body > .mcp-inspiration-videos,
.mcp-body > .mcp-multi-channel {
  grid-column: 1 / -1;
  grid-row: auto;
}

/* Eksploderende kanaler har sin egen orange tone */
.mcp-algrow-explosions {
  border-color: rgba(255, 152, 0, 0.22);
  background: rgba(255, 152, 0, 0.04);
}

.mcp-algrow-terminated {
  border-color: rgba(255, 138, 101, 0.22);
  background: rgba(255, 138, 101, 0.04);
}

.mcp-algrow-card {
  /* Tilføjer subtle grøn outline til Algrow-kort i Content-Gap så de skiller sig
     ud fra de DB-baserede inspirations-kort */
  border-left: 2px solid rgba(76, 175, 80, 0.5);
}

.alg-fmt-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  margin-left: 4px;
}
.alg-fmt-shorts { background: rgba(200, 0, 0, .85); color: #fff; }
.alg-fmt-long   { background: rgba(0, 0, 0, .75);  color: #fff; }

/* Voksende kanaler (trending) */
.alg-trend-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 700px) {
  .alg-trend-list { grid-template-columns: 1fr; }
}

.alg-trend-row {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, background .12s;
  align-items: center;
}
.alg-trend-row:hover {
  border-color: rgba(76, 175, 80, 0.4);
  background: rgba(76, 175, 80, 0.06);
}
.alg-trend-row img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.alg-trend-row .alg-ph {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #111;
  flex-shrink: 0;
}
.alg-trend-meta { flex: 1; min-width: 0; }
.alg-trend-name {
  font-size: 13px;
  font-weight: 600;
  color: #ddd;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alg-trend-stats {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: #888;
  font-family: 'JetBrains Mono', monospace;
  flex-wrap: wrap;
}
.alg-delta { color: #888; }
.alg-delta.pos { color: #00c853; }

/* Terminerede kanaler */
.alg-term-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 700px) {
  .alg-term-list { grid-template-columns: 1fr; }
}

.alg-term-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 138, 101, 0.18);
  border-radius: 6px;
}

.alg-term-row {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: background .12s;
}
.alg-term-row:hover {
  background: rgba(255, 138, 101, 0.08);
}

/* Video-strip — viser sidste 3 videoer, så man kan se mønsteret */
.alg-term-videos {
  border-top: 1px dashed rgba(255, 138, 101, 0.18);
  padding-top: 8px;
}
.alg-term-videos-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 138, 101, 0.7);
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.alg-term-videos-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.alg-term-video {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 138, 101, 0.15);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color .12s, transform .12s;
  cursor: pointer;
}
.alg-term-video:hover {
  border-color: rgba(255, 138, 101, 0.5);
  transform: translateY(-1px);
}
.alg-term-video img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.alg-term-vph {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 138, 101, 0.5);
  font-size: 18px;
}
.alg-term-video-title {
  font-size: 11px;
  line-height: 1.3;
  padding: 4px 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #ddd;
}
.alg-term-video-views {
  font-size: 10px;
  padding: 0 6px 6px;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'JetBrains Mono', monospace;
}
.alg-term-row img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  filter: grayscale(0.4);
}
.alg-term-row .alg-ph-term {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.alg-term-meta { flex: 1; min-width: 0; }
.alg-term-name {
  font-size: 13px;
  font-weight: 600;
  color: #e0e8f0;
  margin-bottom: 4px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.alg-term-stats {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: #888;
  font-family: 'JetBrains Mono', monospace;
  flex-wrap: wrap;
}
.alg-term-date { color: #ff8a65; }
.alg-warn-badge {
  font-size: 9px;
  background: rgba(255, 138, 101, 0.15);
  border: 1px solid rgba(255, 138, 101, 0.3);
  color: #ffab91;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

/* Patch 14b — skeleton loaders mens Algrow-data hentes async */
@keyframes alg-skel-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}
.alg-skel-card {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.04) 0%, rgba(76, 175, 80, 0.12) 50%, rgba(76, 175, 80, 0.04) 100%);
  border: 1px solid rgba(76, 175, 80, 0.12);
  border-radius: 8px;
  height: 130px;
  animation: alg-skel-pulse 1.4s ease-in-out infinite;
}
.alg-skel-row {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.04) 0%, rgba(76, 175, 80, 0.12) 50%, rgba(76, 175, 80, 0.04) 100%);
  border: 1px solid rgba(76, 175, 80, 0.12);
  border-radius: 6px;
  height: 60px;
  animation: alg-skel-pulse 1.4s ease-in-out infinite;
}
.mcp-algrow-terminated .alg-skel-row {
  background: linear-gradient(90deg, rgba(255, 138, 101, 0.04) 0%, rgba(255, 138, 101, 0.12) 50%, rgba(255, 138, 101, 0.04) 100%);
  border-color: rgba(255, 138, 101, 0.12);
}

/* ──────────────────────────────────────────────────────────────────────────
   Opgave 5 — Channel Explosion Monitor
   Orange/gul farveprofil for at adskille fra grøn (trending) og rød (terminated).
   ────────────────────────────────────────────────────────────────────────── */
.alg-explosion-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.alg-explosion-row {
  display: flex;
  gap: 8px;
  padding: 7px 8px 7px 8px;
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.06) 0%, rgba(0, 0, 0, .25) 35%);
  border: 1px solid rgba(255, 152, 0, 0.2);
  border-radius: 8px;
  align-items: stretch;
  transition: border-color .12s, background .12s;
  min-width: 0;
  position: relative;
}
.alg-explosion-row:hover {
  border-color: rgba(255, 152, 0, 0.5);
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.1) 0%, rgba(0, 0, 0, .25) 35%);
}

.alg-explosion-link {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  align-items: center;
}

.alg-explosion-row img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 152, 0, 0.3);
}
.alg-explosion-row .alg-ph-explosion {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 152, 0, 0.12);
  border: 2px solid rgba(255, 152, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.alg-explosion-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alg-explosion-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffe5b3;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alg-spike-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.alg-spike-views {
  background: rgba(255, 152, 0, 0.18);
  border: 1px solid rgba(255, 152, 0, 0.45);
  color: #ffb74d;
}
.alg-spike-subs {
  background: rgba(255, 87, 34, 0.18);
  border: 1px solid rgba(255, 87, 34, 0.45);
  color: #ff8a65;
}
.alg-spike-both {
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.25), rgba(255, 87, 34, 0.25));
  border: 1px solid rgba(255, 87, 34, 0.55);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.25);
}

.alg-explosion-stats {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: #aaa;
  font-family: 'JetBrains Mono', monospace;
  flex-wrap: wrap;
}
.alg-explosion-trigger { color: #ffb74d; font-weight: 600; }
.alg-explosion-when { color: #888; margin-left: auto; }

.alg-explosion-baseline {
  font-size: 9px;
  color: #777;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alg-explosion-dismiss {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #888;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .12s;
  padding: 0;
  line-height: 1;
  z-index: 2;
}
.alg-explosion-dismiss:hover {
  background: rgba(255, 87, 34, 0.15);
  border-color: rgba(255, 87, 34, 0.5);
  color: #ff8a65;
}

/* ──────────────────────────────────────────────────────────────────────────
   Pagination for eksploderende kanaler (max 10 per side, 2x5 grid)
   ────────────────────────────────────────────────────────────────────────── */
.alg-explosion-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.alg-explosion-pagination .alg-page-info {
  color: #888;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  margin-right: 8px;
}

.alg-explosion-pagination button {
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.25);
  color: #ffb74d;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s;
}
.alg-explosion-pagination button:hover:not(:disabled):not(.alg-page-active) {
  background: rgba(255, 152, 0, 0.2);
  border-color: rgba(255, 152, 0, 0.55);
  color: #fff;
}
.alg-explosion-pagination button.alg-page-active {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.4), rgba(255, 87, 34, 0.4));
  border-color: rgba(255, 152, 0, 0.7);
  color: #fff;
  cursor: default;
  box-shadow: 0 0 6px rgba(255, 152, 0, 0.3);
}
.alg-explosion-pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.alg-explosion-pagination .alg-page-ellipsis {
  color: #666;
  padding: 0 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

/* På smalle skærme: falder grid tilbage til 1 kolonne */
@media (max-width: 900px) {
  .alg-explosion-list {
    grid-template-columns: 1fr;
  }
}

/* Skeleton-variant for explosion-sektion (orange tone) */
.mcp-algrow-explosions .alg-skel-row {
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.04) 0%, rgba(255, 152, 0, 0.14) 50%, rgba(255, 152, 0, 0.04) 100%);
  border-color: rgba(255, 152, 0, 0.15);
}

/* Scan-knap + cooldown-nedtælling i sektion-header */
.alg-explosion-scan-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.alg-explosion-scan-btn {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.18), rgba(255, 87, 34, 0.18));
  border: 1px solid rgba(255, 152, 0, 0.45);
  color: #ffb74d;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
  transition: all .15s;
  white-space: nowrap;
}
.alg-explosion-scan-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.32), rgba(255, 87, 34, 0.32));
  border-color: rgba(255, 152, 0, 0.7);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.35);
}
.alg-explosion-scan-btn:disabled,
.alg-explosion-scan-btn.alg-cooldown-active {
  background: rgba(80, 80, 80, 0.2);
  border-color: rgba(255, 255, 255, 0.12);
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
}
.alg-explosion-scan-btn.alg-scanning {
  background: rgba(255, 152, 0, 0.12);
  border-color: rgba(255, 152, 0, 0.3);
  color: #ffb74d;
  cursor: wait;
  animation: alg-explosion-pulse 1.2s ease-in-out infinite;
}

.alg-explosion-cooldown-timer {
  font-size: 10px;
  color: #888;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* Sektion-header skal kunne flexe scan-knap til højre */
.mcp-algrow-explosions .mcp-section-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ──────────────────────────────────────────────────────────────────────────
   'Both'-trigger: mest interessant alert — fortjener fremhævelse
   ────────────────────────────────────────────────────────────────────────── */
.alg-explosion-row.alg-explosion-both {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.18) 0%, rgba(255, 87, 34, 0.18) 50%, rgba(0, 0, 0, .25) 100%);
  border: 1px solid rgba(255, 87, 34, 0.55);
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.25), inset 0 1px 0 rgba(255, 152, 0, 0.15);
  animation: alg-both-glow 3s ease-in-out infinite;
}
.alg-explosion-row.alg-explosion-both:hover {
  border-color: rgba(255, 87, 34, 0.85);
  box-shadow: 0 0 18px rgba(255, 152, 0, 0.5), inset 0 1px 0 rgba(255, 152, 0, 0.2);
}
.alg-explosion-row.alg-explosion-both .alg-explosion-name {
  color: #fff;
  text-shadow: 0 0 4px rgba(255, 152, 0, 0.6);
}
.alg-explosion-row.alg-explosion-both img,
.alg-explosion-row.alg-explosion-both .alg-ph-explosion {
  border-color: rgba(255, 87, 34, 0.7);
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
}

@keyframes alg-both-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 152, 0, 0.25), inset 0 1px 0 rgba(255, 152, 0, 0.15); }
  50%      { box-shadow: 0 0 20px rgba(255, 87, 34, 0.45), inset 0 1px 0 rgba(255, 152, 0, 0.25); }
}

.alg-both-fire {
  display: inline-block;
  font-size: 14px;
  margin-left: 4px;
  animation: alg-both-fire-flicker 1.2s ease-in-out infinite;
}

@keyframes alg-both-fire-flicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.75; transform: scale(1.15); }
}

/* ──────────────────────────────────────────────────────────────────────────
   SVG sparkline — baseline vs current (views + subs)
   ────────────────────────────────────────────────────────────────────────── */
.alg-spike-sparkline {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.alg-spike-sparkline .alg-spark-base {
  fill: rgba(180, 180, 180, 0.45);  /* grå = baseline */
}
.alg-spike-sparkline .alg-spark-current {
  fill: #ffb74d;  /* orange = current */
}
.alg-explosion-row.alg-explosion-both .alg-spike-sparkline .alg-spark-current {
  fill: #ff7043;  /* mere intens for both-trigger */
}

/* ──────────────────────────────────────────────────────────────────────────
   Studér-knap + Studér-panel
   ────────────────────────────────────────────────────────────────────────── */
.alg-explosion-actions {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-self: center;
  flex-shrink: 0;
}

.alg-explosion-study {
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.4);
  color: #ffb74d;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  transition: all .12s;
}
.alg-explosion-study:hover {
  background: rgba(255, 152, 0, 0.25);
  border-color: rgba(255, 152, 0, 0.7);
  color: #fff;
  box-shadow: 0 0 6px rgba(255, 152, 0, 0.35);
}

.alg-explosion-study-panel {
  margin: -4px 0 8px 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 8px;
  animation: alg-study-slide-in 0.25s ease-out;
}
.alg-explosion-study-panel:empty { display: none !important; }

@keyframes alg-study-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .alg-explosion-scan-wrap { margin-left: 0; }
  .alg-explosion-cooldown-timer { font-size: 9px; }
  .alg-explosion-actions { flex-direction: row; }
  .alg-spike-sparkline { display: none; }  /* spar plads på mobil */
}

/* ──────────────────────────────────────────────────────────────────────────
   Trending-fanen: Algrow-zone (genbruger samme sektioner som Min kanal)
   ────────────────────────────────────────────────────────────────────────── */
.trending-algrow-zone {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.04) 0%, rgba(0, 0, 0, 0.2) 100%);
  border: 1px solid rgba(76, 175, 80, 0.18);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trending-algrow-zone-header {
  font-size: 13px;
  font-weight: 700;
  color: #81c784;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(76, 175, 80, 0.2);
}

/* Inde i Trending-zonen får sektionerne lidt mindre top-margin */
.trending-algrow-zone .mcp-algrow-outliers,
.trending-algrow-zone .mcp-algrow-trending,
.trending-algrow-zone .mcp-algrow-terminated,
.trending-algrow-zone .mcp-algrow-explosions {
  margin-top: 0;
}

/* Deepdive-knap på Algrow trending-row + explosion-row */
.alg-trend-row-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.alg-trend-row-wrap .alg-trend-row { flex: 1; min-width: 0; }
.alg-row-deepdive,
.alg-explosion-deepdive {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  transition: all .12s;
  flex-shrink: 0;
  align-self: center;
}
.alg-row-deepdive:hover,
.alg-explosion-deepdive:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.7);
  color: #fff;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}
.alg-row-deepdive { font-size: 14px; padding: 6px 8px; }

/* Notifikations-badge på Min kanal-fanen (i hovednavigationen) */
.mcs-explosion-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  background: linear-gradient(135deg, #ff9800, #f44336);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 0 6px rgba(255, 152, 0, 0.4);
  animation: alg-explosion-pulse 2s ease-in-out infinite;
}
.mcs-explosion-tab-badge[data-count="0"],
.mcs-explosion-tab-badge:empty { display: none; }

@keyframes alg-explosion-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 152, 0, 0.4); }
  50%      { box-shadow: 0 0 12px rgba(255, 152, 0, 0.7); }
}

/* Responsive justering */
@media (max-width: 700px) {
  .alg-explosion-stats { gap: 6px; font-size: 10px; }
  .alg-explosion-when { margin-left: 0; }
  .alg-explosion-name { font-size: 13px; }
  .alg-explosion-row img,
  .alg-explosion-row .alg-ph-explosion { width: 44px; height: 44px; }
}

/* ──────────────────────────────────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #myChannelPanel { padding: 12px 14px; }
  .mcp-handle { font-size: 16px; }
  .mcp-meta { font-size: 12px; gap: 8px; }
  .tier1-box-value { font-size: 14px; }
}
