:root {
  /* Colors & Palette */
  --bg-dark: #07090e;
  --glass-bg: rgba(13, 20, 35, 0.55);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #f0f4f9;
  --text-muted: #8da4be;
  
  /* Neon Accents */
  --accent-blue: #00d9ff;
  --accent-orange: #ff9800;
  --accent-red: #ff3860;
  --accent-green: #23d160;
  
  /* Default Sky Theme */
  --sky-gradient: linear-gradient(135deg, #091220 0%, #05080f 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Dynamic Sky Background & Themes */
.sky-background {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--sky-gradient);
  z-index: -2;
  transition: background 3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Dynamic Sky Theme Gradients */
.sky-sunrise {
  --sky-gradient: linear-gradient(135deg, #090e1a 0%, #311c47 40%, #7c2d12 70%, #b45309 100%);
}

.sky-day {
  --sky-gradient: linear-gradient(135deg, #07365d 0%, #0369a1 40%, #0284c7 80%, #0c4a6e 100%);
}

.sky-sunset {
  --sky-gradient: linear-gradient(135deg, #050914 0%, #1e1b4b 35%, #581c87 70%, #db2777 100%);
}

.sky-night {
  --sky-gradient: linear-gradient(135deg, #010204 0%, #05080f 65%, #010203 100%);
}

.sky-rain {
  --sky-gradient: linear-gradient(135deg, #0d1527 0%, #111827 60%, #030712 100%);
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0;
  transition: transform 3s cubic-bezier(0.2, 0.8, 0.2, 1), 
              opacity 3s ease, 
              background 3s ease;
}

/* Sun Orb Glow (Daytime/Sunset/Sunrise Accents) */
.orb-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  left: 20%;
}

.sky-sunrise .orb-1 {
  background: radial-gradient(circle, rgba(234,88,12,0.4) 0%, rgba(234,88,12,0) 70%);
  opacity: 0.7;
}

.sky-day .orb-1 {
  background: radial-gradient(circle, rgba(56,189,248,0.35) 0%, rgba(56,189,248,0) 70%);
  opacity: 0.6;
}

.sky-sunset .orb-1 {
  background: radial-gradient(circle, rgba(219,39,119,0.4) 0%, rgba(219,39,119,0) 70%);
  opacity: 0.7;
}

/* Moon Orb Glow (Nighttime Accent) */
.orb-2 {
  width: 400px;
  height: 400px;
  bottom: 10%;
  right: 15%;
}

.sky-night .orb-2 {
  background: radial-gradient(circle, rgba(0,217,255,0.2) 0%, rgba(0,114,255,0) 70%);
  opacity: 0.45;
}

/* Rain Particle Overlay */
.rain-canvas {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 1.5s ease;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

/* Main Wrapper Layout */
.dashboard-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* Header & Metadata */
.dashboard-header {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
}

.time-widget {
  display: flex;
  flex-direction: column;
}

.clock-time {
  font-size: 34px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-blue);
  letter-spacing: -1px;
}

.clock-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Solar Arc Widget */
.solar-arc-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.solar-svg {
  width: 100%;
  max-height: 80px;
}

.solar-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 5px;
}

.sun-status {
  color: var(--accent-orange);
  font-weight: 800;
}

/* Connection Status Badge */
.connection-status {
  text-align: right;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 99px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-red);
}

.pulse-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: onlinePulse 2s infinite;
}

@keyframes onlinePulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.lbl-status {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.lbl-status.online {
  color: var(--text-primary);
}

.sync-status {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 6px;
}

/* Tabs Navigation */
.navigation-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.nav-tab {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-muted);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.2s ease;
}

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

.nav-tab.active {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(0, 217, 255, 0.05);
}

/* Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: tabFadeIn 0.3s ease-out;
}

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

/* Standard Panels Styles */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Weather Grid & Hero display */
.weather-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}

.weather-card-hero {
  background: linear-gradient(135deg, rgba(16, 27, 49, 0.7) 0%, rgba(8, 14, 25, 0.7) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 26px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.node-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--accent-blue);
}

.condition-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-orange);
  letter-spacing: 0.5px;
}

.hero-temp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
}

.hero-temp {
  font-size: 68px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}

.hero-temp .unit {
  font-size: 26px;
  font-weight: 500;
  color: var(--text-muted);
  vertical-align: super;
  margin-left: 2px;
}

.hero-icon {
  font-size: 60px;
  filter: drop-shadow(0 0 15px rgba(255,162,0,0.3));
  animation: bounce 4s ease-in-out infinite;
}

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

.hero-meta {
  display: flex;
  justify-content: space-around;
  background: rgba(0,0,0,0.15);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.meta-item .lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.meta-item .val {
  font-size: 18px;
  font-weight: 700;
  margin-top: 3px;
  color: var(--text-primary);
}

.meta-divider {
  width: 1px;
  background: rgba(255,255,255,0.06);
}

/* Liquid Rain Gauge bar */
.rain-gauge-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gauge-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gauge-label span:last-child {
  color: var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
}

.liquid-bar-outer {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.25);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.03);
}

.liquid-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.1, 0.8, 0.1, 1);
  box-shadow: 0 0 10px rgba(0,198,255,0.4);
}

/* Auxiliary Grid */
.sub-grid-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aux-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 16px 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: border-color 0.2s, background-color 0.2s;
}

.aux-card:hover {
  border-color: var(--glass-border-hover);
  background: rgba(13, 20, 35, 0.65);
}

.card-icon {
  font-size: 28px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.card-info .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.card-info .value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

.card-info .desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* TAB 2: Microgrid visual schematic diagram */
.microgrid-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 26px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.panel-header {
  margin-bottom: 25px;
}

.panel-header h3 {
  font-size: 20px;
  font-weight: 800;
}

.panel-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Schematic Node layout */
.diagram-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 10px;
}

.node-box {
  width: 170px;
  background: rgba(6, 11, 20, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, border-color 0.2s;
  z-index: 10;
}

.node-box:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-hover);
}

.node-box.main-hub {
  width: 180px;
  background: linear-gradient(180deg, rgba(16,27,49,0.8), rgba(9,15,26,0.8));
  border-color: rgba(57, 217, 138, 0.2);
  box-shadow: 0 0 20px rgba(57, 217, 138, 0.04);
}

.node-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.node-box .lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.node-box .val {
  font-size: 16px;
  font-weight: 800;
  margin-top: 4px;
  color: var(--text-primary);
}

.node-box .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Pipelines flow current animations */
.flow-pipe {
  flex-grow: 1;
  height: 4px;
  background: rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.pipe-line {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.04);
}

.flow-particles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  background-size: 200% 100%;
  animation: flowParticle 1.5s linear infinite;
  animation-play-state: paused; /* Controlled via JS */
}

@keyframes flowParticle {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Vertical bypass layouts for wall power charging source */
.bypass-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -30px;
  position: relative;
  z-index: 5;
}

.flow-pipe.vertical {
  width: 4px;
  height: 50px;
  flex-grow: 0;
}

.flow-particles.vertical {
  background: linear-gradient(180deg, transparent, var(--accent-green), transparent);
  background-size: 100% 200%;
  animation: flowParticleVert 1.5s linear infinite;
  animation-play-state: paused;
}

@keyframes flowParticleVert {
  0% { background-position: 0 200%; }
  100% { background-position: 0 -200%; }
}

.node-box.bypass-node {
  border-color: rgba(0, 217, 255, 0.2);
}

/* TAB 3: History & queries controls */
.history-controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: end;
  background: rgba(0,0,0,0.15);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.03);
  margin-bottom: 20px;
}

.history-controls label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

.history-controls select,
.history-controls input,
.history-controls .btn {
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
  color: var(--text-primary);
  min-height: 38px;
  padding: 0 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  transition: border-color 0.2s;
}

.history-controls select:focus,
.history-controls input:focus {
  border-color: var(--accent-blue);
  outline: none;
}

.history-controls .btn {
  cursor: pointer;
  background: var(--accent-blue);
  color: var(--bg-dark);
  font-weight: 800;
  text-transform: uppercase;
  border: none;
  transition: transform 0.1s, box-shadow 0.2s;
}

.history-controls .btn:hover {
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.history-controls .btn:active {
  transform: scale(0.98);
}

.history-chart {
  height: 480px;
  width: 100%;
  margin-top: 10px;
}

/* TAB 4: Console Log */
.logs-console {
  font-family: 'JetBrains Mono', monospace;
  background: #030508;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  min-height: 450px;
  max-height: 550px;
  overflow-y: auto;
  padding: 16px;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
  color: #a4c1e2;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.6);
}

/* Floating Alerts popups */
.alerts-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}

.floating-alert {
  background: rgba(255, 56, 96, 0.15);
  border: 1px solid rgba(255, 56, 96, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 10px;
  padding: 12px 16px;
  color: #ffcbd4;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  animation: alertPopIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes alertPopIn {
  from { opacity: 0; transform: translateX(50px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.floating-alert.rain-alert {
  background: rgba(0, 217, 255, 0.12);
  border-color: rgba(0, 217, 255, 0.25);
  color: #cbebff;
}

/* Responsiveness adjustments */
@media (max-width: 900px) {
  .dashboard-header {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .solar-arc-widget {
    margin: 15px auto;
  }
  .connection-status {
    text-align: center;
  }
  .weather-grid {
    grid-template-columns: 1fr;
  }
  .diagram-grid {
    flex-direction: column;
    gap: 20px;
  }
  .flow-pipe {
    width: 4px;
    height: 40px;
    flex-grow: 0;
  }
  .flow-particles {
    background: linear-gradient(180deg, transparent, var(--accent-blue), transparent);
    background-size: 100% 200%;
    animation: flowParticleVert 1.5s linear infinite;
  }
  .history-controls {
    grid-template-columns: 1fr;
  }
}

/* Multi-Metric Selection Pills */
.metrics-selector-container {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: 12px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.selector-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.metrics-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-pill-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.metric-pill-label:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.metric-pill-label input[type="checkbox"] {
  display: none;
}

.metric-pill-label.active {
  background: rgba(0, 217, 255, 0.1);
  border-color: rgba(0, 217, 255, 0.35);
  color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.06);
}

/* AI Analyst Tab Layout */
.ai-analyst-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  min-height: 520px;
}

.ai-config-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.config-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.config-card h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.config-card .desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.input-group label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input-group input,
.input-group select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.2s;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--accent-blue);
  outline: none;
}

.btn-sm {
  min-height: 32px !important;
  font-size: 11px !important;
  padding: 0 12px;
}

.key-status-text {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  display: block;
  margin-top: 8px;
  text-align: center;
  color: var(--accent-red);
}

.key-status-text.configured {
  color: var(--accent-green);
}

/* Chat interface */
.ai-chat-interface {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--glass-border);
}

.chat-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.model-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--accent-blue);
}

.chat-messages-window {
  flex-grow: 1;
  max-height: 340px;
  min-height: 280px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  align-self: flex-start;
}

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

.chat-message .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: var(--bg-dark);
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-message.user .avatar {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.msg-bubble {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.5;
}

.chat-message.bot .msg-bubble {
  background: rgba(0, 217, 255, 0.03);
  border-color: rgba(0, 217, 255, 0.08);
}

.msg-bubble p {
  margin-bottom: 8px;
}

.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0,0,0,0.3);
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--accent-blue);
}

.msg-bubble ul, .msg-bubble ol {
  margin-left: 18px;
  margin-bottom: 8px;
}

.msg-bubble strong {
  color: var(--text-primary);
}

/* Quick command suggestion chips */
.quick-commands-container {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(0, 0, 0, 0.05);
}

.quick-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.quick-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

/* Chat Input Row */
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--glass-border);
}

.chat-input-row input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  height: 42px;
  padding: 0 14px;
  font-size: 12px;
}

.chat-input-row input:focus {
  border-color: var(--accent-blue);
  outline: none;
}

/* Loading animations */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-blue);
  border-radius: 50%;
  animation: typingBounce 1s infinite alternate;
}

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

@keyframes typingBounce {
  from { transform: translateY(0); opacity: 0.4; }
  to { transform: translateY(-5px); opacity: 1; }
}

@media (max-width: 768px) {
  .ai-analyst-container {
    grid-template-columns: 1fr;
  }
}

