/* franchise.css - "Phosphor Executive" Design System */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --surface: #001800;
  --surface-container-low: #042103;
  --surface-container-highest: #1e3b18;
  --surface-bright: rgba(0, 255, 159, 0.1);
  --primary: #f4fff4;
  --primary-container: #00ff9f;
  --primary-fixed: #55ffa9;
  --on-surface: #c8edba;
  --secondary: #ffd082;
  --outline-variant: rgba(0, 255, 159, 0.15);
  
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-display);
}

body {
  background-color: var(--surface);
  color: var(--on-surface);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* The Scanline Overlay */
body::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(rgba(0,0,0,0) 0px, rgba(0,0,0,0.05) 1px, rgba(0,0,0,0) 2px);
  pointer-events: none;
  z-index: 9999;
}

/* CRT Text Glows */
.crt-glow {
  color: var(--primary-fixed);
  text-shadow: 0 0 8px var(--primary-container);
}

.crt-box-glow {
  box-shadow: 0px 0px 20px 0px rgba(0, 255, 159, 0.15);
}

/* Typography Scale */
h1.display-lg {
  font-family: var(--font-display);
  font-size: 3rem;
  letter-spacing: -0.02em;
  color: var(--primary-fixed);
  text-shadow: 0 0 8px var(--primary-container);
  font-weight: 600;
}

h2.headline-lg {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--secondary);
  text-transform: uppercase;
}

p.body-text {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--on-surface);
  line-height: 1.6;
}

/* Layout */
.dashboard-container {
  display: flex;
  height: 100vh;
  padding: 2rem;
  gap: 2rem;
  width: 100vw;
}

/* Left Filter Panel */
.filter-panel {
  width: 300px;
  background-color: var(--surface-container-low);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: calc(100vh - 4rem);
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-item {
  display: flex;
  flex-direction: column;
}

.filter-item label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.command-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--outline-variant);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.5rem 0;
  outline: none;
  transition: all 0.2s ease;
}

.command-input:focus {
  border-bottom-color: var(--secondary);
  color: var(--secondary);
}

/* Main Main Space */
.main-stage {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  position: relative;
}

/* Header Config */
.header-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.team-selector {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Data Viz Containers */
.viz-row {
  display: flex;
  gap: 2rem;
  min-height: 300px;
}

.viz-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.viz-container {
  background-color: var(--surface-container-low);
  padding: 1.5rem;
  flex-grow: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Tab Toggle Button */
.toggles {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.toggle-btn {
  background: transparent;
  border: 1px solid var(--outline-variant);
  color: var(--primary-fixed);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background-color: var(--primary-container);
  color: var(--surface);
  box-shadow: 0px 0px 15px 0px rgba(0, 255, 159, 0.4);
  border-color: transparent;
}

.toggle-btn:hover:not(.active) {
  border-color: var(--primary-container);
  box-shadow: 0px 0px 10px 0px rgba(0, 255, 159, 0.2);
}

/* Charts Base Styling */
.chart-area {
  flex-grow: 1;
  width: 100%;
  position: relative;
}

/* Tooltips */
.d3-tooltip {
  position: absolute;
  text-align: left;
  padding: 1rem;
  font: 12px var(--font-mono);
  background: rgba(4, 33, 3, 0.85); /* surface-container-low with opacity */
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(8px);
  z-index: 100;
  box-shadow: 0px 0px 15px 0px rgba(0, 255, 159, 0.15);
}

.d3-tooltip strong {
  color: var(--secondary);
  font-size: 14px;
  display: block;
  margin-bottom: 5px;
}

/* Scrollbar customization for the dark theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface); 
}
::-webkit-scrollbar-thumb {
  background: var(--surface-container-highest); 
}
::-webkit-scrollbar-thumb:hover {
  background: var(--outline-variant); 
}

/* View Sections */
.view-section {
  display: none;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.3s ease;
}

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

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

/* Additional specific visualization styles */
.axis path,
.axis line {
  stroke: var(--outline-variant);
}

.axis text {
  fill: var(--on-surface);
  font-family: var(--font-mono);
  font-size: 10px;
}

.grid-line {
  stroke: var(--outline-variant);
  stroke-opacity: 0.1;
  stroke-dasharray: 2,2;
}

circle {
  transition: r 0.2s ease, opacity 0.2s ease;
}
