/* SENSE Sensors — CSS personalitzat */

:root {
  --sense-primary: #0d6efd;
  --sense-success: #198754;
  --sense-danger: #dc3545;
  --sense-warning: #ffc107;
  --sense-bg: #121212;
  --sense-card: #1e1e1e;
  --sense-border: #2d2d2d;
}

body {
  background-color: var(--sense-bg);
  font-size: 0.9rem;
}

/* Cards */
.card {
  background-color: var(--sense-card);
  border-color: var(--sense-border);
}
.card-header {
  background-color: rgba(255,255,255,0.04);
  border-bottom-color: var(--sense-border);
  font-weight: 500;
  font-size: 0.875rem;
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.bg-success { box-shadow: 0 0 6px #198754; }
.status-dot.bg-danger  { box-shadow: 0 0 6px #dc3545; }

/* Taules */
.table-dark {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(255,255,255,0.04);
}
.table th {
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #adb5bd;
}
/* La capçalera de qualsevol taula combina amb el fons fosc (mai blanca) */
.table thead th,
.table thead td {
  background-color: transparent !important;
}

/* Navbar */
.navbar-brand {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

/* Badges petits */
.btn-xs {
  padding: 0.1rem 0.35rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sense-bg); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* Mapa Leaflet */
.leaflet-container {
  background: #1a1a2e;
  font-family: inherit;
}
.leaflet-popup-content-wrapper {
  background: #1e1e1e;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 8px;
}
.leaflet-popup-tip { background: #1e1e1e; }

/* Gràfiques */
canvas { max-width: 100%; }

/* Alertes per severitat */
.alert-critical { border-left: 4px solid #dc3545; }
.alert-high     { border-left: 4px solid #fd7e14; }
.alert-medium   { border-left: 4px solid #ffc107; }
.alert-low      { border-left: 4px solid #6c757d; }

/* Protocol badges */
.badge-lorawan    { background-color: #6f42c1; }
.badge-meshtastic { background-color: #20c997; }
.badge-wifi       { background-color: #0d6efd; }
.badge-serial     { background-color: #fd7e14; }
.badge-gpio       { background-color: #198754; }

/* Toast */
.toast { min-width: 280px; }

/* Sidebar mapa */
#sensorSidebarList .list-group-item:hover {
  background-color: rgba(255,255,255,0.06) !important;
}

/* Animació pols per sensors online */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(25, 135, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}
.status-dot.bg-success.pulse { animation: pulse 2s infinite; }

/* Responsive */
@media (max-width: 768px) {
  .navbar-brand .badge { display: none; }
  main.container-fluid { padding: 0.5rem; }
}
