/* ==========================================================================
   PitchPilot AI - Core Design System & Stylesheet (FIFA World Cup 2026 Theme)
   ========================================================================== */

/* --- CSS Variables & Custom Palettes --- */
:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Color System - Slate / Navy Theme */
  --bg-primary: #070b13;
  --bg-secondary: #0d1222;
  --bg-tertiary: #141b31;
  --glass-bg: rgba(20, 27, 49, 0.55);
  --glass-bg-dark: rgba(9, 13, 26, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);

  /* Brand Accents - Neon & Vibrant Palettes */
  --color-primary: #3b82f6;       /* Indigo/Blue */
  --color-primary-glow: rgba(59, 130, 246, 0.35);
  --color-success: #10b981;       /* Neon Emerald Green */
  --color-success-glow: rgba(16, 185, 129, 0.35);
  --color-warning: #f59e0b;       /* Gold/Orange */
  --color-warning-glow: rgba(245, 158, 11, 0.35);
  --color-error: #ef4444;         /* Alert Red */
  --color-error-glow: rgba(239, 68, 68, 0.35);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;
  --text-gold: #fbcfe8; /* custom warm highlight */
  
  /* Layout Dimensions */
  --sidebar-width: 260px;
  --header-height: 80px;
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  
  --shadow-neon: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* --- Theme overrides for Staff Operations Mode --- */
body.staff-mode {
  --bg-primary: #0b0713;
  --bg-secondary: #120d22;
  --bg-tertiary: #191431;
  --glass-bg: rgba(25, 20, 49, 0.55);
  --color-primary: #ec4899;       /* Pink/Red command accent */
  --color-primary-glow: rgba(236, 72, 153, 0.35);
  --shadow-neon: 0 0 25px rgba(236, 72, 153, 0.2);
}

/* --- Base Resets & Global Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow-x: hidden;
  height: 100vh;
  transition: var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6, .font-title {
  font-family: var(--font-title);
  font-weight: 600;
  letter-spacing: -0.02em;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* --- App Container Grid --- */
.app-container {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  height: 100vh;
  width: 100vw;
}

/* --- Header Section --- */
.app-header {
  grid-row: 1;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 100;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.logo-icon {
  font-size: 1.8rem;
  color: var(--color-primary);
  text-shadow: 0 0 15px var(--color-primary-glow);
}

.logo-text h1 {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
}

.accent-text {
  color: var(--color-primary);
  text-shadow: 0 0 10px var(--color-primary-glow);
}

.sub-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Live Match Ticker Banner */
.live-ticker {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(20, 27, 49, 0.6) 100%);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 50px;
  padding: 0.35rem 1rem;
  gap: 0.75rem;
  max-width: 480px;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.ticker-badge {
  background-color: #ef4444;
  color: #fff;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  letter-spacing: 0.05em;
  animation: pulse-red 2s infinite;
}

.ticker-content {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ticker-content img {
  vertical-align: middle;
  border-radius: 2px;
}

.match-time {
  color: var(--color-success);
  font-weight: 700;
  margin-left: 0.5rem;
}

/* iOS-Style Mode Switcher Toggle */
.mode-toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.mode-toggle-container input:not(:checked) ~ .toggle-label:first-of-type,
.mode-toggle-container input:checked ~ .toggle-label:last-of-type {
  color: var(--text-main);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* --- Global Language Selector --- */
.global-lang-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  padding: 0.35rem 0.65rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
  cursor: pointer;
}

.global-lang-container:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

#global-lang-select {
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  color: var(--text-main);
  font-family: var(--font-body);
  padding: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* Inline chevron arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24'%3E%3Cpath fill='%238b9cc8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0px center;
  padding-right: 14px;
}

#global-lang-select option {
  background-color: #0d1222;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}


.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-main);
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--color-primary);
  border-color: var(--color-primary-glow);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* --- Body Layout Grid --- */
.app-body {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* --- Sidebar Panels --- */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.nav-group-title {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: 1px solid transparent;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 0.25rem;
}

.nav-item:hover {
  background-color: var(--glass-highlight);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--color-primary-glow);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  box-shadow: var(--shadow-neon);
}

.nav-item i {
  font-size: 1.05rem;
  width: 20px;
}

.hidden {
  display: none !important;
}

.sidebar-footer {
  border-top: 1px solid var(--glass-border);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stadium-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background-color: var(--color-success);
  box-shadow: 0 0 10px var(--color-success-glow);
  animation: pulse-green-glow 2s infinite;
}

.connection-mode {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* --- Main Content Panel --- */
.main-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 2rem;
  background: radial-gradient(circle at top left, var(--bg-tertiary) 0%, var(--bg-primary) 70%);
}

.tab-content {
  display: none !important;
}

.tab-content.active {
  display: block !important;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Glassmorphic Card Styling --- */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  background-image: linear-gradient(135deg, var(--glass-highlight) 0%, transparent 100%);
  transition: var(--transition-smooth);
}

.card-glass:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.card-glass-dark {
  background: var(--glass-bg-dark);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1rem;
}

/* Card Header Components */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.75rem;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Stats Grid Layout --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-glow);
}

.stat-icon.warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-glow);
}

.stat-icon.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid var(--color-success-glow);
}

.stat-icon.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
  border: 1px solid var(--color-error-glow);
}

.stat-details h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-title);
  line-height: 1.2;
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

/* --- Dashboard Details Grid --- */
.dashboard-details-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

/* Wait Time Meter UI */
.gate-wait-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gate-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.gate-status-text {
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  border-radius: 12px;
}

.status-low {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}
.status-moderate {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}
.status-high {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.progress-bar-container {
  height: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  width: 0%;
  transition: width 1s ease-in-out;
}

.progress-bar-fill.bar-low {
  background: linear-gradient(90deg, var(--color-success) 0%, #34d399 100%);
  box-shadow: 0 0 10px var(--color-success-glow);
}
.progress-bar-fill.bar-moderate {
  background: linear-gradient(90deg, var(--color-warning) 0%, #fbbf24 100%);
  box-shadow: 0 0 10px var(--color-warning-glow);
}
.progress-bar-fill.bar-high {
  background: linear-gradient(90deg, var(--color-error) 0%, #f87171 100%);
  box-shadow: 0 0 10px var(--color-error-glow);
}

.gate-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Concession Queues UI */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  transition: var(--transition-fast);
}

.queue-item:hover {
  background-color: var(--glass-highlight);
}

.queue-details h5 {
  font-size: 0.85rem;
  font-weight: 500;
}

.queue-details span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.queue-time {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
}

.loading-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* --- Map View Grid --- */
.map-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.map-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  min-height: 450px;
}

.map-visual-wrapper {
  width: 100%;
  max-width: 400px;
  position: relative;
}

.stadium-graphic {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.5));
}

.stadium-outer-ring {
  fill: #111827;
  stroke: var(--glass-border);
  stroke-width: 4px;
}

.stadium-middle-ring {
  fill: #1f2937;
  stroke: var(--glass-border);
  stroke-width: 2px;
}

.stadium-sector {
  fill: #1e293b;
  stroke: var(--bg-primary);
  stroke-width: 3px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.stadium-sector:hover {
  fill: #334155;
}

.stadium-sector.active-sector {
  fill: var(--color-primary-glow);
  stroke: var(--color-primary);
  filter: drop-shadow(0 0 8px var(--color-primary-glow));
}

.stadium-field {
  fill: #065f46;
  stroke: #10b981;
  stroke-width: 2px;
}

.stadium-field-line {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1px;
}

.stadium-field-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1px;
}

/* Vector Hotspots overlay */
.hotspot {
  cursor: pointer;
}

.hotspot-pulse {
  fill: none;
  stroke-width: 2px;
  opacity: 0.8;
  animation: radar-ping 2s infinite ease-out;
}

.hotspot-core {
  stroke: #fff;
  stroke-width: 1px;
}

.hotspot-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-title);
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition-fast);
}

.hotspot:hover .hotspot-label {
  opacity: 1;
}

/* Hotspot Color Schemes */
.success-pulse { stroke: var(--color-success); }
.success-core { fill: var(--color-success); }

.warning-pulse { stroke: var(--color-warning); }
.warning-core { fill: var(--color-warning); }

.moderate-pulse { stroke: var(--color-primary); }
.moderate-core { fill: var(--color-primary); }

.error-pulse { stroke: var(--color-error); }
.error-core { fill: var(--color-error); }

.map-legend {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.green { background-color: var(--color-success); }
.legend-dot.yellow { background-color: var(--color-warning); }
.legend-dot.red { background-color: var(--color-error); }

/* Details Pathfinder Card panel */
.details-card {
  display: flex;
  flex-direction: column;
}

.zone-metrics-row {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1.25rem;
}

.zone-metric {
  flex: 1;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.75rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-title);
}

.text-red { color: var(--color-error); }
.text-green { color: var(--color-success); }
.text-yellow { color: var(--color-warning); }

.info-block h4 {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.facility-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.facility-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.4;
}

.facility-list li i {
  margin-top: 2px;
}

.ai-pathfinder-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(20, 27, 49, 0.5) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.05);
}

.ai-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.ai-card-content {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  font-style: italic;
}

/* --- Chat Assistant Interface --- */
.chat-container {
  max-width: 800px;
  margin: 0 auto;
  height: 520px;
  display: grid;
  grid-template-rows: 60px 1fr auto 60px;
  overflow: hidden;
}

.chat-header-bar {
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding: 0 1.25rem;
  background-color: rgba(255, 255, 255, 0.02);
}

.chat-bot-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-primary-glow);
  border: 1px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.chat-bot-profile h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.bot-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-success);
  animation: pulse-green-glow 1.5s infinite;
}

.chat-language-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-language-selector select {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.chat-messages {
  grid-row: 2;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  gap: 0.75rem;
  max-width: 85%;
  align-items: flex-start;
}

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.bot-message .msg-avatar {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
}

.user-message .msg-avatar {
  background-color: var(--color-primary);
  color: #fff;
}

.msg-content {
  background-color: var(--glass-bg-dark);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.user-message .msg-content {
  background: linear-gradient(135deg, var(--color-primary-glow) 0%, rgba(20, 27, 49, 0.9) 100%);
  border-color: rgba(59, 130, 246, 0.25);
}

.msg-content p {
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-line;
}

.msg-content ul {
  margin: 0.5rem 0 0.5rem 1.2rem;
}

.msg-content li {
  margin-bottom: 0.25rem;
}

.msg-time {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.25rem;
}

/* Suggestions tags */
.chat-suggestions {
  grid-row: 3;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.suggest-btn {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 0.35rem 0.75rem;
  border-radius: 30px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.suggest-btn:hover {
  background-color: var(--glass-highlight);
  border-color: var(--color-primary);
  color: var(--text-main);
}

/* Chat Input form */
.chat-input-area {
  grid-row: 4;
  display: flex;
  border-top: 1px solid var(--glass-border);
  padding: 0.5rem 1.25rem;
  align-items: center;
  gap: 0.75rem;
  background-color: rgba(255, 255, 255, 0.01);
}

.chat-input-area input {
  flex-grow: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.9rem;
  padding: 0.5rem;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 3px;
  padding: 6px 0;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* --- Sustainability / Green Rewards layout --- */
.sustainability-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.eco-action-row {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.action-details h4 {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.action-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Points progress display circle */
.points-circle-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
}

.points-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 8px solid var(--bg-tertiary);
  border-top-color: var(--color-success);
  border-right-color: var(--color-success);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.15);
  animation: spin-glow 3s infinite linear;
}

.points-number {
  font-size: 2.2rem;
  font-family: var(--font-title);
  font-weight: 800;
  color: var(--color-success);
  text-shadow: 0 0 12px var(--color-success-glow);
  line-height: 1.1;
}

.points-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-radius: var(--border-radius-sm);
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
}

.leaderboard-list li.user-rank {
  background-color: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.rank {
  width: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

.leaderboard-list li.user-rank .rank {
  color: var(--color-success);
}

.username {
  flex-grow: 1;
}

.score-val {
  font-family: var(--font-title);
  font-weight: 700;
}

/* Eco Trivia Box */
.btn-option {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
}

.btn-option:hover {
  border-color: var(--color-warning);
}

.btn-option.correct {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--color-success) !important;
  color: var(--color-success) !important;
}

.btn-option.incorrect {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: var(--color-error) !important;
  color: var(--color-error) !important;
}

/* --- Operations Command Heatmap Layout --- */
.ops-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

.heatmap-card {
  min-height: 480px;
}

.heatmap-canvas-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background-color: #05070a;
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

.stadium-graphic-overlay {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.opacity-50 {
  opacity: 0.35;
}

.fill-none {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
}

/* Heatmap overlays */
.heatmap-dot {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  filter: blur(25px);
  opacity: 0.45;
  transition: all 1.5s ease;
  pointer-events: none;
}

.dot-north { top: 9%; left: 50%; background-color: var(--color-success); }
.dot-east { top: 50%; left: 91%; background-color: var(--color-success); }
.dot-south { top: 91%; left: 50%; background-color: var(--color-primary); }
.dot-west { top: 50%; left: 9%; background-color: var(--color-primary); }
.dot-field { top: 50%; left: 50%; background-color: rgba(255,255,255,0.05); }

/* Heatmap states */
.level-low {
  background-color: var(--color-success) !important;
  opacity: 0.35;
  transform: translate(-50%, -50%) scale(0.8);
}
.level-moderate {
  background-color: var(--color-warning) !important;
  opacity: 0.55;
  transform: translate(-50%, -50%) scale(1.1);
  animation: pulse-heatmap 3s infinite ease-in-out;
}
.level-high {
  background-color: var(--color-error) !important;
  opacity: 0.75;
  transform: translate(-50%, -50%) scale(1.4);
  animation: pulse-heatmap-fast 1.5s infinite ease-in-out;
}

/* alerts Feed Panel in Command Center */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.alert-item-card {
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--color-primary);
  background-color: rgba(255, 255, 255, 0.01);
  padding: 1rem;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.alert-item-card.severity-high {
  border-left-color: var(--color-error);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.03);
}

.alert-item-card.severity-medium {
  border-left-color: var(--color-warning);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
}

.alert-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-error);
}

.alert-item-card.severity-medium .alert-tag {
  color: var(--color-warning);
}

.alert-loc {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.alert-message {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-main);
}

.ai-recommendation-block {
  border-top: 1px dashed var(--glass-border);
  padding-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-gold);
  line-height: 1.45;
}

.ai-recommendation-block i {
  margin-right: 0.25rem;
}

/* --- Incident Dispatch / Action Plan Room Layout --- */
.incident-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.col-6 {
  flex: 1;
}

input, select, textarea {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

textarea {
  resize: vertical;
}

.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

/* Action plan response card */
.iap-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  gap: 1rem;
}

.iap-empty-state i {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.05);
}

.iap-empty-state p {
  font-size: 0.88rem;
  line-height: 1.5;
}

.iap-header {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.iap-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.iap-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.iap-staff-box {
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  padding: 0.75rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1.25rem;
}

.iap-staff-box h5 {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.staff-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.staff-badge {
  background-color: var(--color-primary-glow);
  border: 1px solid var(--color-primary);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.iap-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background-color: rgba(255, 255, 255, 0.01);
  padding: 0.65rem 0.85rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.checklist-item:hover {
  background-color: var(--glass-highlight);
  border-color: rgba(255, 255, 255, 0.12);
}

.checklist-checkbox {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checklist-text {
  font-size: 0.85rem;
  line-height: 1.45;
}

.checklist-item.checked {
  opacity: 0.5;
  border-color: var(--glass-border);
}

.checklist-item.checked .checklist-text {
  text-decoration: line-through;
}

.iap-safety-precautions {
  border-left: 3px solid var(--color-warning);
  background-color: rgba(245, 158, 11, 0.04);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}

.iap-safety-precautions strong {
  color: var(--color-warning);
}

/* Badge priority glows */
.badge-critical { background-color: var(--color-error); box-shadow: 0 0 10px var(--color-error-glow); }
.badge-high { background-color: var(--color-error); }
.badge-medium { background-color: var(--color-warning); }
.badge-low { background-color: var(--color-primary); }

/* --- Staff Multilingual Translator Bridge Layout --- */
.translator-container {
  max-width: 900px;
  margin: 0 auto;
}

.translation-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1.25rem;
}

.lang-selector-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lang-selector-box label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.swap-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-top: 1.2rem;
}

.translation-areas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.trans-text-box {
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.trans-text-box .box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.trans-text-box textarea {
  background: none;
  border: none;
  resize: none;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.trans-text-box textarea:focus {
  box-shadow: none;
}

.trans-text-box.output-box {
  background-color: var(--glass-bg-dark);
}

.output-wrapper {
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
}

.translated-output {
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text-main);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  color: var(--color-primary);
}

.translate-action-row {
  display: flex;
  justify-content: flex-end;
}

.culture-guide-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(20, 27, 49, 0.5) 100%);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--border-radius-md);
  padding: 1rem;
}

.guide-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--color-warning);
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.guide-content {
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

/* --- Common UI Buttons & Controls --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  padding: 0.55rem 1.2rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-neon);
}

.btn-primary:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--glass-border);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--glass-highlight);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-badge {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid var(--color-success-glow);
  animation: pulse-green 2s infinite;
}

.mt-4 { margin-top: 1rem; }
.mt-2 { margin-top: 0.5rem; }

/* --- Micro-Animations --- */
@keyframes pulse-red {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse-green {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

@keyframes pulse-green-glow {
  0% { box-shadow: 0 0 5px var(--color-success-glow); }
  50% { box-shadow: 0 0 15px var(--color-success-glow); }
  100% { box-shadow: 0 0 5px var(--color-success-glow); }
}

@keyframes radar-ping {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.5); opacity: 0; }
}

@keyframes spin-glow {
  0% { border-top-color: var(--color-success); }
  33% { border-top-color: var(--color-primary); }
  66% { border-top-color: var(--color-warning); }
  100% { border-top-color: var(--color-success); }
}

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes pulse-heatmap {
  0% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.55; }
  50% { transform: translate(-50%, -50%) scale(1.25); opacity: 0.4; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.55; }
}

@keyframes pulse-heatmap-fast {
  0% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.75; }
  50% { transform: translate(-50%, -50%) scale(1.6); opacity: 0.55; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.75; }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.FIFA-pulse {
  animation: pulse-red 2.5s infinite ease-in-out;
}

/* Custom positioning helpers */
.text-right { text-align: right; }
.text-left { text-align: left; }
.opacity-50 { opacity: 0.5; }

/* --- Responsive Layout (Mobile / Tablet Support) --- */
@media (max-width: 1024px) {
  .dashboard-details-grid,
  .map-grid,
  .sustainability-grid,
  .ops-grid,
  .incident-grid,
  .translation-areas-grid {
    grid-template-columns: 1fr;
  }
  
  .chat-container {
    height: 480px;
  }
}

@media (max-width: 768px) {
  .app-container {
    grid-template-rows: auto 1fr;
  }
  
  .app-header {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    height: auto;
  }
  
  .app-body {
    flex-direction: column;
    overflow-y: auto;
  }
  
  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem;
  }
  
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 0.5rem;
  }
  
  .nav-group {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
  }
  
  .nav-group-title {
    display: none;
  }
  
  .nav-item {
    margin-bottom: 0;
    padding: 0.5rem 0.8rem;
    white-space: nowrap;
    width: auto;
  }
  
  .nav-item span {
    display: inline;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .main-content {
    padding: 1rem;
  }
}
