/* CSS Design System - Glassmorphic Industrial IoT Dashboard */

:root {
  /* Color Tokens - Dark Mode (Default) */
  --bg-primary-val: #060913;
  --bg-primary: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
  --bg-secondary: #020617;
  --glass-bg: rgba(15, 23, 42, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #00f2fe;
  --accent-cyan-glow: rgba(0, 242, 254, 0.4);
  --accent-blue: #3b82f6;
  --accent-red: #ff3366;
  --accent-red-glow: rgba(255, 51, 102, 0.5);
  --accent-orange: #ff9f43;
  --accent-orange-glow: rgba(255, 159, 67, 0.4);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.4);
  
  --shadow-color: rgba(0, 0, 0, 0.6);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --glow-shadow-cyan: 0 0 20px rgba(0, 242, 254, 0.35);
  --glow-shadow-red: 0 0 25px rgba(255, 51, 102, 0.45);
  
  --font-main: 'Inter', sans-serif;
  --font-display: 'Orbitron', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  
  --transition-speed: 0.3s;
}

/* Light Mode Override */
body.light-theme {
  --bg-primary-val: #f1f5f9;
  --bg-primary: radial-gradient(circle at center, #f8fafc 0%, #e2e8f0 100%);
  --bg-secondary: #cbd5e1;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-border-hover: rgba(15, 23, 42, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent-cyan: #0284c7;
  --accent-cyan-glow: rgba(2, 132, 199, 0.25);
  --accent-blue: #2563eb;
  --accent-red: #dc2626;
  --accent-red-glow: rgba(220, 38, 38, 0.3);
  --accent-orange: #d97706;
  --accent-orange-glow: rgba(217, 119, 6, 0.25);
  --accent-green: #059669;
  --accent-green-glow: rgba(5, 150, 105, 0.25);
  
  --shadow-color: rgba(148, 163, 184, 0.15);
  --card-shadow: 0 8px 32px 0 rgba(148, 163, 184, 0.2);
  --glow-shadow-cyan: 0 0 15px rgba(2, 132, 199, 0.2);
  --glow-shadow-red: 0 0 20px rgba(220, 38, 38, 0.25);
}

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

body {
  background: var(--bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* App Layout Container */
.app-container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-grow: 1;
}

/* Glassmorphism Styling Base */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 20px;
  transition: transform 0.2s ease, border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
  overflow: hidden;
}

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

/* Typography Utilities */
h1, h2, h3, h4, h5 {
  font-weight: 600;
}

.text-primary { color: var(--accent-cyan) !important; }
.text-secondary { color: var(--accent-blue) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-warning { color: var(--accent-orange) !important; }
.text-green { color: var(--accent-green) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-digital { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.m-b-10 { margin-bottom: 10px; }
.w-100 { width: 100%; }

/* Header Component */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 15px 25px;
}

.header-logo-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sensor-icon-wrapper {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.title-area h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}

.title-area .subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
}

.header-meta-section {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.meta-pill {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-display);
}

body.light-theme .meta-pill {
  background: rgba(255, 255, 255, 0.5);
}

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

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

.red-dot {
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
  animation: pulse-red-dot 1.5s infinite;
}

.yellow-dot {
  background-color: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
  animation: pulse-orange-dot 1.5s infinite;
}

.demo-tag {
  color: var(--accent-orange);
  animation: pulse-text-demo 2s infinite;
}

.meta-item {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  border-left: 1px solid var(--glass-border);
  padding-left: 12px;
}

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

.meta-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: var(--font-mono);
}

.header-actions {
  display: flex;
  gap: 8px;
  border-left: 1px solid var(--glass-border);
  padding-left: 12px;
}

/* Buttons and Controls Styling */
.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.light-theme .icon-btn {
  background: rgba(0, 0, 0, 0.03);
}

.icon-btn:hover {
  background: var(--accent-cyan);
  color: #020617;
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-shadow-cyan);
  transform: translateY(-2px);
}

.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  border: none;
  color: #020617;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.4);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-outline:hover {
  background: var(--accent-cyan);
  color: #020617;
  box-shadow: var(--glow-shadow-cyan);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
  border: none;
  color: white;
  font-weight: 600;
}

.btn-success:hover {
  box-shadow: 0 4px 15px var(--accent-green-glow);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red) 0%, #b91c1c 100%);
  border: none;
  color: white;
  font-weight: 600;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px var(--accent-red-glow);
  transform: translateY(-2px);
}

.btn-large {
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-small {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  flex-grow: 1;
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Responsive Columns configuration */
@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards Headers & Footers */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  margin-bottom: 15px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Main Distance Display Card */
.main-distance-card {
  flex-grow: 0;
  position: relative;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.distance-display-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.digital-readout-container {
  text-align: center;
  margin-bottom: 25px;
}

.distance-value-wrapper {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  position: relative;
}

.distance-num {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--accent-cyan);
  text-shadow: var(--glow-shadow-cyan);
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

/* Danger glowing red when object is <30cm */
.main-distance-card.card-danger .distance-num {
  color: var(--accent-red);
  text-shadow: var(--glow-shadow-red);
}

.main-distance-card.card-warning .distance-num {
  color: var(--accent-orange);
  text-shadow: 0 0 20px var(--accent-orange-glow);
}

.main-distance-card.card-safe .distance-num {
  color: var(--accent-green);
  text-shadow: 0 0 20px var(--accent-green-glow);
}

.distance-unit {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 8px;
  text-transform: uppercase;
}

.distance-subtext {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Progress bar style */
.progress-bar-container {
  width: 90%;
  max-width: 500px;
}

.progress-bar-track {
  background: rgba(0, 0, 0, 0.3);
  height: 12px;
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

body.light-theme .progress-bar-track {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 50px;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
  transition: width 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease;
}

.fill-green {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.fill-orange {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.fill-red {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
  animation: pulse-fill-red 1s infinite alternate;
}

.progress-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* Gauge and Radar Grid Row */
.gauge-radar-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .gauge-radar-row {
    grid-template-columns: 1fr;
  }
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.relative {
  position: relative;
}

/* Circular Gauge styling */
.svg-gauge-container {
  width: 180px;
  height: 180px;
  position: relative;
}

.gauge-svg {
  width: 100%;
  height: 100%;
}

.gauge-track-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 12;
  stroke-linecap: round;
}

body.light-theme .gauge-track-bg {
  stroke: rgba(0, 0, 0, 0.05);
}

.gauge-arc {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

.arc-danger {
  stroke: var(--accent-red);
}
.arc-warning {
  stroke: var(--accent-orange);
}
.arc-safe {
  stroke: var(--accent-green);
}

.gauge-fill-arc {
  fill: none;
  stroke: url(#gauge-gradient);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 377; /* circumference for r=80 (approx) in 240 deg */
  stroke-dashoffset: 377;
  transition: stroke-dashoffset 0.15s ease, stroke var(--transition-speed) ease;
}

.tick {
  stroke: var(--text-muted);
  stroke-width: 2;
}

.gauge-needle {
  fill: var(--accent-cyan);
  filter: drop-shadow(0 0 3px var(--accent-cyan-glow));
}

.gauge-needle-center {
  fill: var(--text-primary);
  stroke: var(--accent-cyan);
  stroke-width: 2;
}

.gauge-readout {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-readout span:first-child {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.gauge-readout .unit {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

/* Canvas Radar Visualizer */
#radar-canvas {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
}

body.light-theme #radar-canvas {
  background: rgba(255, 255, 255, 0.4);
}

.radar-dist-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--glass-border);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  pointer-events: none;
  letter-spacing: 0.5px;
}

body.light-theme .radar-dist-overlay {
  background: rgba(255, 255, 255, 0.8);
}

/* Split Controls and Stats section */
.split-controls-stats {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .split-controls-stats {
    grid-template-columns: 1fr;
  }
}

/* Control Panel input items */
.settings-group {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.settings-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.settings-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.input-wrapper label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

input[type="text"], select.custom-select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.2s ease;
}

body.light-theme input[type="text"], body.light-theme select.custom-select {
  background: rgba(255, 255, 255, 0.6);
}

input[type="text"]:focus, select.custom-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
}

select.custom-select {
  font-family: var(--font-main);
  cursor: pointer;
  width: 100%;
}

.mock-mode-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

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

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

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  transition: .3s;
  border-radius: 34px;
}

body.light-theme .slider-toggle {
  background-color: rgba(0, 0, 0, 0.08);
}

.switch-toggle input:checked + .slider-toggle {
  background-color: var(--accent-green);
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  transition: .3s;
  border-radius: 50%;
}

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

/* Range Slider Styling */
.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: background 0.3s;
}

body.light-theme .range-slider {
  background: rgba(0, 0, 0, 0.08);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 5px var(--accent-cyan-glow);
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.accent-slider::-webkit-slider-thumb {
  background: var(--accent-orange);
  box-shadow: 0 0 5px var(--accent-orange-glow);
}

.slider-val {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: bold;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: 100%;
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-box {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  padding: 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
}

body.light-theme .stat-box {
  background: rgba(255, 255, 255, 0.4);
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-val {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Telemetry Chart Card styling */
.chart-body {
  height: 250px;
  padding: 10px 15px;
}

.chart-container {
  width: 100%;
  height: 100%;
}

/* Event Log Table */
.log-card {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  align-items: center;
}

.gap-5 {
  gap: 5px;
}

.log-search-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 5px 8px;
  font-size: 0.75rem;
  outline: none;
  font-family: var(--font-main);
  max-width: 150px;
}

body.light-theme .log-search-input {
  background: rgba(255, 255, 255, 0.6);
}

.log-body {
  flex-grow: 1;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.table-container {
  width: 100%;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-align: left;
}

.log-table th {
  background: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 15px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
  text-transform: uppercase;
  font-family: var(--font-main);
  font-size: 0.65rem;
  letter-spacing: 0.5px;
}

body.light-theme .log-table th {
  background: rgba(0, 0, 0, 0.05);
}

.log-table td {
  padding: 8px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  vertical-align: middle;
}

body.light-theme .log-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.log-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

body.light-theme .log-table tr:hover td {
  background: rgba(0, 0, 0, 0.01);
}

.log-empty-row {
  text-align: center;
  color: var(--text-muted);
}

/* Event status colors inside logs */
.log-pill {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.pill-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.pill-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pill-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: flash-log-pill 1s infinite alternate;
}

.pill-system {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Fullscreen Warning Screen Overlay */
.danger-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 5, 5, 0.95);
  backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.4s ease;
}

.danger-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  max-width: 600px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.overlay-content i {
  font-size: 5rem;
  color: var(--accent-red);
}

.overlay-content h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--accent-red);
  letter-spacing: 1px;
}

.overlay-content h2 {
  font-size: 1.5rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.overlay-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

/* Footer style */
.dashboard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding: 10px 25px;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-center {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.status-indicator {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
}

.online-indicator {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
}

.offline-indicator {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
}

/* Dynamic Motion Border Pulse */
.app-container.motion-detected-pulse {
  animation: full-border-flash-red 1s infinite alternate;
}

/* Animations declarations */
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red-dot {
  0% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(255, 51, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); }
}

@keyframes pulse-orange-dot {
  0% { box-shadow: 0 0 0 0 rgba(255, 159, 67, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(255, 159, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 159, 67, 0); }
}

@keyframes pulse-text-demo {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

@keyframes pulse-logo {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.2); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes pulse-danger {
  0% { transform: scale(1); text-shadow: 0 0 10px rgba(255,51,102,0.3); }
  50% { transform: scale(1.1); text-shadow: 0 0 30px rgba(255,51,102,0.8); }
  100% { transform: scale(1); text-shadow: 0 0 10px rgba(255,51,102,0.3); }
}

@keyframes pulse-fill-red {
  0% { opacity: 0.8; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
  100% { opacity: 1; box-shadow: 0 0 16px rgba(239, 68, 68, 0.7); }
}

@keyframes flash-log-pill {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

@keyframes full-border-flash-red {
  0% {
    box-shadow: inset 0 0 0 0px rgba(255, 51, 102, 0);
    border-color: var(--glass-border);
  }
  100% {
    box-shadow: inset 0 0 25px 3px rgba(255, 51, 102, 0.45), 0 0 15px rgba(255, 51, 102, 0.25);
    border-color: rgba(255, 51, 102, 0.4);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  border: 1px solid var(--glass-border);
}

body.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Time Filter and Flex Button Styling */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.chart-time-filter {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-btn.active {
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  color: #0d1527;
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.25);
}

.filter-btn:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.filter-btn .pulse-dot {
  width: 5px;
  height: 5px;
  background-color: #0d1527;
  box-shadow: 0 0 6px #0d1527;
}
