/**
 * MineGuard AI — Autonomous Background Telemetry Heartbeat & Live Radar Sweep Stylesheet
 * Mobile-first, dark industrial Apple HIG theme, high-tech rotating radar beam,
 * glowing sensor telemetry sweeps, and responsive header integration.
 */

.heartbeat-widget {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid var(--separator);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  height: 34px;
  position: relative;
  transition: all var(--transition-fast);
}

.heartbeat-widget:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 229, 255, 0.3);
}

/* ─── 1. MINI HIGH-TECH RADAR DISK ────────────────────────────────────────── */
.radar-disk-container {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #040810;
  border: 1px solid rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.15), inset 0 0 6px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

/* Concentric Radar Reticle Rings */
.radar-disk-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 0.5px dashed rgba(0, 229, 255, 0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Rotating Sweep Beam */
.radar-sweep-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 280deg,
    rgba(0, 229, 255, 0.2) 330deg,
    rgba(0, 229, 255, 0.85) 360deg
  );
  animation: radarRotate 4s infinite linear;
  pointer-events: none;
}

/* Center Radar Blip Point */
.radar-center-blip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3.5px;
  height: 3.5px;
  background: var(--accent-cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px var(--accent-cyan);
}

/* Sweeping State (Fast Active Rotation & Emerald Glow) */
.heartbeat-widget.sweeping .radar-disk-container {
  border-color: var(--hazard-safe);
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.4);
}

.heartbeat-widget.sweeping .radar-sweep-beam {
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 270deg,
    rgba(48, 209, 88, 0.3) 320deg,
    rgba(48, 209, 88, 0.95) 360deg
  );
  animation: radarRotate 0.85s infinite linear;
}

.heartbeat-widget.sweeping .radar-center-blip {
  background: var(--hazard-safe);
  box-shadow: 0 0 6px var(--hazard-safe);
}

/* Critical Warning State (Pulsing Crimson Radar) */
.heartbeat-widget.threat-critical .radar-disk-container {
  border-color: var(--hazard-critical);
  box-shadow: 0 0 12px rgba(255, 69, 58, 0.5);
  animation: strobeRed 1s infinite alternate;
}

.heartbeat-widget.threat-critical .radar-sweep-beam {
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 270deg,
    rgba(255, 69, 58, 0.3) 320deg,
    rgba(255, 69, 58, 0.95) 360deg
  );
  animation: radarRotate 1.2s infinite linear;
}

/* ─── 2. COUNTDOWN & STATUS LABELS ────────────────────────────────────────── */
.heartbeat-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 58px;
}

.heartbeat-status {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.heartbeat-status.paused {
  color: var(--label-tertiary);
}

.heartbeat-timer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

/* ─── 3. INTERVAL PICKER & ACTIONS ────────────────────────────────────────── */
.heartbeat-interval-select {
  background: transparent;
  color: var(--label-secondary);
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.2rem;
  outline: none;
  height: 100%;
  border-left: 0.5px solid var(--separator);
  transition: color var(--transition-fast);
}

.heartbeat-interval-select:hover,
.heartbeat-interval-select:focus {
  color: #ffffff;
}

.heartbeat-interval-select option {
  background: #111a2e;
  color: #ffffff;
}

.heartbeat-btn {
  background: transparent;
  border: none;
  color: var(--label-secondary);
  cursor: pointer;
  padding: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.heartbeat-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.heartbeat-btn.active {
  color: var(--accent-cyan);
}

/* Strobe Alert Animation for Header Threat Pill */
@keyframes strobeRed {
  0% { box-shadow: 0 0 4px rgba(255, 69, 58, 0.4); }
  100% { box-shadow: 0 0 16px rgba(255, 69, 58, 0.95); }
}

@keyframes radarRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ─── 4. RESPONSIVENESS (MOBILE FIRST) ─────────────────────────────────────── */
/* Mobile (<640px): Compact view hide interval dropdown and textual status */
@media (max-width: 640px) {
  .heartbeat-status {
    display: none;
  }
  .heartbeat-info {
    min-width: auto;
  }
  .heartbeat-interval-select {
    display: none;
  }
}

/* Tablet & Desktop (>=641px): Full high-tech monitoring suite */
@media (min-width: 641px) {
  .heartbeat-status {
    display: flex;
  }
  .heartbeat-interval-select {
    display: block;
  }
}
