/* ==========================================================================
   PETWELL - Premium Glassmorphic Dark-Mode Design System
   ========================================================================== */

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

:root {
  /* Color Palette */
  --bg-primary: #080b11;
  --bg-secondary: #0e1320;
  --bg-gradient: radial-gradient(circle at 50% 0%, #151e36 0%, #080b11 100%);
  
  /* Glassmorphism Defaults */
  --glass-bg: rgba(16, 22, 37, 0.55);
  --glass-bg-hover: rgba(24, 34, 56, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* Neon Status Accent Colors */
  --color-green: #10b981;
  --color-green-glow: rgba(16, 185, 129, 0.15);
  --color-green-text: #34d399;
  
  --color-amber: #f59e0b;
  --color-amber-glow: rgba(245, 158, 11, 0.15);
  --color-amber-text: #fbbf24;
  
  --color-red: #f43f5e;
  --color-red-glow: rgba(244, 63, 94, 0.15);
  --color-red-text: #fb7185;
  
  /* Theme Accents */
  --accent-primary: #0ea5e9; /* Sky Blue */
  --accent-secondary: #8b5cf6; /* Violet */
  --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
  --accent-glow: rgba(14, 165, 233, 0.25);
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  background: var(--bg-primary);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  display: flex;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-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 Structure
   ========================================================================== */
#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Sidebar Navigation */
aside.sidebar {
  width: 280px;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  z-index: 10;
}

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

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

.brand-logo svg {
  color: white;
  width: 24px;
  height: 24px;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

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

.nav-item.active {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: inset 0 0 12px rgba(14, 165, 233, 0.05);
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 4px;
  background: var(--accent-primary);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px var(--accent-primary);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: var(--transition-fast);
}

.nav-item:hover svg, .nav-item.active svg {
  transform: scale(1.05);
}

/* User Card in Sidebar */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid var(--glass-border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent-primary);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

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

/* Main Dashboard Area */
main.main-content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

.view-title-group h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to bottom, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.view-title-group p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Quick Status Pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.status-pill.status-green {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--color-green-text);
}

.status-pill.status-amber {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--color-amber-text);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
  animation: pulse-amber 2s infinite ease-in-out;
}

.status-pill.status-red {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.2);
  color: var(--color-red-text);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.15);
  animation: pulse-red 1.5s infinite ease-in-out;
}

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

/* Common Card Styling */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

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

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title svg {
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   View 1: Dashboard View
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

.dashboard-left {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Pet Identity Header Card */
.pet-identity-card {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  background: linear-gradient(135deg, rgba(21, 30, 54, 0.6) 0%, rgba(16, 22, 37, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pet-avatar-large {
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 2.25rem;
}

.pet-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-details-meta {
  flex: 1;
}

.pet-name-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

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

.pet-meta-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: var(--text-muted);
}

.pet-meta-tag.risk-tag {
  color: var(--color-amber-text);
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.15);
}

/* Vitals Quick Grid */
.vitals-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.vital-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.vital-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.vital-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vital-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.vital-card:hover .vital-icon {
  background: var(--accent-glow);
  color: var(--accent-primary);
}

.vital-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.vital-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.15rem;
}

.vital-status {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.vital-status.normal { color: var(--color-green-text); }
.vital-status.warning { color: var(--color-amber-text); }
.vital-status.critical { color: var(--color-red-text); }

/* Pulse animations for status dots in vitals cards */
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}
.vital-status.warning .pulse-dot { animation: pulse-amber-small 1.5s infinite; }
.vital-status.critical .pulse-dot { animation: pulse-red-small 1s infinite; }

/* Camera Stream Overlay Component */
.camera-feed-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  padding: 0;
  display: flex;
  background: black;
}

.camera-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  transition: opacity var(--transition-normal);
}

.camera-overlay-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

.camera-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.camera-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

.camera-badge.live::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--color-red);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

.camera-location {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.camera-activity-detector {
  align-self: center;
  background: rgba(16, 22, 37, 0.85);
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  max-width: 80%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transform: translateY(20px);
  opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.camera-activity-detector.active {
  transform: translateY(0);
  opacity: 1;
}

.activity-pulsar {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
  animation: radar-pulse 1.8s infinite ease-out;
}

.activity-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.camera-footer-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  font-family: monospace;
}

/* Behaviour Event Timeline Log */
.behaviour-log-card {
  max-height: 480px;
  display: flex;
  flex-direction: column;
}

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

.behaviour-item {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.behaviour-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

.behaviour-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 50px;
  flex-shrink: 0;
  font-weight: 500;
  padding-top: 0.2rem;
}

.behaviour-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  flex-shrink: 0;
}

.behaviour-item.anomalous .behaviour-icon-wrapper {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--color-amber-text);
}

.behaviour-item.critical .behaviour-icon-wrapper {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.2);
  color: var(--color-red-text);
}

.behaviour-body {
  flex: 1;
}

.behaviour-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

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

.behaviour-badge {
  align-self: center;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.behaviour-badge.ai-analysis {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: var(--accent-primary);
}

.behaviour-badge.anomaly {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--color-amber-text);
}

.behaviour-badge.owner-log {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent-secondary);
}

/* ==========================================================================
   View 2: Timeline & Trends View
   ========================================================================== */
.trends-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.trends-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
}

.trends-time-selector {
  display: flex;
  gap: 0.5rem;
}

.time-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.time-btn:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}

.time-btn.active {
  background: rgba(255,255,255,0.06);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.chart-card {
  height: 380px;
  display: flex;
  flex-direction: column;
}

.chart-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
}

.chart-summary {
  display: flex;
  gap: 1.5rem;
  margin-top: -0.25rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.chart-summary-item {
  display: flex;
  flex-direction: column;
}

.chart-summary-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-summary-lbl {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

/* ==========================================================================
   View 3: Symptom Logger View
   ========================================================================== */
.logger-card {
  max-width: 750px;
  margin: 0 auto;
  width: 100%;
}

.logger-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

input, select, textarea {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.15);
  background: rgba(10, 14, 23, 0.8);
}

.btn {
  background: var(--accent-gradient);
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px var(--accent-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--glass-border-hover);
  box-shadow: none;
  transform: none;
}

/* ==========================================================================
   View 4: Triage Screen View
   ========================================================================== */
.triage-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.triage-hero-card {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.triage-hero-card.triage-green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(10, 14, 23, 0.6) 100%);
  border-color: rgba(16, 185, 129, 0.25);
}

.triage-hero-card.triage-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(10, 14, 23, 0.6) 100%);
  border-color: rgba(245, 158, 11, 0.25);
}

.triage-hero-card.triage-red {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(10, 14, 23, 0.6) 100%);
  border-color: rgba(244, 63, 94, 0.25);
}

.triage-badge-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.triage-green .triage-badge-icon {
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--color-green-text);
  color: var(--color-green-text);
  box-shadow: 0 0 30px var(--color-green-glow);
}

.triage-amber .triage-badge-icon {
  background: rgba(245, 158, 11, 0.15);
  border: 2px solid var(--color-amber-text);
  color: var(--color-amber-text);
  box-shadow: 0 0 30px var(--color-amber-glow);
  animation: pulse-amber-glow 2s infinite ease-in-out;
}

.triage-red .triage-badge-icon {
  background: rgba(244, 63, 94, 0.15);
  border: 2px solid var(--color-red-text);
  color: var(--color-red-text);
  box-shadow: 0 0 30px var(--color-red-glow);
  animation: pulse-red-glow 1.5s infinite ease-in-out;
}

.triage-hero-content {
  flex: 1;
}

.triage-level-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.triage-green .triage-level-title { color: var(--color-green-text); }
.triage-amber .triage-level-title { color: var(--color-amber-text); }
.triage-red .triage-level-title { color: var(--color-red-text); }

.triage-main-recommendation {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.triage-explanation {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.triage-details-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.75rem;
}

.triage-analysis-card .analysis-point {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.triage-analysis-card .analysis-point:last-child {
  border-bottom: none;
}

.triage-analysis-card .analysis-bullet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.triage-analysis-card .analysis-body {
  flex: 1;
}

.triage-analysis-card .analysis-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.triage-analysis-card .analysis-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.triage-actions-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.triage-action-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.02);
  color: white;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.triage-action-button:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--glass-border-hover);
}

.triage-action-button.action-primary {
  background: var(--accent-gradient);
  border: none;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.triage-action-button.action-primary:hover {
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.triage-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.action-primary .triage-action-icon {
  background: rgba(255,255,255,0.15);
}

.triage-action-text {
  display: flex;
  flex-direction: column;
}

.triage-action-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.triage-action-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.action-primary .triage-action-desc {
  color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   View 5: AI Chat View
   ========================================================================== */
.chat-container {
  max-width: 850px;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.chat-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 14, 23, 0.4);
}

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

.chat-bot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 15px var(--accent-glow);
}

.chat-bot-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
}

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

.chat-bot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--color-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color-green-glow);
}

.chat-settings-trigger {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0.4rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-settings-trigger:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  transform: rotate(30deg);
}

/* Chat settings dropdown/modal overlay */
.chat-config-panel {
  display: none;
  padding: 1.25rem 1.75rem;
  background: rgba(10, 14, 23, 0.95);
  border-bottom: 1px solid var(--glass-border);
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: end;
}

.chat-config-panel.open {
  display: grid;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-message {
  display: flex;
  gap: 1rem;
  max-width: 85%;
}

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

.chat-message.system {
  align-self: center;
  max-width: 100%;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-message.bot .message-avatar {
  background: var(--accent-gradient);
  color: white;
  border: none;
}

.chat-message.user .message-avatar {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  color: white;
}

.message-bubble-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.message-bubble {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  word-break: break-word;
}

.chat-message.bot .message-bubble {
  border-top-left-radius: 2px;
}

.chat-message.user .message-bubble {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.25);
  color: var(--text-primary);
  border-top-right-radius: 2px;
}

.chat-message.system .message-bubble {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.25rem;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-dark);
  align-self: flex-start;
}

.chat-message.user .message-time {
  align-self: flex-end;
}

.chat-input-area {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(10, 14, 23, 0.4);
}

.chat-input-form {
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.chat-input {
  flex: 1;
  border-radius: 12px;
  background: rgba(10, 14, 23, 0.7);
  padding: 0.85rem 1.25rem;
  padding-right: 3rem;
  border: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.chat-input:focus {
  border-color: var(--accent-primary);
}

.chat-send-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-gradient);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.chat-send-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 10px var(--accent-glow);
}

.chat-send-btn:disabled {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  align-items: center;
  height: 20px;
}

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

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

/* ==========================================================================
   Hidden Presenter Panel (Ctrl+D)
   ========================================================================== */
.presenter-panel {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 320px;
  background: rgba(9, 12, 20, 0.95);
  border: 1px solid var(--accent-secondary);
  box-shadow: 0 16px 48px rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  z-index: 9999;
  display: none; /* Controlled via JS */
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.presenter-panel.open {
  display: flex;
}

.presenter-header {
  padding: 1rem;
  background: linear-gradient(to right, rgba(139, 92, 246, 0.2), transparent);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.presenter-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.presenter-title svg {
  color: #c084fc;
}

.presenter-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.presenter-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.presenter-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.presenter-section label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.presenter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.presenter-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.presenter-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--glass-border-hover);
}

.presenter-btn.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-secondary);
  color: #c084fc;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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

@keyframes typing-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.1), inset 0 0 10px rgba(245, 158, 11, 0.05); }
  50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.3), inset 0 0 15px rgba(245, 158, 11, 0.1); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 15px rgba(244, 63, 94, 0.15), inset 0 0 10px rgba(244, 63, 94, 0.05); }
  50% { box-shadow: 0 0 30px rgba(244, 63, 94, 0.4), inset 0 0 20px rgba(244, 63, 94, 0.2); }
}

@keyframes pulse-amber-small {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

@keyframes pulse-red-small {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.4; }
}

@keyframes pulse-amber-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 0 40px rgba(245, 158, 11, 0.5); }
}

@keyframes pulse-red-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(244, 63, 94, 0.2); }
  50% { box-shadow: 0 0 45px rgba(244, 63, 94, 0.65); }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  #app-container {
    flex-direction: column;
  }
  aside.sidebar {
    width: 100%;
    height: auto;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }
  .brand {
    margin-bottom: 1rem;
  }
  nav.nav-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  .sidebar-footer {
    display: none;
  }
  main.main-content {
    padding: 1.5rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .triage-details-grid {
    grid-template-columns: 1fr;
  }
}
