/* Govee tab (KL-134, extracted to features/). Help-bubble +
   help-popover styles also live here since they're only used by
   the Govee modal's "?" help affordances. */
@layer features {

.help-bubble {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
}
.help-bubble:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Govee Tab */
.govee-panel {
    background: var(--surface);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.govee-panel > h2 {
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.govee-panel .setting-row {
    margin-bottom: 1.25rem;
}

.govee-panel .toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text);
    cursor: pointer;
}

.govee-panel .toggle input[type="checkbox"] {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
}

.govee-devices {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.govee-devices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.govee-devices-header h3 {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.govee-devices-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.govee-devices-actions .action-btn {
    flex: 0 0 auto;
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
}

.govee-devices-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.govee-scan-result {
    font-size: 0.75rem;
    color: var(--accent);
    background: var(--surface-2);
    padding: 0.5rem 0.7rem;
    border-radius: 0.3rem;
    line-height: 1.5;
}

.govee-device-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.govee-devices-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
    background: var(--surface-2);
    border-radius: 0.4rem;
    font-size: 0.8rem;
}

.govee-device-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.2rem 0.75rem;
    align-items: center;
    padding: 0.55rem 0.75rem;
    background: var(--surface-2);
    border-radius: 0.4rem;
    font-size: 0.85rem;
}

.govee-status-dot {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--text-muted, #5a5670);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
    transition: background 0.2s, box-shadow 0.2s;
    cursor: help;
    flex-shrink: 0;
    display: inline-block;
}
.govee-status-dot[data-status="online"] {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18), 0 0 6px rgba(34, 197, 94, 0.55);
}
.govee-status-dot[data-status="offline"] {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}
.govee-status-dot.pulsing {
    animation: govee-dot-pulse 1.1s ease-in-out infinite;
}
@keyframes govee-dot-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.85); }
    50%      { opacity: 1.0; transform: scale(1.15); }
}

.govee-device-name { grid-column: 2; grid-row: 1; color: var(--text); }
.govee-device-name strong { font-weight: 600; }

.govee-device-meta {
    grid-column: 2;
    grid-row: 2;
    color: var(--text-dim);
    font-size: 0.75rem;
}

.govee-device-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    display: flex;
    gap: 0.35rem;
    align-self: center;
}

.govee-device-actions .action-btn {
    flex: 0 0 auto;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
}

/* LAN-Control primer above the enable toggle. The most common Govee
   onboarding failure is forgetting to flip LAN Control on per-light,
   so this callout owns top-of-panel real estate. */
.govee-lan-callout {
    background: linear-gradient(135deg, rgba(201, 70, 255, 0.08), rgba(201, 70, 255, 0.02));
    border: 1px solid rgba(201, 70, 255, 0.25);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}
.govee-lan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.govee-lan-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.govee-lan-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.72rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.govee-lan-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.govee-lan-summary {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}
/* Always-visible help anchor (KL-45). Sits between the summary and
   the collapsible body so users who skip "Show me how" still see a
   way to the FAQ — the previous walkthrough link only existed inside
   the collapsed section, so a stuck user never reached it. */
.govee-lan-help {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--text-dim);
}
.govee-lan-help a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
}
.govee-lan-help a:hover { filter: brightness(1.15); }
.govee-lan-body {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
}
.govee-lan-steps {
    margin: 0 0 0.75rem 1.1rem;
    padding: 0;
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.6;
}
.govee-lan-faq-link {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: var(--text-dim);
}
.govee-lan-faq-link a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
}
.govee-lan-faq-link a:hover { filter: brightness(1.15); }

/* Empty-state hero — replaces the device list when nothing is configured.
   Shows the big "Find my lights" call-to-action so new users never have
   to go hunting for the right button. */
.govee-empty-hero {
    text-align: center;
    padding: 1.5rem 1rem 1.75rem;
    background: var(--surface-2);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
}
.govee-empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.govee-empty-lede {
    margin: 0 auto 1rem;
    max-width: 40ch;
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.5;
}
.govee-empty-cta {
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
}
.govee-empty-secondary {
    display: block;
    margin: 0.75rem auto 0;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}
.govee-empty-secondary:hover {
    color: var(--accent);
}
.govee-empty-status {
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    min-height: 1rem;
}
.govee-empty-status.is-busy {
    color: var(--accent);
}
.govee-empty-status.is-error {
    color: var(--red, #ff6b88);
}

/* Help popovers that hang off "?" bubbles in the device modal.
   Inline below the field rather than floating — simpler to position,
   plays nicely inside the modal's scroll area. */
.help-popover {
    margin-top: 0.5rem;
    padding: 0.7rem 0.85rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.55;
}
.help-popover p {
    margin: 0 0 0.5rem;
}
.help-popover p:last-child {
    margin-bottom: 0;
}
.help-popover code {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.05rem 0.3rem;
    border-radius: 0.2rem;
}

/* KL-169: inline spinner for the Find/Recheck buttons. Sized to sit
   beside the button label without bumping its height. Uses
   currentColor so it adapts to both .action-btn (dark surface) and
   .modal-primary (accent fill) — solid ring with a transparent gap
   that rotates, instead of a partial-arc moving stroke (which would
   need separate light/dark styling). */
.inline-spinner {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0.75;
    animation: inline-spinner-rotate 0.7s linear infinite;
    vertical-align: -0.15rem;
    margin-right: 0.4rem;
}
@keyframes inline-spinner-rotate {
    to { transform: rotate(360deg); }
}


} /* end @layer features */
