@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- Reset & Theme Variables --- */
:root {
  /* Color Palette: Fire & Obsidian */
  --bg-color: #070303;
  --bg-gradient: radial-gradient(circle at 50% 0%, #2a0808 0%, #0f0303 50%, #070202 100%);
  
  --burnt-red: #9b2226;
  --burnt-red-rgb: 155, 34, 38;
  
  --orange: #f97316;
  --orange-rgb: 249, 115, 22;
  
  --amber: #f59e0b;
  --amber-rgb: 245, 158, 11;
  
  --white: #ffffff;
  
  /* Glassmorphic Surfaces */
  --surface: rgba(18, 10, 10, 0.7);
  --surface-hover: rgba(28, 14, 14, 0.85);
  --surface-active: rgba(38, 18, 18, 0.95);
  --surface-border: rgba(249, 115, 22, 0.12);
  --surface-border-glow: rgba(249, 115, 22, 0.35);
  
  /* System Feedback */
  --success: #10b981;
  --error: #ef233c;
  
  /* Typography */
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Styling Tokens */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --blur-val: 20px;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: #f8fafc;
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Custom Scrollbars (Orange Flame styled) */
scrollbar-width: thin;
scrollbar-color: rgba(249, 115, 22, 0.3) transparent;

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.6);
}

/* Typography Selection */
::selection {
  background: rgba(249, 115, 22, 0.35);
  color: #ffffff;
}

/* --- Layout Elements --- */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Decorative background light source simulating rising heat/sparks */
.app-container::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(circle, rgba(155, 34, 38, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

header {
  margin-bottom: 3.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--burnt-red), var(--orange));
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(249, 115, 22, 0.4);
  animation: logoGlow 3s infinite alternate;
}

.logo-icon-container svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
  animation: flameFlicker 1.5s infinite alternate ease-in-out;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #ffffff, #f3f4f6, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 0.85rem;
  color: #94a3b8;
  border-left: 1px solid rgba(255,255,255,0.1);
  padding-left: 0.75rem;
  margin-left: 0.75rem;
}

/* --- Glassmorphism UI Components --- */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(var(--blur-val));
  -webkit-backdrop-filter: blur(var(--blur-val));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.45);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}

.glass-panel:hover {
  border-color: rgba(249, 115, 22, 0.25);
  box-shadow: 0 10px 45px 0 rgba(249, 115, 22, 0.05), 0 5px 20px rgba(0,0,0,0.5);
}

/* Glow Borders */
.glow-card {
  position: relative;
  overflow: hidden;
}
.glow-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(to bottom right, rgba(249, 115, 22, 0.2), transparent, rgba(155, 34, 38, 0.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* --- Views Container --- */
.view-section {
  display: none;
  animation: fadeIn var(--transition-slow) forwards;
  z-index: 1;
  position: relative;
}

.view-section.active {
  display: block;
}

/* --- View 1: Search / Landing View --- */
.search-view-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.search-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw + 1rem, 4.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 40%, #fdba74 75%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

.search-hero p {
  color: #94a3b8;
  font-size: clamp(1rem, 1.15vw, 1.15rem);
  max-width: 660px;
  margin-bottom: 3.5rem;
  text-wrap: pretty;
}

.search-box-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin-bottom: 4.5rem;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(10, 5, 5, 0.9);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  box-shadow: 0 0 50px rgba(155, 34, 38, 0.2);
  transition: all var(--transition-normal);
}

.search-input-wrapper:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 60px rgba(249, 115, 22, 0.35), 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.search-icon {
  color: #94a3b8;
  margin-right: 1rem;
  flex-shrink: 0;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1.15rem;
  width: 100%;
  padding: 0.75rem 0;
}

.search-input::placeholder {
  color: #475569;
}

.search-btn {
  background: linear-gradient(135deg, var(--orange), var(--burnt-red));
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.85rem 2.25rem;
  border-radius: calc(var(--radius-lg) - 6px);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-btn svg {
  animation: flameFlicker 1.5s infinite alternate ease-in-out;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(249, 115, 22, 0.6);
  background: linear-gradient(135deg, #ff8c3b, #b92e32);
}

.search-btn:active {
  transform: translateY(0);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(12, 6, 6, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius-md);
  z-index: 100;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all var(--transition-fast);
  text-align: left;
}

.autocomplete-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(249, 115, 22, 0.08);
  transition: background var(--transition-fast);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover, .suggestion-item.active {
  background: rgba(249, 115, 22, 0.1);
}

.suggestion-title {
  font-weight: 600;
  color: #f8fafc;
}

.suggestion-meta {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  gap: 0.75rem;
}

.suggestion-badge {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

/* Quick Examples Grid */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 960px;
}

.example-card {
  padding: 1.75rem;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--surface-border);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
}

.example-card:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.4);
  background: var(--surface-hover);
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.1);
}

.example-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.example-desc {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.example-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #64748b;
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 0.75rem;
}

.arrow-icon {
  color: var(--orange);
  transition: transform var(--transition-fast);
}

.example-card:hover .arrow-icon {
  transform: translateX(4px);
}

/* --- View 2: Identity Resolution Modal --- */
.dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn var(--transition-fast) forwards;
}

.dialog-overlay.active {
  display: flex;
}

.dialog-container {
  width: 100%;
  max-width: 580px;
  background: #0d0606;
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 40px rgba(249, 115, 22, 0.1);
  animation: scaleIn var(--transition-normal) forwards;
  max-height: 90vh;
  overflow-y: auto;
}

.dialog-header {
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dialog-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dialog-header h3 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: #ffffff;
}

.dialog-header p {
  font-size: 0.95rem;
  color: #94a3b8;
}

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.candidate-item {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: all var(--transition-normal);
}

.candidate-item:hover {
  background: rgba(249, 115, 22, 0.05);
  border-color: var(--orange);
  transform: translateY(-2px);
}

.candidate-radio {
  margin-right: 1.25rem;
  accent-color: var(--orange);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.candidate-details {
  flex-grow: 1;
}

.candidate-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.candidate-sub {
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.candidate-status {
  font-size: 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: auto;
  font-weight: 600;
}

.candidate-status.missing {
  background: rgba(239, 35, 60, 0.1);
  color: var(--error);
}

.dialog-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--surface-border);
  color: #94a3b8;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--burnt-red));
  border: none;
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff8c3b, #b92e32);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

/* --- View 3: Background Data Collection --- */
.progress-view-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 580px;
  margin: 4rem auto;
  padding: 3rem;
  text-align: center;
  border-color: rgba(249, 115, 22, 0.25);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(155,34,38,0.15);
}

.progress-header {
  margin-bottom: 2.5rem;
}

.progress-header-icon {
  margin-bottom: 1rem;
  color: var(--orange);
  animation: pulseGlow 2s infinite ease-in-out;
}

.progress-header h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.85rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.progress-header p {
  font-size: 0.95rem;
  color: #94a3b8;
}

.progress-steps-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  margin-bottom: 2.5rem;
}

.progress-step-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(255, 255, 255, 0.01);
  transition: all var(--transition-normal);
}

.progress-step-item.pending {
  opacity: 0.35;
}

.progress-step-item.active {
  border-color: rgba(249, 115, 22, 0.3);
  background: rgba(249, 115, 22, 0.03);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.05);
}

.progress-step-item.success {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.02);
}

.progress-status-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1.25rem;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.progress-step-item.pending .progress-status-icon {
  border: 2px solid #334155;
  color: transparent;
}

.progress-step-item.active .progress-status-icon {
  border: 2px solid var(--orange);
  border-top-color: transparent;
  animation: spin 1s infinite linear;
}

.progress-step-item.success .progress-status-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: none;
}

.progress-step-details {
  flex-grow: 1;
}

.progress-step-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: #f1f5f9;
}

.progress-step-item.pending .progress-step-name {
  color: #64748b;
}

.progress-step-sub {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.progress-step-item.active .progress-step-sub {
  color: var(--orange);
}

.progress-bar-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--burnt-red), var(--orange), var(--amber));
  border-radius: 100px;
  transition: width var(--transition-normal);
}

/* --- View 4: Dashboard / Forecast Results --- */
.dashboard-view-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .dashboard-view-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Header & Metadata */
.game-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.75rem 2.25rem;
  position: relative;
  overflow: hidden;
}

.game-profile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, var(--orange), var(--burnt-red));
}

.game-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.game-profile-header svg.title-flame {
  color: var(--orange);
  animation: flameFlicker 1.5s infinite alternate ease-in-out;
  flex-shrink: 0;
}

.game-meta-main h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.2;
  color: #ffffff;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.game-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.game-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border-radius: 100px;
  font-weight: 500;
}

.forecast-badge-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.18);
  color: #fed7aa;
}

.confidence-badge.high {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
}

.confidence-badge.moderate {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.confidence-badge.low {
  background: rgba(239, 35, 60, 0.08);
  border-color: rgba(239, 35, 60, 0.2);
  color: #fecdd3;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.5s infinite;
}

.confidence-caption {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.35rem;
}

/* Forecast KPIs Grid */
.forecast-kpis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.25rem;
}

@media (max-width: 768px) {
  .forecast-kpis-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.kpi-value-container {
  margin-bottom: 1.25rem;
}

.kpi-val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.1rem;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-unit {
  font-size: 1.05rem;
  font-weight: 500;
  color: #64748b;
  margin-left: 0.25rem;
}

.kpi-range {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 0.85rem;
}

.range-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
}
.kpi-card.week::before { background: linear-gradient(to right, var(--orange), transparent); }
.kpi-card.month::before { background: linear-gradient(to right, var(--burnt-red), transparent); }
.kpi-card.year::before { background: linear-gradient(to right, var(--amber), transparent); }

/* Left Column Panels */
.dashboard-left-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Visualization Panel */
.panel-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chart-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-tab-btn {
  background: transparent;
  border: none;
  outline: none;
  color: #64748b;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chart-tab-btn:hover {
  color: #cbd5e1;
}

.chart-tab-btn.active {
  background: rgba(249, 115, 22, 0.15);
  color: var(--orange);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.panel-content {
  padding: 1.75rem;
}

/* SVG Chart styles */
.chart-container {
  width: 100%;
  height: 280px;
  position: relative;
}

.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.grid-line {
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 1;
}

.grid-line-main {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.chart-ci-area {
  fill: url(#chart-gradient-ci);
  opacity: 0.25;
}

.chart-trend-line {
  stroke: url(#chart-gradient-line);
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
}

.chart-upper-line, .chart-lower-line {
  stroke: rgba(249, 115, 22, 0.25);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  fill: none;
}

.chart-tooltip-marker {
  fill: var(--orange);
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 8px var(--orange));
  cursor: pointer;
}

.chart-axis-text {
  font-family: var(--font-body);
  font-size: 10px;
  fill: #64748b;
  font-weight: 500;
}

.chart-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1.25rem;
  font-size: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Signals Radar/Bar Panel */
.signal-bar-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.signal-row {
  display: grid;
  grid-template-columns: 155px 1fr 80px;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 580px) {
  .signal-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .signal-row:last-child { border-bottom: none; }
  .signal-row-val { text-align: left !important; }
}

.signal-row-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.signal-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
  font-size: 0.95rem;
  border: 1px solid rgba(255,255,255,0.02);
}

.signal-label-box {
  display: flex;
  flex-direction: column;
}

.signal-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
}

.signal-desc {
  font-size: 0.75rem;
  color: #64748b;
}

.signal-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.02);
}

.signal-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%; /* Animate via JS */
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.signal-row.search .signal-fill { background: linear-gradient(to right, var(--burnt-red), var(--orange)); }
.signal-row.conversation .signal-fill { background: linear-gradient(to right, var(--orange), var(--amber)); }
.signal-row.participation .signal-fill { background: linear-gradient(to right, var(--amber), #ffffff); }

.signal-row-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: #cbd5e1;
  text-align: right;
}

/* Right Column (Sidebar) */

/* Sandbox Panel */
.sandbox-card {
  border: 1px solid var(--surface-border-glow);
  box-shadow: 0 0 25px rgba(249, 115, 22, 0.05);
}

.sandbox-header {
  border-bottom: 1px solid rgba(249, 115, 22, 0.2) !important;
}

.sandbox-instructions {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.sandbox-sliders {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.slider-label {
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.slider-label svg {
  color: var(--orange);
}

.slider-value {
  color: var(--orange);
  font-weight: 700;
}

.input-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
  outline: none;
  border: 1px solid rgba(255,255,255,0.03);
}

.input-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.8);
  cursor: pointer;
  border: 2px solid var(--orange);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.input-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--orange);
}

.sandbox-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-accent {
  background: linear-gradient(135deg, var(--orange), var(--burnt-red));
  border: none;
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

/* Data Availability Panel */
.availability-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.avail-card {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.03);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.avail-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}

.avail-status {
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.avail-status.available { color: var(--success); }
.avail-status.limited { color: var(--amber); }
.avail-status.unavailable { color: #64748b; }

.avail-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Narrative Insight Panel */
.insight-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #cbd5e1;
  border-left: 2px solid var(--orange);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
  text-wrap: pretty;
}

.source-attribution {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* --- Action Controls --- */
.back-btn-container {
  margin-bottom: 1.5rem;
}

.btn-text-back {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--font-heading);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.btn-text-back:hover {
  color: #ffffff;
}

.btn-text-back svg {
  transition: transform var(--transition-fast);
}

.btn-text-back:hover svg {
  transform: translateX(-4px);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

@keyframes logoGlow {
  from { box-shadow: 0 0 15px rgba(249, 115, 22, 0.3); }
  to { box-shadow: 0 0 25px rgba(249, 115, 22, 0.6), 0 0 10px rgba(155, 34, 38, 0.4); }
}

@keyframes flameFlicker {
  0% { transform: scale(1) rotate(0deg); opacity: 0.9; filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.5)); }
  50% { transform: scale(1.05) rotate(-2deg); opacity: 1; filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.8)); }
  100% { transform: scale(0.98) rotate(1deg); opacity: 0.95; filter: drop-shadow(0 0 4px rgba(249, 115, 22, 0.6)); }
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; filter: drop-shadow(0 0 15px rgba(249, 115, 22, 0.5)); }
  100% { transform: scale(0.95); opacity: 0.8; }
}
