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

:root {
  --bg-primary: #050811;
  --bg-secondary: #0a0e1a;
  --bg-card: rgba(10, 16, 32, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(6, 182, 212, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --color-primary: #3b82f6;
  --color-primary-glow: rgba(59, 130, 246, 0.2);
  --color-secondary: #06b6d4;
  --color-secondary-glow: rgba(6, 182, 212, 0.2);
  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.2);
  --color-warning: #f59e0b;
  --color-danger: #f43f5e;
  --color-danger-glow: rgba(244, 63, 94, 0.25);
  
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  --shadow-neon-blue: 0 0 25px rgba(59, 130, 246, 0.25);
  --shadow-neon-cyan: 0 0 25px rgba(6, 182, 212, 0.35);
  --shadow-neon-red: 0 0 35px rgba(244, 63, 94, 0.45);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  filter: brightness(1.2);
}

button {
  font-family: var(--font-sans);
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Layout Utilities */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.brand-logo svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(to right, #ffffff, #94A3B8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  margin-left: 0.5rem;
}

/* Nav Pill Switchers */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mode-selector {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.25rem;
  border-radius: 30px;
  display: flex;
  gap: 0.25rem;
}

.mode-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mode-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-btn[data-mode="staff"].active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: #38BDF8;
}

.lang-selector {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-selector:focus {
  border-color: var(--color-primary);
}

/* Glassmorphism Cards */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.glass-panel:hover {
  border-color: rgba(6, 182, 212, 0.2);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45), 0 0 15px rgba(6, 182, 212, 0.05);
}

/* Portals Wrapper */
.portal-view {
  display: none;
  grid-gap: 1.5rem;
}

.portal-view.active {
  display: grid;
  animation: fadeIn var(--transition-slow);
}

/* ------------------- FAN PORTAL LAYOUT ------------------- */
.fan-grid {
  grid-template-columns: 1fr;
  grid-gap: 1.5rem;
}

@media (min-width: 1024px) {
  .fan-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* Left Area: Map and Quick Action Cards */
.fan-main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Interactive Map Panel */
.map-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.map-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-success);
  animation: pulse-green 2s infinite;
}

.map-controls-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.map-btn {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.map-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.map-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60A5FA;
}

.map-container {
  background: radial-gradient(circle at center, #0B1220 0%, #050810 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

/* Blueprint Mesh background overlay */
.stadium-scanner-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 30px 30px;
  background-image: 
    linear-gradient(to right, rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  pointer-events: none;
  z-index: 1;
}

/* Scanning Sweep Laser Line */
.stadium-scanner-line {
  stroke: rgba(6, 182, 212, 0.25);
  stroke-width: 1.5;
  transform-origin: 300px 225px;
  animation: radar-sweep 5s linear infinite;
  pointer-events: none;
}

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

/* Blueprint Styling */
.stadium-svg {
  max-width: 100%;
  height: auto;
  max-height: 450px;
  z-index: 2;
}

.map-element {
  transition: var(--transition-normal);
  cursor: pointer;
}

/* Map Layers */
.stadium-outline {
  fill: none;
  stroke: #1E293B;
  stroke-width: 4;
}

.stadium-field {
  transition: all var(--transition-normal);
}

.stadium-field-lines {
  fill: none;
  stroke: rgba(16, 185, 129, 0.25);
  stroke-width: 1.5;
}

/* Pulsing outer rings for gates */
.gate-glow-pulse {
  fill: none;
  stroke-width: 1;
  pointer-events: none;
  transform-origin: center;
  opacity: 0;
}
.gate-wrapper.normal .gate-glow-pulse {
  stroke: var(--color-success);
  animation: gate-pulse 2s infinite ease-out;
}
.gate-wrapper.congested .gate-glow-pulse {
  stroke: var(--color-warning);
  animation: gate-pulse 1.8s infinite ease-out;
}
.gate-wrapper.crowded .gate-glow-pulse {
  stroke: var(--color-danger);
  animation: gate-pulse 1.5s infinite ease-out;
}

@keyframes gate-pulse {
  0% { r: 16; opacity: 0.6; }
  100% { r: 26; opacity: 0; }
}

.stadium-gate {
  fill: rgba(30, 41, 59, 0.6);
  stroke: var(--text-muted);
  stroke-width: 1.5;
}

.stadium-gate.normal {
  fill: rgba(16, 185, 129, 0.15);
  stroke: var(--color-success);
}

.stadium-gate.congested {
  fill: rgba(245, 158, 11, 0.15);
  stroke: var(--color-warning);
}

.stadium-gate.crowded {
  fill: rgba(244, 63, 94, 0.15);
  stroke: var(--color-danger);
}

.stadium-seat-block {
  fill: rgba(255, 255, 255, 0.02);
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1.2;
  transition: all var(--transition-normal);
}

/* Densities visual highlight */
.stadium-seat-block.block-low {
  fill: rgba(16, 185, 129, 0.03);
  stroke: rgba(16, 185, 129, 0.15);
}
.stadium-seat-block.block-low:hover {
  fill: rgba(16, 185, 129, 0.15);
  stroke: var(--color-success);
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.4));
}

.stadium-seat-block.block-medium {
  fill: rgba(245, 158, 11, 0.03);
  stroke: rgba(245, 158, 11, 0.15);
}
.stadium-seat-block.block-medium:hover {
  fill: rgba(245, 158, 11, 0.15);
  stroke: var(--color-warning);
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.4));
}

.stadium-seat-block.block-high {
  fill: rgba(244, 63, 94, 0.04);
  stroke: rgba(244, 63, 94, 0.18);
}
.stadium-seat-block.block-high:hover {
  fill: rgba(244, 63, 94, 0.18);
  stroke: var(--color-danger);
  filter: drop-shadow(0 0 5px rgba(244, 63, 94, 0.4));
}

.stadium-facility {
  cursor: pointer;
}
.stadium-facility rect {
  fill: rgba(255, 255, 255, 0.03);
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1.2;
  transition: all var(--transition-fast);
}
.stadium-facility text, .stadium-facility path {
  fill: var(--text-secondary);
  transition: all var(--transition-fast);
}

.stadium-facility:hover rect {
  fill: rgba(6, 182, 212, 0.1);
  stroke: var(--color-secondary);
  filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.3));
}
.stadium-facility:hover text, .stadium-facility:hover path {
  fill: #fff;
}

.facility-active rect {
  fill: rgba(6, 182, 212, 0.15) !important;
  stroke: var(--color-secondary) !important;
}
.facility-active text, .facility-active path {
  fill: #fff !important;
}

/* Floating HUD Tooltip card */
.map-tooltip {
  position: absolute;
  z-index: 200;
  pointer-events: none;
  background: rgba(10, 16, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(6, 182, 212, 0.1);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0;
  transform: translate(-50%, -100%) scale(0.9);
  transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 140px;
}
.map-tooltip.show {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(-12px) scale(1);
}
.tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.25rem;
}
.tooltip-badge {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--color-secondary);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tooltip-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}
.tooltip-body {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.accessible-route {
  stroke: #38BDF8;
  stroke-width: 3;
  stroke-dasharray: 6 4;
  fill: none;
  animation: dash-move 30s linear infinite;
  display: none;
}

.accessible-route.show {
  display: block;
}

@keyframes dash-move {
  to {
    stroke-dashoffset: -1000;
  }
}

/* Map legend */
.map-legend {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

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

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

.legend-dot.green { background: var(--color-success); box-shadow: 0 0 6px var(--color-success); }
.legend-dot.orange { background: var(--color-warning); box-shadow: 0 0 6px var(--color-warning); }
.legend-dot.red { background: var(--color-danger); box-shadow: 0 0 6px var(--color-danger); }
.legend-dot.cyan { background: var(--color-secondary); box-shadow: 0 0 6px var(--color-secondary); }
.legend-line.blue {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-secondary);
  box-shadow: 0 0 6px var(--color-secondary);
}

/* Quick Tools Grid */
.quick-tools {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 1rem;
}

@media (min-width: 640px) {
  .quick-tools {
    grid-template-columns: 1fr 1fr;
  }
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
}

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

.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-card.sustainability .tool-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.tool-card.safety-hub .tool-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.tool-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tool-action-btn {
  margin-top: auto;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition-fast);
}

.tool-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Right Side: Aura AI Chatbot */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 580px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.ai-avatar svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

.chat-status {
  font-size: 0.7rem;
  color: var(--color-secondary);
  background: rgba(6, 182, 212, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-secondary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--color-secondary);
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 0.25rem;
  margin-bottom: 1rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  animation: slideUp var(--transition-normal);
}

.chat-msg.ai {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-msg.user {
  background: var(--color-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.chat-msg.system-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  align-self: center;
  max-width: 95%;
  font-size: 0.75rem;
  text-align: center;
  border-radius: var(--radius-sm);
}

.chat-msg.system-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  align-self: center;
  max-width: 95%;
  font-size: 0.75rem;
  text-align: center;
  border-radius: var(--radius-sm);
}

.chat-msg.ai p {
  margin-bottom: 0.35rem;
}
.chat-msg.ai p:last-child {
  margin-bottom: 0;
}

.msg-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.msg-action-btn {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.msg-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  border-bottom-left-radius: 2px;
  align-self: flex-start;
  display: none;
}

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

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

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

.chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.chat-input:focus {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.1);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-normal);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.chat-send-btn:hover {
  background: #2563EB;
  transform: translateY(-2px);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.suggested-questions {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
  scrollbar-width: none; /* Firefox */
}
.suggested-questions::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.suggest-btn {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.suggest-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}


/* ------------------- STEREOTYPE OPERATIONS PANEL ------------------- */
.staff-grid {
  grid-template-columns: 1fr;
  grid-gap: 1.5rem;
}

@media (min-width: 1200px) {
  .staff-grid {
    grid-template-columns: 3fr 1fr;
  }
}

.staff-dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Live Telemetry Stats */
.telemetry-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 1rem;
}

@media (min-width: 640px) {
  .telemetry-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-trend {
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.25rem;
}

.stat-trend.up { color: var(--color-success); }
.stat-trend.down { color: var(--color-danger); }
.stat-trend.warning { color: var(--color-warning); }

/* Control Simulator and incident logs split */
.staff-split-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 1.5rem;
}

@media (min-width: 900px) {
  .staff-split-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* Control simulation inputs panel */
.sim-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sim-control-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sim-control-item:last-child {
  margin-bottom: 0;
}

.sim-control-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.sim-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.sim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--color-primary);
}

.sim-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--color-primary);
}

.gate-control-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 0.5rem;
}

.gate-select-btn {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition-fast);
}

.gate-select-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.gate-select-btn.active-gate {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
  color: #60A5FA;
}

.sim-btn-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.sim-act-btn {
  flex: 1;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  transition: var(--transition-fast);
}

.sim-act-btn.green {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-success);
}
.sim-act-btn.green:hover {
  background: rgba(16, 185, 129, 0.25);
}

.sim-act-btn.orange {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--color-warning);
}
.sim-act-btn.orange:hover {
  background: rgba(245, 158, 11, 0.25);
}

.sim-act-btn.red {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}
.sim-act-btn.red:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Incidents Log Panel */
.incident-panel {
  display: flex;
  flex-direction: column;
  max-height: 380px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-title svg {
  width: 16px;
  height: 16px;
}

.incidents-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.incident-card {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition-fast);
}

.incident-card.critical {
  border-left: 3px solid var(--color-danger);
}
.incident-card.warning {
  border-left: 3px solid var(--color-warning);
}
.incident-card.resolved {
  border-left: 3px solid var(--color-success);
  opacity: 0.6;
}

.incident-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.incident-badge {
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.incident-badge.critical { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; }
.incident-badge.warning { background: rgba(245, 158, 11, 0.15); color: #FCD34D; }
.incident-badge.resolved { background: rgba(16, 185, 129, 0.15); color: #A7F3D0; }

.incident-desc {
  color: var(--text-primary);
  font-weight: 500;
}

.incident-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.incident-btn {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  transition: var(--transition-fast);
}

.incident-btn.dispatch {
  background: var(--color-primary);
  color: #fff;
}
.incident-btn.dispatch:hover { background: #2563EB; }

.incident-btn.resolve {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}
.incident-btn.resolve:hover { background: rgba(16, 185, 129, 0.2); }

/* Right Column: Predictive Decision Advisor */
.ai-advisor-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.advisor-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-secondary);
}

.advisor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.advisor-card {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.02);
  border: 1px solid rgba(6, 182, 212, 0.1);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  transition: var(--transition-normal);
}

.advisor-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--color-secondary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.advisor-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.05);
}

.advisor-title {
  font-weight: 700;
  color: #22D3EE;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.advisor-title svg {
  width: 14px;
  height: 14px;
}

.advisor-content {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.advisor-apply-btn {
  width: fit-content;
  padding: 0.3rem 0.75rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #22D3EE;
  transition: var(--transition-fast);
}

.advisor-apply-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.4);
}


/* ------------------- MODALS ------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 16, 0.85);
  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);
  padding: 1rem;
}

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

.modal-container {
  background: #0E1424;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
  position: relative;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.25rem;
}

.modal-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Sustainability Modal Styles */
.carbon-calc-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-select, .form-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
}

.form-select:focus, .form-input:focus {
  border-color: var(--color-success);
}

.calc-btn {
  background: var(--color-success);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  font-weight: 700;
  text-align: center;
  transition: var(--transition-normal);
  margin-top: 0.5rem;
}

.calc-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.calc-result-box {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
  display: none;
}

.calc-result-box.active {
  display: flex;
  animation: fadeIn var(--transition-normal);
}

.result-val {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: #34D399;
}

.result-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.offset-tips {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.badge-earned {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: #FBBF24;
  font-weight: 600;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.badge-earned svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}


/* Safety Hub Modal Styles */
.sos-trigger-btn {
  background: var(--color-danger);
  color: #fff;
  border-radius: 50%;
  width: 90px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.15rem;
  box-shadow: var(--shadow-neon-red);
  border: 4px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.sos-trigger-btn:hover {
  transform: scale(1.05);
}

.sos-trigger-btn.active-countdown {
  animation: sos-pulse 1s infinite alternate;
}

.sos-countdown {
  font-size: 1.75rem;
  font-weight: 800;
}

.sos-cancel-btn {
  text-align: center;
  font-size: 0.8rem;
  text-decoration: underline;
  color: var(--text-secondary);
  cursor: pointer;
  display: none;
}

.sos-cancel-btn.active {
  display: block;
}

.privacy-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
}

.toggle-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toggle-title {
  font-weight: 600;
  font-size: 0.8rem;
}

.toggle-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

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

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


/* ------------------- KEYFRAMES & PULSES ------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red-fill {
  0% { fill: rgba(239, 68, 68, 0.15); stroke-width: 1.5; }
  50% { fill: rgba(239, 68, 68, 0.35); stroke-width: 2.5; }
  100% { fill: rgba(239, 68, 68, 0.15); stroke-width: 1.5; }
}

@keyframes pulse-orange-fill {
  0% { fill: rgba(245, 158, 11, 0.15); stroke-width: 1.5; }
  50% { fill: rgba(245, 158, 11, 0.3); stroke-width: 2.5; }
  100% { fill: rgba(245, 158, 11, 0.15); stroke-width: 1.5; }
}

@keyframes sos-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
}

/* SOS Status Banner */
.sos-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: #FCA5A5;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  display: none;
  animation: slideUp var(--transition-normal);
}

.sos-banner.active {
  display: flex;
}

.sos-cancel-banner-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  transition: var(--transition-fast);
}

.sos-cancel-banner-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* System Sound Toggle & Chat animations */
.sound-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.sound-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--color-secondary);
  box-shadow: var(--shadow-neon-cyan);
}
.sound-toggle-btn .sound-icon {
  width: 18px;
  height: 18px;
}

/* Custom fade effects for chat bubbles */
.chat-msg {
  animation: slide-up-fade var(--transition-normal) forwards;
  opacity: 0;
  transform: translateY(12px);
}
@keyframes slide-up-fade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

