/* css/header.css */
/* ===== HUD HEADER BASE ===== */
.hud-header {
  position: relative;
  width: 100% !important;
  flex-shrink: 0 !important;
  background: rgba(2, 5, 12, 0.95);
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  box-sizing: border-box !important;
  height: 50px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: max(20px, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(20px, env(safe-area-inset-right, 0px)) !important;
  display: flex;
  justify-content: space-between;
  align-items: center !important;
  z-index: 100;
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
  height: 50px;
}

.header-left {
  gap: 12px;
}

.header-center {
  flex: 1;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  min-width: 0;
}

.header-right {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: 16px;
}

.hud-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--hud-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--hud-green);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 102, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 255, 102, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 102, 0); }
}

.hud-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--hud-cyan);
  text-shadow: var(--hud-cyan-glow);
  letter-spacing: 1px;
}

/* ===== STATUS STAT BOXES ===== */
.hud-stat-box {
  min-width: 0;
  display: grid;
  grid-template-columns: 16px auto;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid rgba(0, 243, 255, 0.12);
  border-radius: 5px;
  background: rgba(0, 102, 255, 0.07);
  line-height: 1.05;
  white-space: nowrap;
}

.hud-stat-box i {
  grid-row: 1 / span 2;
  font-size: 0.75rem;
  text-align: center;
}

.hud-stat-label {
  color: var(--text-muted);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.hud-stat-box > span:last-child {
  font-size: 0.76rem;
}

.hud-stat-box:hover {
  border-color: rgba(0, 243, 255, 0.35);
  background: rgba(0, 243, 255, 0.08);
}

.camera-capture-wrap,
.network-status-wrap {
  position: relative;
}

.network-details {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: 220px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 243, 255, 0.28);
  border-radius: 6px;
  background: rgba(3, 10, 25, 0.98);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), var(--hud-cyan-glow);
  z-index: 120;
  transform: translateX(-50%);
}

.network-details[hidden] {
  display: none;
}

.network-details-list {
  display: grid;
  gap: 8px;
  font: 0.78rem var(--font-mono);
}

.network-details-list div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  min-width: 0;
}

.network-details-list dt {
  color: var(--text-muted);
}

.network-details-list dd {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== LOCATION & WEATHER DROPDOWNS ===== */
#status-location {
  color: inherit;
  font: inherit;
  line-height: 1.05;
  cursor: pointer;
  text-align: left;
}

#status-location[aria-expanded="true"] {
  border-color: var(--hud-cyan);
  box-shadow: var(--hud-cyan-glow);
}

#location-name {
  display: inline-block;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.location-details {
  width: 220px;
}

#status-weather-btn {
  color: inherit;
  font: inherit;
  line-height: 1.05;
  cursor: pointer;
  text-align: left;
}

#status-weather-btn[aria-expanded="true"] {
  border-color: var(--hud-cyan);
  box-shadow: var(--hud-cyan-glow);
}

.weather-details {
  width: 280px;
}

.weather-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(0, 243, 255, 0.15);
}

.weather-header-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hud-cyan);
}

.weather-header-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.weather-details-list div {
  grid-template-columns: 80px 1fr;
}

.weather-forecast-title {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 243, 255, 0.15);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.weather-hourly-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.weather-hourly-item {
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid rgba(0, 243, 255, 0.12);
  border-radius: 4px;
  padding: 5px 3px;
  text-align: center;
  font-size: 0.7rem;
}

.weather-hourly-time {
  color: var(--text-muted);
  font-size: 0.65rem;
  margin-bottom: 2px;
}

.weather-hourly-icon {
  font-size: 0.85rem;
  margin: 2px 0;
}

.weather-hourly-temp {
  color: var(--text-primary);
  font-weight: 600;
}

.weather-hourly-pop {
  color: var(--hud-cyan);
  font-size: 0.62rem;
}

.weather-hourly-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 6px 0;
}

/* ===== SCHEDULE MONITOR PANEL ===== */
#status-schedule-btn {
  color: inherit;
  font: inherit;
  line-height: 1.05;
  cursor: pointer;
  text-align: left;
}

#status-schedule-btn[aria-expanded="true"] {
  border-color: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

#status-schedule {
  display: inline-block;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.schedule-details {
  width: 320px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.schedule-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.schedule-header-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 0.5px;
}

.schedule-header-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.schedule-refresh-btn {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.schedule-refresh-btn:hover {
  color: #c084fc;
  border-color: #a855f7;
}

.schedule-live-card {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-left: 4px solid #a855f7;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.12);
}

.schedule-live-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.schedule-live-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: #a855f7;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.schedule-live-time {
  font-size: 0.72rem;
  color: #d8b4fe;
  font-weight: 600;
}

.schedule-live-task {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f3e8ff;
  line-height: 1.3;
  margin: 4px 0 6px 0;
  word-break: break-all;
}

.schedule-progress-wrap {
  margin-top: 6px;
}

.schedule-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: #d8b4fe;
  font-weight: 600;
  margin-bottom: 3px;
}

.schedule-progress-track {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.schedule-progress-fill {
  background: linear-gradient(90deg, #a855f7, #00f3ff);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease-out;
}

.schedule-list-header {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-left: 2px;
}

.schedule-timeline-list {
  flex: 1;
  overflow-y: auto;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
}

.schedule-timeline-item {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid rgba(0, 243, 255, 0.4);
  border-radius: 4px;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.schedule-timeline-item.is-current {
  border-left-color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  box-shadow: inset 0 0 12px rgba(168, 85, 247, 0.1);
}

.schedule-timeline-item.is-current .schedule-item-time {
  color: #c084fc;
  font-weight: 700;
}

.schedule-timeline-item.is-current .schedule-item-task {
  color: #f3e8ff;
  font-weight: 600;
}

.schedule-timeline-item.is-off {
  opacity: 0.45;
  border-left-color: #64748b;
  background: rgba(15, 23, 42, 0.4);
}

.schedule-item-time {
  width: 52px;
  padding: 6px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--hud-cyan);
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}

.schedule-item-task {
  padding: 6px 8px;
  color: var(--text-primary);
  flex: 1;
  display: flex;
  align-items: center;
  line-height: 1.25;
  word-break: break-all;
}

.schedule-timeline-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 16px 0;
}

/* ===== HEADER LOFI AUDIO PLAYER ===== */
.hud-lofi-player {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(3, 10, 25, 0.8);
  border: 1px solid var(--hud-panel-border);
  padding: 3px 8px;
  border-radius: 4px;
}

.hud-lofi-player .hud-icon-btn {
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
}

.lofi-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.hud-lofi-player.playing .lofi-title {
  color: var(--hud-cyan);
  text-shadow: var(--hud-cyan-glow);
}

.hud-lofi-player.playing #lofi-play-btn {
  color: var(--hud-cyan);
  border-color: var(--hud-cyan);
  box-shadow: var(--hud-cyan-glow);
}

/* ===== HEADER MEDIA QUERIES ===== */
@media (max-width: 900px) {
  .hud-stat-box {
    padding-left: 7px;
    padding-right: 7px;
    display: flex;
    gap: 6px;
  }

  .hud-stat-label {
    display: none;
  }
}

@media (max-width: 680px) {
  .hud-logo {
    display: none;
  }

  .header-center {
    justify-content: flex-start;
  }

  .header-right {
    margin-left: 8px;
  }
}