/* Lighting control tile: master switch, a live luminous hero that takes on the
   active colour, quick colour swatches, ambient-effect chips, and a per-device
   mode list. Rendered into .lighting-widget-mount by lighting-widget.js. Shares
   the glass / accent language of the Wave Link and OBS tiles; the hero is the one
   place it spends any boldness. All classes are namespaced .lgt-* so they never
   collide with the full-page LightingPage.css. */
.lighting-panel { display: flex; }
.lighting-widget-mount { width: 100%; height: 100%; display: flex; min-height: 0; border-radius: inherit; }

.lgt-wrap {
  position: relative; box-sizing: border-box;
  width: 100%; height: 100%; min-height: 0;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
  border-radius: inherit; overflow: hidden;
}

/* Header: title + master power switch */
.lgt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; }
.lgt-logo { font-size: 0.92rem; font-weight: 900; letter-spacing: 0.03em; color: var(--text, #e7e9ee); }

.lgt-power {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; padding: 2px;
  border: 0; background: transparent; color: var(--text-dim, #8b91a1);
  font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
}
.lgt-power-track {
  position: relative; width: 34px; height: 19px; border-radius: 999px; flex: 0 0 auto;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.lgt-power-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: transform 0.18s ease;
}
.lgt-power.is-on { color: var(--text, #e7e9ee); }
.lgt-power.is-on .lgt-power-track { background: rgba(var(--accent-rgb, 43,108,255), 0.9); border-color: transparent; }
.lgt-power.is-on .lgt-power-track::after { transform: translateX(15px); }

.lgt-empty { font-size: 0.82rem; opacity: 0.5; font-weight: 600; text-align: center; padding: 22px 12px; }

.lgt-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; }

/* ── Signature: the live luminous hero ─────────────────────────────────────
   A lit panel that takes the active colour (--lgt-rgb, set per-tile in JS; falls
   back to the dashboard accent). It breathes only while a dynamic effect runs —
   an infinite keyframe that ambient-idle.js auto-freezes when nobody's looking. */
.lgt-hero {
  --c: var(--lgt-rgb, var(--accent-rgb, 43,108,255));
  position: relative; flex: 1 1 40%; min-height: 68px; max-height: 140px;
  border-radius: 16px; overflow: hidden;
  display: flex; align-items: flex-end; padding: 12px 14px;
  border: 1px solid rgba(var(--c), 0.35);
  background:
    radial-gradient(120% 100% at 50% 128%, rgba(var(--c), 0.55), transparent 70%),
    radial-gradient(90% 80% at 50% -20%, rgba(var(--c), 0.26), transparent 62%),
    linear-gradient(180deg, rgba(10,12,16,0.55), rgba(8,9,12,0.85));
  box-shadow: inset 0 0 42px rgba(var(--c), 0.22), 0 6px 22px rgba(var(--c), 0.16);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.lgt-hero-glow {
  position: absolute; inset: -34% 18% auto 18%; height: 74%; pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(var(--c), 0.8), transparent 70%);
  filter: blur(26px); opacity: 0.75;
}
.lgt-hero-fx {
  position: relative; font-size: 12px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: capitalize; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,0.55);
}
.lgt-hero.is-off { filter: grayscale(0.9) brightness(0.6); opacity: 0.85; }
.lgt-hero.is-dynamic .lgt-hero-glow { animation: lgt-breathe 3.4s ease-in-out infinite; will-change: opacity, transform; }
/* Paused while a frosted overlay covers the dashboard (see backgroundfx.css overlay-frozen). */
body.overlay-frozen .lgt-hero.is-dynamic .lgt-hero-glow { animation-play-state: paused; }
@keyframes lgt-breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50%      { opacity: 1;    transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .lgt-hero.is-dynamic .lgt-hero-glow { animation: none; }
}

/* Colour row: quick swatches + native picker + auto reset */
.lgt-colors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.lgt-sw {
  width: 22px; height: 22px; border-radius: 7px; cursor: pointer; padding: 0;
  background: var(--sw); border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3); transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.lgt-sw:hover { transform: translateY(-1px); }
.lgt-sw:active { transform: translateY(0); }
.lgt-sw.is-active { box-shadow: 0 0 0 2px var(--panel, #12151b), 0 0 0 4px var(--sw); }
.lgt-pick {
  width: 26px; height: 26px; padding: 0; cursor: pointer; background: none;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 7px;
}
.lgt-pick::-webkit-color-swatch-wrapper { padding: 2px; }
.lgt-pick::-webkit-color-swatch { border: none; border-radius: 5px; }
.lgt-pick::-moz-color-swatch { border: none; border-radius: 5px; }
.lgt-auto {
  margin-left: auto; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  font-size: 11px; font-weight: 700; color: var(--text-dim, #b9bfcc);
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03);
  transition: background 0.15s ease, color 0.15s ease;
}
.lgt-auto:hover { background: rgba(255,255,255,0.08); color: var(--text, #e7e9ee); }
.lgt-auto:active { transform: translateY(1px); }

/* Ambient-effect chips */
.lgt-fx { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
.lgt-chip {
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
  font-size: 11px; font-weight: 700; text-transform: capitalize;
  color: var(--text-dim, #8b91a1);
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.lgt-chip:hover { color: var(--text, #e7e9ee); background: rgba(255,255,255,0.08); }
.lgt-chip.is-active {
  color: var(--on-accent); background: var(--accent); border-color: transparent;
  box-shadow: 0 1px 6px rgba(var(--accent-rgb, 43,108,255), 0.4);
}

/* Per-device list */
.lgt-devices { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1 1 auto; }
.lgt-devices-h {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim, #8b91a1); flex: 0 0 auto;
}
.lgt-dev-list {
  display: flex; flex-direction: column; gap: 5px; overflow-y: auto; min-height: 0;
  scrollbar-width: thin; padding-right: 2px;
}
.lgt-dev { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px; }
.lgt-dev-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
  background: rgb(var(--lgt-rgb, var(--accent-rgb, 43,108,255)));
  box-shadow: 0 0 6px rgba(var(--lgt-rgb, var(--accent-rgb, 43,108,255)), 0.85);
}
.lgt-dev-name {
  font-size: 12px; font-weight: 600; color: var(--text, #e7e9ee);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lgt-mode {
  font-size: 11px; font-weight: 700; color: var(--text-dim, #b9bfcc); cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04);
  border-radius: 8px; padding: 4px 8px; appearance: none; -webkit-appearance: none;
}
.lgt-mode option { background: #12161f; color: #e7e9ee; }
