/* Global Styles & Tailwind Overrides */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

body { background-color: #000000; color: #e5e5e5; user-select: none; }

/* Beam Panel - uses CSS variables for theme-aware accent */
.beam-panel {
  position: relative;
  background-color: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  transition: all 0.3s ease;
}

.beam-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent-primary, #f97316), transparent);
  box-shadow: 0 0 15px 2px color-mix(in srgb, var(--color-accent-primary, #f97316) 40%, transparent);
  opacity: 0.6;
  pointer-events: none;
  z-index: 10;
  transition: all 0.3s ease;
}

.beam-panel:hover {
  border-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 30%, transparent);
  transform: translateY(-2px);
}

.beam-panel:hover::before {
  opacity: 1;
  box-shadow: 0 0 25px 4px color-mix(in srgb, var(--color-accent-primary, #f97316) 70%, transparent);
}

.no-scrollbar::-webkit-scrollbar { display: none; }

/* Active Nav State in Left Rail */
.active-nav img {
  opacity: 1 !important;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--color-accent-primary, #f97316) 60%, transparent));
}

.active-nav div {
  height: 32px !important;
}

/* Secondary Tabs */
.sub-tab {
  position: relative;
  color: #a1a1aa;
  transition: all 0.2s;
  cursor: pointer;
}

.sub-tab:hover { color: white; }
.sub-tab.active { color: white; }

.sub-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent-primary, #f97316);
  box-shadow: 0 -2px 10px color-mix(in srgb, var(--color-accent-primary, #f97316) 50%, transparent);
}

/* Tree Diagram */
#tree-canvas {
  transform-origin: top center;
  cursor: grab;
  transition: transform 0.1s linear;
}

#tree-canvas:active { cursor: grabbing; }

.tf-tree ul {
  padding-top: 20px;
  position: relative;
  display: flex;
  justify-content: center;
}

.tf-tree li {
  float: left;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 20px 5px 0 5px;
}

.tf-tree li::before,
.tf-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 1px dashed color-mix(in srgb, var(--color-accent-primary, #f97316) 40%, transparent);
  width: 50%;
  height: 20px;
}

.tf-tree li::after {
  right: auto;
  left: 50%;
  border-left: 1px dashed color-mix(in srgb, var(--color-accent-primary, #f97316) 40%, transparent);
}

.tf-tree li:only-child::after,
.tf-tree li:only-child::before { display: none; }
.tf-tree li:only-child { padding-top: 0; }
.tf-tree li:first-child::before,
.tf-tree li:last-child::after { border: 0 none; }

.tf-tree li:last-child::before {
  border-right: 1px dashed color-mix(in srgb, var(--color-accent-primary, #f97316) 40%, transparent);
  border-radius: 0 5px 0 0;
}

.tf-tree li:first-child::after { border-radius: 5px 0 0 0; }

.tf-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 1px dashed color-mix(in srgb, var(--color-accent-primary, #f97316) 40%, transparent);
  width: 0;
  height: 20px;
}

/* Ticker Animations */
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes scroll-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.animate-scroll-left { animation: scroll-left 40s linear infinite; }
.animate-scroll-right { animation: scroll-right 45s linear infinite; }

/* Pause animation on hover */
.ticker-mask:hover .ticker-track { animation-play-state: paused; }

/* --- COMMAND PALETTE STYLES --- */
.beam-glow {
  box-shadow: 0 0 40px -10px color-mix(in srgb, var(--color-accent-primary, #f97316) 30%, transparent);
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow { animation: spin-slow 8s linear infinite; }

/* List Items */
.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #a1a1aa;
  transition: all 0.1s;
  border-left: 2px solid transparent;
}

.cmd-item:hover,
.cmd-item.selected {
  background-color: rgba(255,255,255,0.05);
  color: white;
}

.cmd-item.selected {
  border-left-color: var(--color-accent-primary, #f97316);
  background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 10%, transparent);
}

/* ============================= */
/* TICKER PILL STYLES (EVENTS)   */
/* ============================= */

.ticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  transition: all 0.25s ease;
}

.ticker-pill.clickable { cursor: pointer; }

.ticker-pill.clickable:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
}

/* ---- EVENT TYPES ---- */
.news_digest,
.news_ingest {
  color: #fb923c;
  background: rgba(251,146,60,0.12);
  border-color: rgba(251,146,60,0.35);
}

.member_status {
  color: #38bdf8;
  background: rgba(56,189,248,0.12);
  border-color: rgba(56,189,248,0.35);
}

.user_post {
  color: #60a5fa;
  background: rgba(96,165,250,0.12);
  border-color: rgba(96,165,250,0.35);
}

.infra_scale {
  color: #c084fc;
  background: rgba(192,132,252,0.12);
  border-color: rgba(192,132,252,0.35);
}

.graph_replication {
  color: #34d399;
  background: rgba(52,211,153,0.12);
  border-color: rgba(52,211,153,0.35);
}

.traffic_spike {
  color: #f87171;
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.35);
}

/* Pause ticker animations on hover */
.ticker-mask:hover #ticker-track-top,
.ticker-mask:hover #ticker-track-bot { animation-play-state: paused; }

/* Subtle hover affordance for ticker */
.ticker-mask:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent-primary, #f97316) 15%, transparent);
}

/* Highlight pulse for org chart nodes */
@keyframes highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--color-accent-primary, #f97316) 40%, transparent), 0 0 30px color-mix(in srgb, var(--color-accent-primary, #f97316) 60%, transparent); }
}

.highlight-pulse { animation: highlight-pulse 2s ease-in-out 3; }

/* LED micro-glow for interactive file rows */
.tt-led { position: relative; }

.tt-led::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-accent-primary, #f97316) 30%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tt-led:hover::before { opacity: 1; }

/* Calendar Styling for tribeVote */
.cal-day {
  padding: 0.75rem 0;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #a1a1aa;
  transition: all 0.2s ease;
}

.cal-day:hover {
  background-color: #1a1a1d;
  color: #ffffff;
}

.cal-day.cal-active {
  background-color: var(--color-accent-primary, #f97316);
  color: white;
  box-shadow: 0 0 15px color-mix(in srgb, var(--color-accent-primary, #f97316) 30%, transparent);
  font-weight: 700;
}

.cal-day.cal-range {
  background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 15%, transparent);
  color: var(--color-accent-primary, #f97316);
}

/* Fix org chart avatar overflow */
#tree-canvas { overflow: visible !important; }
.tf-tree { overflow: visible !important; }
.tf-tree ul { overflow: visible !important; padding-top: 50px !important; }
.tf-tree li { overflow: visible !important; }
.org-card { overflow: visible !important; }
#tree-container { overflow: visible !important; }

/* ============================= */
/* THEME-AWARE ACCENT UTILITIES  */
/* ============================= */

/* Primary accent button */
.accent-btn-primary {
  background-color: var(--color-accent-muted, rgba(249, 115, 22, 0.2));
  color: var(--color-accent-secondary, #f59e0b);
}
.accent-btn-primary:hover {
  background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 30%, transparent);
}

/* Focus state for inputs/selects */
.accent-focus:focus {
  border-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 50%, transparent) !important;
}

/* Command icon hover */
.cmd-item:hover .cmd-icon,
.cmd-item.selected .cmd-icon {
  color: var(--color-accent-primary, #f97316);
}

/* Member card hover */
.member-card:hover {
  border-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 30%, transparent) !important;
}

/* ============================= */
/* THEME-AWARE HEATMAP STYLES    */
/* ============================= */

/* Control Heatmap (Member Activity) */
.control-heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.control-heatmap-cell:hover {
  transform: scale(1.3);
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-accent-primary, #f97316) 60%, transparent);
}

/* Heatmap levels using theme accent color with varying intensity */
.control-heatmap-level-0 { background-color: rgba(255, 255, 255, 0.03); }
.control-heatmap-level-1 { background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 20%, transparent); }
.control-heatmap-level-2 { background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 40%, transparent); }
.control-heatmap-level-3 { background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 65%, transparent); }
.control-heatmap-level-4 { background-color: var(--color-accent-primary, #f97316); }
.control-heatmap-level-5 { background-color: color-mix(in oklch, var(--color-accent-primary, #f97316) 80%, white); }
.control-heatmap-level-6 { background-color: color-mix(in oklch, var(--color-accent-primary, #f97316) 60%, white); }

.control-week-column {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.control-heatmap-tooltip {
  position: fixed;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 11px;
  color: #e5e5e5;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.control-heatmap-tooltip.visible {
  opacity: 1;
}

/* News Heatmap (Publishing Activity) */
.news-heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.news-heatmap-cell:hover {
  transform: scale(1.3);
  box-shadow: 0 0 8px color-mix(in srgb, var(--color-accent-primary, #f97316) 60%, transparent);
}

.news-heatmap-level-0 { background-color: rgba(255, 255, 255, 0.03); }
.news-heatmap-level-1 { background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 15%, transparent); }
.news-heatmap-level-2 { background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 30%, transparent); }
.news-heatmap-level-3 { background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 50%, transparent); }
.news-heatmap-level-4 { background-color: color-mix(in srgb, var(--color-accent-primary, #f97316) 75%, transparent); }
.news-heatmap-level-5 { background-color: var(--color-accent-primary, #f97316); }
.news-heatmap-level-6 { background-color: color-mix(in oklch, var(--color-accent-primary, #f97316) 80%, white); }

.news-week-column {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.news-heatmap-tooltip {
  position: fixed;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 11px;
  color: #e5e5e5;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.news-heatmap-tooltip.visible {
  opacity: 1;
}
