/* ════════════════════════════════════════════════════════════════
   MI TURNO · layout/header.css
   iOS 26 Liquid Glass header flotante
   ════════════════════════════════════════════════════════════════ */

.hdr {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 20px);
  max-width: 460px;
  margin-top: calc(var(--sat) + 12px);
  padding: var(--sz-1) var(--sz-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 100;
  /* Glassmorphism iOS 18 style - Twin of the bottom tab bar */
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.4s var(--ios-ease);
  will-change: transform, padding, margin-top;
}

.hdr--compact {
  margin-top: calc(var(--sat) + 6px);
  padding: 6px 14px;
  transform: translateX(-50%) scale(0.96);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme='dark'] .hdr {
  background: var(--glass-heavy);
  border-color: var(--glass-border);
  box-shadow:
    inset 0 1.5px 0 var(--spec-top),
    inset 0 -0.5px 0 var(--spec-bot),
    0 8px 48px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(125, 168, 255, 0.08);
}

[data-theme='dark'] .hdr--compact {
  background: var(--glass-mid);
}

.hdr-l {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.hdr-led {
  width: 8px;
  height: 8px;
  background: #FF9500; /* fallback */
  border-radius: 50%;
  animation: ledPulse 2s ease-in-out infinite;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(255, 149, 0, 0.4);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
/* Conectado a Supabase / internet ok */
.hdr-led.on {
  background: #34C759; /* verde sistema iOS */
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.55);
}
/* Sin conexión */
.hdr-led.off {
  background: #FF3B30; /* rojo sistema iOS */
  box-shadow: 0 0 6px rgba(255, 59, 48, 0.55);
}

@keyframes ledPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

.hdr-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hdr-c {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hdr-brand {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.hdr-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.hdr-date {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.hdr-clock {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hdr-live {
  display: none;
}

.hdr-live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

.hdr-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  opacity: 0.8;
}

.hdr-r {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.hdr-clock {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow:
      0 0 24px var(--accent-glow),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
  50% {
    box-shadow:
      0 0 44px var(--accent-glow),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
}
