/* ═══════════════════════════════════════════════════════════════
   AXION TERMINAL — News 24/7 Multi-Stream Kanban Grid
   Institutional Dark Mode · Zero Memory Leak · 60fps
   ═══════════════════════════════════════════════════════════════ */

/* ── MASTER CONTAINER ────────────────────────────────────── */
.kanban-master {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 155px);
  background: #0D0D0D;
  overflow: hidden;
  position: relative;
}

/* ── STATUS BAR ──────────────────────────────────────────── */
.kanban-status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #111111 0%, #0D0D0D 100%);
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
  min-height: 36px;
}

.kanban-status-title {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #D3FB03;
}

.kanban-ws-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  color: #666;
  letter-spacing: 1px;
}

.kanban-ws-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333;
  transition: background 0.3s ease;
}

.kanban-ws-dot.connected {
  background: #00FF88;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
  animation: wsPulse 2s ease-in-out infinite;
}

.kanban-ws-dot.connecting {
  background: #F59E0B;
  animation: wsPulse 1s ease-in-out infinite;
}

@keyframes wsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.kanban-total-count {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  color: #555;
  border: 1px solid #222;
  padding: 2px 8px;
  letter-spacing: 0.5px;
}

.kanban-clock {
  margin-left: auto;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  color: #444;
  letter-spacing: 1px;
}

/* ── COLUMNS CONTAINER (Horizontal Flex) ─────────────────── */
.kanban-columns {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 10px;
  padding: 10px 14px 14px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Ultra-thin stealth scrollbar */
.kanban-columns::-webkit-scrollbar {
  height: 4px;
}

.kanban-columns::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-columns::-webkit-scrollbar-thumb {
  background: rgba(211, 251, 3, 0.15);
  border-radius: 2px;
}

.kanban-columns::-webkit-scrollbar-thumb:hover {
  background: rgba(211, 251, 3, 0.3);
}

/* ── SINGLE COLUMN ──────────────────────────────────────── */
.kanban-col {
  flex: 0 0 auto;
  min-width: 330px;
  max-width: 380px;
  width: 350px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0f0f0f;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  scroll-snap-align: start;
  transition: border-color 0.2s ease;
  will-change: transform;
}

.kanban-col:hover {
  border-color: #252525;
}

/* ── COLUMN HEADER ──────────────────────────────────────── */
.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #141414 0%, #111111 100%);
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

.kanban-col-drag {
  cursor: grab;
  color: #333;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.kanban-col-drag:hover {
  color: #D3FB03;
}

.kanban-col-drag:active {
  cursor: grabbing;
}

.kanban-col-icon {
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
}

.kanban-col-label {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  flex: 1;
}

.kanban-col-count {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  color: #444;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #1e1e1e;
  padding: 1px 6px;
  border-radius: 1px;
  flex-shrink: 0;
}

.kanban-col-live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00FF88;
  box-shadow: 0 0 4px rgba(0, 255, 136, 0.4);
  animation: wsPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── CARD CONTAINER (Scrollable) ────────────────────────── */
.kanban-cards {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Stealth vertical scrollbar */
.kanban-cards::-webkit-scrollbar {
  width: 3px;
}

.kanban-cards::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-cards::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.kanban-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ── NEWS CARD (now an anchor element) ───────────────────── */
a.kanban-card {
  text-decoration: none;
  color: inherit;
  display: flex;
}
.kanban-card {
  min-height: min-content;
  height: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #0B0B0B;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.12s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
  will-change: box-shadow;
}

.kanban-card:hover {
  border-color: #2a2a2a;
  background: rgba(255, 193, 7, 0.03);
}

.kanban-card:focus {
  outline: 1px solid rgba(211, 251, 3, 0.3);
  outline-offset: -1px;
}

/* ── Card: Headline ──────────────────────────────────────── */
.kanban-card-title {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: #C6E310;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-wrap: balance;
}

/* ── Card: Snippet ───────────────────────────────────────── */
.kanban-card-snippet {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 11.5px;
  color: rgba(200, 200, 200, 0.72);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Card: Meta Row ──────────────────────────────────────── */
.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  color: #555;
  margin-bottom: 6px;
}

.kanban-card-source {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.kanban-card-time {
  color: #555;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.kanban-card-time-rel {
  color: #444;
  font-size: 8px;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.kanban-card-sentiment {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 1px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid;
}

.kanban-card-sentiment.bullish {
  color: #00FF88;
  border-color: rgba(0, 255, 136, 0.25);
}

.kanban-card-sentiment.bearish {
  color: #FF2A55;
  border-color: rgba(255, 42, 85, 0.25);
}

.kanban-card-sentiment.neutral {
  color: #555;
  border-color: #222;
}

/* ── Card: Tags Row ──────────────────────────────────────── */
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  overflow: hidden;
  max-height: 44px;
}

.kanban-tag {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 1px;
  border: 1px solid #222;
  color: #666;
  text-transform: uppercase;
  white-space: nowrap;
}

.kanban-tag.country {
  border-color: rgba(245, 158, 11, 0.3);
  color: #B89830;
}

.kanban-tag.asset {
  border-color: rgba(59, 130, 246, 0.3);
  color: #5B8FD4;
}

.kanban-tag.ticker {
  border-color: rgba(211, 251, 3, 0.3);
  color: #D3FB03;
}

/* ── FLASH ANIMATIONS (Sentiment Glow) ──────────────────── */
.flash-bullish {
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.35), inset 0 0 1px rgba(0, 255, 136, 0.15) !important;
  border-color: rgba(0, 255, 136, 0.3) !important;
  animation: flashBullishPulse 1.2s ease-out forwards;
}

.flash-bearish {
  box-shadow: 0 0 24px rgba(255, 42, 85, 0.35), inset 0 0 1px rgba(255, 42, 85, 0.15) !important;
  border-color: rgba(255, 42, 85, 0.3) !important;
  animation: flashBearishPulse 1.2s ease-out forwards;
}

@keyframes flashBullishPulse {
  0% {
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5), inset 0 0 2px rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.4);
  }
  100% {
    box-shadow: none;
    border-color: #1a1a1a;
  }
}

@keyframes flashBearishPulse {
  0% {
    box-shadow: 0 0 30px rgba(255, 42, 85, 0.5), inset 0 0 2px rgba(255, 42, 85, 0.2);
    border-color: rgba(255, 42, 85, 0.4);
  }
  100% {
    box-shadow: none;
    border-color: #1a1a1a;
  }
}

/* ── SLIDE-DOWN INJECTION ────────────────────────────────── */
.card-inject {
  animation: cardSlideDown 0.45s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  overflow: hidden;
}

@keyframes cardSlideDown {
  0% {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
  }
}

/* Remove animation class after it completes to avoid layout issues */
.card-inject-done {
  animation: none;
  max-height: none;
}

/* ── AI HOVER TOOLTIP (Glassmorphism) ────────────────────── */
.kanban-tooltip {
  position: fixed;
  z-index: 9999;
  width: 300px;
  max-width: 340px;
  background: rgba(13, 13, 13, 0.88);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 14px 16px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.05);
}

.kanban-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.kanban-tooltip-header {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #D3FB03;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-tooltip-header::before {
  content: '◈';
  font-size: 10px;
}

.kanban-tooltip-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kanban-tooltip-list li {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 11px;
  line-height: 1.5;
  color: #c0c0c0;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  padding-left: 12px;
}

.kanban-tooltip-list li:last-child {
  border-bottom: none;
}

.kanban-tooltip-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #D3FB03;
  font-weight: 700;
}

.kanban-tooltip-source {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8px;
  color: #444;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

/* ── SORTABLEJS STATES ──────────────────────────────────── */
.sortable-ghost {
  opacity: 0.25 !important;
  border: 1px dashed rgba(211, 251, 3, 0.3) !important;
}

.sortable-chosen {
  box-shadow: 0 0 40px rgba(211, 251, 3, 0.08);
  border-color: rgba(211, 251, 3, 0.2) !important;
}

.sortable-drag {
  opacity: 0.9 !important;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6) !important;
  transform: rotate(1deg);
}

/* ── EMPTY STATE ─────────────────────────────────────────── */
.kanban-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  flex: 1;
}

.kanban-empty-icon {
  font-size: 24px;
  opacity: 0.1;
  margin-bottom: 12px;
}

.kanban-empty-text {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  color: #333;
  letter-spacing: 0.5px;
}

.kanban-empty-sub {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8px;
  color: #222;
  margin-top: 6px;
  letter-spacing: 0.5px;
}

/* ── BREAKING BADGE ──────────────────────────────────────── */
.kanban-breaking-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: #FF2A55;
  color: #fff;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1px 6px;
  border-radius: 0 0 2px 0;
}

/* ── SHIMMER SKELETON LOADERS ────────────────────────────── */
.kanban-shimmer {
  background: #0B0B0B;
  border: 1px solid #1a1a1a;
  border-radius: 2px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.shimmer-title, .shimmer-body, .shimmer-meta {
  border-radius: 2px;
  background: linear-gradient(90deg, #151515 25%, #1e1e1e 50%, #151515 75%);
  background-size: 200% 100%;
  animation: shimmerPulse 1.4s ease-in-out infinite;
}
.shimmer-title { height: 14px; width: 85%; }
.shimmer-body { height: 10px; width: 100%; }
.shimmer-meta { height: 8px; width: 50%; }
@keyframes shimmerPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── AI SUMMARY PANE (Hover Preview) ────────────────────── */
.mc-ai-pane {
  position: fixed;
  width: 360px;
  max-height: 440px;
  background: rgba(11,11,11,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,193,7,0.25);
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  font-family: 'Inter', system-ui, sans-serif;
  z-index: 9999;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
  overflow-y: auto;
}
.mc-ai-pane.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mc-ai-pane__label { font: 700 9px/1 'JetBrains Mono', monospace; letter-spacing: .8px; color: #FFC107; margin-bottom: 8px; }
.mc-ai-pane__meta { font: 400 9px/1 'JetBrains Mono', monospace; color: #666; margin-bottom: 6px; }
.mc-ai-pane__title { font: 600 14px/1.35 'Inter', sans-serif; color: rgba(255,255,255,.96); margin: 8px 0 10px; }
.mc-ai-pane__brief { font: 400 12px/1.6 'Inter', sans-serif; color: rgba(255,255,255,.78); margin-bottom: 10px; }
.mc-ai-pane__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.mc-ai-pane__tags span { font: 600 8px/1 'JetBrains Mono', monospace; padding: 2px 6px; border-radius: 1px; border: 1px solid #333; color: #888; letter-spacing: .4px; }
.mc-ai-pane__tags .sent-bullish { color: #00FF88; border-color: rgba(0,255,136,.3); }
.mc-ai-pane__tags .sent-bearish { color: #FF2A55; border-color: rgba(255,42,85,.3); }
.mc-ai-pane__tags .impact-high { color: #FF2A55; border-color: rgba(255,42,85,.3); }
.mc-ai-pane__tags .impact-medium { color: #F59E0B; border-color: rgba(245,158,11,.3); }
.mc-ai-pane__tags .ticker-chip { color: #D3FB03; border-color: rgba(211,251,3,.3); }
.mc-ai-pane__link { font: 500 10px/1 'Inter', sans-serif; color: #FFC107; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.mc-ai-pane__link:hover { color: #FFD54F; }
.mc-ai-pane__divider { height: 1px; background: rgba(255,255,255,.06); margin: 8px 0; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .kanban-col {
    min-width: 280px;
    max-width: 320px;
    width: 300px;
  }

  .kanban-card-title {
    font-size: 11px;
  }
  .mc-ai-pane { display: none; }
}
