/* =========================================================================
 * Tanda Kamera — css/base.css
 * Variabel tema, reset, kerangka aplikasi, dan header.
 * ========================================================================= */

:root {
  --brand: #f59e0b;
  --brand-soft: #fbbf24;
  --aqua: #22d3ee;

  /* Variabel layout overlay — nilainya diisi oleh js/layout.js */
  --ovaccent: 4px;
  --ovf: 14px;

  --radius: 18px;
  --line: rgba(148, 163, 184, 0.14);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1100px 700px at 10% -12%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(900px 620px at 100% 0%, rgba(245, 158, 11, 0.16), transparent 55%),
    #050912;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

/* ------------------------------- Kerangka ------------------------------ */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* -------------------------------- Header ------------------------------- */

.app-header {
  flex: 0 0 auto;
  padding: 10px 14px 9px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(5, 9, 18, 0.35));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 17px;
  color: #0b1220;
  background: linear-gradient(150deg, var(--brand-soft), var(--brand));
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.brand-text { min-width: 0; }
.brand-text h1 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.brand-text p {
  margin: 0;
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tombol orientasi di header */
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.chip-btn:hover { background: rgba(148, 163, 184, 0.24); }
.chip-btn:active { transform: scale(0.96); }
.chip-btn.is-active {
  color: var(--brand-soft);
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}

/* --------------------- Baris status terpadu (bukan pil) ---------------- */

/*
 * Sebelumnya status tampil sebagai deretan pil berwarna yang ramai.
 * Sekarang menjadi SATU baris teks kecil dengan titik indikator: bersih dan
 * tetap informatif.
 */
.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 11px;
  color: #94a3b8;
  min-width: 0;
}

.status-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  transition: background 0.3s, box-shadow 0.3s;
}

.status-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* Warna titik mengikuti tingkat kepentingan kanal yang paling mendesak. */
.status-line[data-kind="idle"] .status-dot { background: #64748b; }
.status-line[data-kind="load"] .status-dot { background: var(--aqua); animation: pulse-dot 1.4s ease-in-out infinite; }
.status-line[data-kind="ok"]   .status-dot { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
.status-line[data-kind="warn"] .status-dot { background: var(--brand); box-shadow: 0 0 8px rgba(245, 158, 11, 0.6); }
.status-line[data-kind="err"]  .status-dot { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }

.status-line[data-kind="warn"] .status-text { color: #fde68a; }
.status-line[data-kind="err"]  .status-text { color: #fca5a5; }
.status-line[data-kind="ok"]   .status-text { color: #a7f3d0; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
