/* ============================================================
   FIFA World Cup 2026 – Smart Stadium AI Operations Hub
   Design System | styles.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Orbitron:wght@400;700;900&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* FIFA Brand Colors */
  --fifa-blue:        #003087;
  --fifa-blue-light:  #0050c8;
  --fifa-red:         #c8102e;
  --fifa-gold:        #f5c518;
  --fifa-gold-light:  #ffd84d;

  /* Dark Theme Base */
  --bg-void:          #020818;
  --bg-deep:          #050e27;
  --bg-surface:       #0a1a3d;
  --bg-card:          rgba(10, 26, 61, 0.7);
  --bg-card-hover:    rgba(15, 35, 80, 0.85);
  --bg-glass:         rgba(255, 255, 255, 0.04);
  --bg-glass-hover:   rgba(255, 255, 255, 0.08);

  /* Text */
  --text-primary:     #f0f4ff;
  --text-secondary:   #8a9cc8;
  --text-muted:       #4a5880;
  --text-accent:      #f5c518;
  --text-success:     #22d3a0;
  --text-danger:      #ff4d6d;
  --text-warning:     #fbbf24;

  /* Borders */
  --border:           rgba(255, 255, 255, 0.07);
  --border-accent:    rgba(245, 197, 24, 0.3);
  --border-blue:      rgba(0, 80, 200, 0.4);
  --border-glow:      rgba(0, 80, 200, 0.6);

  /* Gradients */
  --gradient-hero:    linear-gradient(135deg, #020818 0%, #050e27 40%, #0a1a3d 100%);
  --gradient-card:    linear-gradient(135deg, rgba(10,26,61,0.8) 0%, rgba(5,14,39,0.9) 100%);
  --gradient-gold:    linear-gradient(90deg, #f5c518, #ffd84d, #f5c518);
  --gradient-blue:    linear-gradient(135deg, #003087, #0050c8);
  --gradient-accent:  linear-gradient(135deg, #0050c8 0%, #003087 50%, #c8102e 100%);
  --gradient-success: linear-gradient(135deg, #064e3b, #065f46);
  --gradient-danger:  linear-gradient(135deg, #7f1d1d, #991b1b);

  /* Shadows */
  --shadow-sm:        0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:        0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:        0 16px 48px rgba(0,0,0,0.6);
  --shadow-glow-blue: 0 0 20px rgba(0,80,200,0.3), 0 0 60px rgba(0,80,200,0.1);
  --shadow-glow-gold: 0 0 20px rgba(245,197,24,0.3), 0 0 60px rgba(245,197,24,0.1);
  --shadow-glow-red:  0 0 20px rgba(200,16,46,0.3);

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;
  --space-3xl:  64px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow:   0.5s ease;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 60px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 14px;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(0,80,200,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(200,16,46,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(245,197,24,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-blue); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--fifa-blue-light); }

/* ── Layout Shell ──────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(5, 14, 39, 0.95);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-logo {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow-blue);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo .logo-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 1px;
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-sm);
  margin-top: var(--space-md);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  border: 1px solid transparent;
  position: relative;
  text-decoration: none;
  color: var(--text-secondary);
}

.nav-item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.nav-item.active {
  background: rgba(0, 80, 200, 0.15);
  border-color: var(--border-blue);
  color: var(--text-primary);
  box-shadow: inset 0 0 20px rgba(0,80,200,0.05);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--gradient-gold);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

.nav-item .nav-badge {
  background: var(--fifa-red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 12px;
  color: var(--text-success);
  font-weight: 500;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--text-success);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease infinite;
  box-shadow: 0 0 8px var(--text-success);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: rgba(5, 14, 39, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  flex: 1;
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.topbar-clock {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  color: var(--text-accent);
  background: rgba(245,197,24,0.08);
  border: 1px solid rgba(245,197,24,0.2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.page-section {
  display: none;
  animation: fadeInUp 0.4s ease;
}

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

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

/* ── Section Header ────────────────────────────────────────── */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}

.section-title .title-icon {
  font-size: 24px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Grid Layouts ──────────────────────────────────────────── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-md); }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-md); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-blue);
}

.card-header {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-body { padding: var(--space-lg); }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon {
  font-size: 28px;
  margin-bottom: var(--space-sm);
  display: block;
}

.stat-card .stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-change {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: var(--space-sm);
  display: inline-block;
}

.stat-change.up   { background: rgba(34,211,160,0.12); color: var(--text-success); }
.stat-change.down { background: rgba(255,77,109,0.12); color: var(--text-danger); }
.stat-change.warn { background: rgba(251,191,36,0.12); color: var(--text-warning); }

.stat-card .stat-glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.15;
  animation: glow-pulse 3s ease infinite;
}

@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.15; }
  50% { transform: scale(1.3); opacity: 0.25; }
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 4px 12px rgba(0,80,200,0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,80,200,0.5);
}

.btn-gold {
  background: var(--gradient-gold);
  color: #1a1000;
  box-shadow: 0 4px 12px rgba(245,197,24,0.3);
}
.btn-gold:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245,197,24,0.5);
}

.btn-danger {
  background: linear-gradient(135deg, var(--fifa-red), #e63950);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,16,46,0.4);
}

.btn-ghost {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-blue);
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-live { background: rgba(255,77,109,0.2); color: #ff4d6d; border: 1px solid rgba(255,77,109,0.3); }
.badge-success { background: rgba(34,211,160,0.15); color: var(--text-success); border: 1px solid rgba(34,211,160,0.3); }
.badge-warning { background: rgba(251,191,36,0.15); color: var(--text-warning); border: 1px solid rgba(251,191,36,0.3); }
.badge-info { background: rgba(0,80,200,0.2); color: #60a5fa; border: 1px solid rgba(0,80,200,0.3); }

/* ── Chat Interface ────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 180px);
  min-height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scroll-behavior: smooth;
}

.chat-bubble {
  display: flex;
  gap: var(--space-sm);
  max-width: 85%;
  animation: bubbleIn 0.3s ease;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.chat-bubble.user .chat-avatar {
  background: var(--gradient-blue);
  border-color: var(--border-blue);
}

.chat-bubble.ai .chat-avatar {
  background: rgba(245,197,24,0.15);
  border-color: var(--border-accent);
}

.chat-message-content {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.chat-bubble.user .chat-message-content {
  background: rgba(0, 80, 200, 0.2);
  border-color: var(--border-blue);
  border-radius: 18px 18px 4px 18px;
}

.chat-bubble.ai .chat-message-content {
  border-radius: 18px 18px 18px 4px;
}

.chat-message-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-input-area {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  background: rgba(5,14,39,0.5);
}

.chat-input-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color var(--transition-fast);
  min-height: 44px;
  max-height: 120px;
}

.chat-input:focus {
  border-color: var(--border-blue);
  box-shadow: 0 0 0 3px rgba(0,80,200,0.1);
}

.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-blue);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,80,200,0.3);
}

.chat-send-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,80,200,0.5); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.2s ease infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ── Quick Prompts ──────────────────────────────────────────── */
.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-sm);
}

.quick-prompt-chip {
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-prompt-chip:hover {
  background: rgba(0,80,200,0.15);
  border-color: var(--border-blue);
  color: var(--text-primary);
}

/* ── Language Selector ──────────────────────────────────────── */
.lang-selector {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-md);
}

.lang-btn {
  padding: 4px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn.active, .lang-btn:hover {
  background: rgba(245,197,24,0.15);
  border-color: var(--border-accent);
  color: var(--text-accent);
}

/* ── Heatmap ────────────────────────────────────────────────── */
#crowd-canvas {
  width: 100%;
  border-radius: var(--radius-lg);
  display: block;
}

.zone-legend {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 12px;
  color: var(--text-secondary);
}

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

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar-wrap {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

.progress-bar-fill.low    { background: linear-gradient(90deg, #22d3a0, #34d399); }
.progress-bar-fill.medium { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress-bar-fill.high   { background: linear-gradient(90deg, #f87171, #ef4444); }
.progress-bar-fill.blue   { background: var(--gradient-blue); }
.progress-bar-fill.gold   { background: var(--gradient-gold); }

/* ── Zone Cards ────────────────────────────────────────────── */
.zone-card {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  transition: all var(--transition-normal);
}

.zone-card:hover { border-color: var(--border-blue); }

.zone-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.zone-name { font-weight: 600; font-size: 13px; }
.zone-pct  { font-family: 'Orbitron', sans-serif; font-size: 16px; font-weight: 700; }

/* ── Form Elements ──────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-blue);
  box-shadow: 0 0 0 3px rgba(0,80,200,0.1);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-deep); }
.form-textarea { resize: vertical; min-height: 80px; }

/* ── AI Response Panel ─────────────────────────────────────── */
.ai-response-panel {
  background: rgba(0,80,200,0.06);
  border: 1px solid var(--border-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.ai-response-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-blue);
}

.ai-response-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ai-response-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.8;
  white-space: pre-wrap;
}

.ai-response-content.streaming::after {
  content: '▊';
  animation: blink 0.7s step-end infinite;
  color: var(--text-accent);
}

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

/* ── Transport Cards ───────────────────────────────────────── */
.transport-option {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.transport-option:hover, .transport-option.selected {
  border-color: var(--border-blue);
  background: rgba(0,80,200,0.1);
}

.transport-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.transport-info { flex: 1; }
.transport-name { font-weight: 600; font-size: 14px; }
.transport-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.transport-eta {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-accent);
}

/* ── Incident Log ───────────────────────────────────────────── */
.incident-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  transition: all var(--transition-fast);
  margin-bottom: var(--space-sm);
}

.incident-item:hover { border-color: var(--border-blue); }

.incident-severity {
  width: 4px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.severity-critical { background: var(--fifa-red); }
.severity-high     { background: var(--text-warning); }
.severity-medium   { background: #60a5fa; }
.severity-low      { background: var(--text-success); }

.incident-body { flex: 1; }
.incident-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.incident-desc  { font-size: 12px; color: var(--text-secondary); }
.incident-meta  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Stadium SVG Map ────────────────────────────────────────── */
#stadium-svg {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.map-section {
  cursor: pointer;
  transition: all 0.2s;
}

.map-section:hover { filter: brightness(1.4); }
.map-section.highlighted { filter: brightness(1.6) drop-shadow(0 0 8px rgba(245,197,24,0.8)); }

/* ── Eco Metrics ────────────────────────────────────────────── */
.eco-ring {
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto;
}

.eco-ring svg {
  transform: rotate(-90deg);
}

.eco-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-accent);
}

/* ── Timeline ────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) + 6px);
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--border-blue);
}

.timeline-item.done::before { background: var(--text-success); border-color: var(--text-success); }
.timeline-item.active::before { background: var(--fifa-gold); border-color: var(--fifa-gold); box-shadow: 0 0 8px rgba(245,197,24,0.6); }

.timeline-time   { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.timeline-event  { font-size: 13px; font-weight: 500; }

/* ── Settings Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Notification Toast ─────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: 12px 20px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 340px;
  backdrop-filter: blur(16px);
}

.toast.success { border-color: rgba(34,211,160,0.4); }
.toast.error   { border-color: rgba(255,77,109,0.4); }
.toast.info    { border-color: var(--border-blue); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero-banner {
  background: var(--gradient-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow-blue);
}

.hero-banner::before {
  content: '⚽';
  position: absolute;
  right: -20px;
  top: -20px;
  font-size: 140px;
  opacity: 0.06;
  animation: spin-slow 20s linear infinite;
}

.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 40%, rgba(255,255,255,0.03));
  pointer-events: none;
}

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

.hero-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: white;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.hero-title span {
  color: var(--text-accent);
}

.hero-subtitle {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  max-width: 500px;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-meta-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-accent);
}

.hero-meta-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ── Match Schedule ─────────────────────────────────────────── */
.match-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: all var(--transition-normal);
  margin-bottom: var(--space-md);
}

.match-card:hover {
  border-color: var(--border-blue);
  background: rgba(0,80,200,0.06);
}

.match-teams {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.team-flag { font-size: 28px; }
.team-name { font-size: 12px; font-weight: 600; text-align: center; }

.match-vs {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

.match-info {
  text-align: right;
}

.match-time {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-accent);
}

.match-venue {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); width: 260px; }
  .main-content { margin-left: 0; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page-content { padding: var(--space-md); }
  .hero-title { font-size: 20px; }
  .hero-meta { gap: var(--space-md); }
}

/* ── Shimmer Loading ─────────────────────────────────────────── */
.shimmer {
  background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-glass-hover) 50%, var(--bg-glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

/* ── Accessibility Alert Banner ─────────────────────────────── */
.access-banner {
  background: rgba(34,211,160,0.08);
  border: 1px solid rgba(34,211,160,0.25);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.access-banner-icon { font-size: 24px; flex-shrink: 0; }
.access-banner-title { font-size: 13px; font-weight: 600; color: var(--text-success); }
.access-banner-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Utility ─────────────────────────────────────────────────── */
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Orbitron', monospace; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--text-accent); }
.text-success { color: var(--text-success); }
.text-danger  { color: var(--text-danger); }
.text-warning { color: var(--text-warning); }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.border-warning { border-color: rgba(251, 191, 36, 0.4) !important; }

/* ── API Key Warning ────────────────────────────────────────── */
.api-key-notice {
  background: rgba(245,197,24,0.08);
  border: 1px solid rgba(245,197,24,0.3);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  font-size: 13px;
  color: var(--text-warning);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

/* ── Crowd Density Color Classes ────────────────────────────── */
.density-low    { color: #22d3a0; }
.density-medium { color: #fbbf24; }
.density-high   { color: #f87171; }
.density-critical { color: #ff4d6d; }

/* ── Pulse Animation ────────────────────────────────────────── */
.pulse-ring {
  position: relative;
  display: inline-block;
}

.pulse-ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: ping 1.5s ease infinite;
  opacity: 0;
}

@keyframes ping {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* ── Score Board ────────────────────────────────────────────── */
.scoreboard {
  background: var(--gradient-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow-glow-blue);
}

.scoreboard-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
}

.scoreboard-score {
  font-family: 'Orbitron', sans-serif;
  font-size: 48px;
  font-weight: 900;
  color: white;
  line-height: 1;
}

.scoreboard-sep {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  color: rgba(255,255,255,0.5);
}

.scoreboard-time {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-top: var(--space-sm);
  letter-spacing: 2px;
}
