/* Demo-only styles. Keeps the firmware look and adds the demo markers. */

/* Alert tones that the firmware component layer only defines for warning/info. */
.alert-danger {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
}

.alert-secondary {
  background: #e2e8f0;
  border-color: #64748b;
  color: #1e293b;
}

.alert-dark {
  background: #1e2533;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark .alert-danger {
  background: #7f1d1d;
  border-color: #dc2626;
  color: #fee2e2;
}

html.dark .alert-secondary {
  background: #1e293b;
  border-color: #64748b;
  color: #e2e8f0;
}

html.dark .alert-dark {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

/* Small-screen spacing helper used by the form layout. */
@media (min-width: 576px) {
  .mb-sm-0 {
    margin-bottom: 0 !important;
  }
}

.demo-boot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-main);
}

.demo-boot-card {
  text-align: center;
  color: var(--text-muted);
  font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
}

.demo-boot-logo {
  width: 220px;
  max-width: 60vw;
  display: block;
  margin: 0 auto 1rem;
}

.demo-noscript {
  padding: 2rem;
  text-align: center;
}

/* Demo marker in the topbar */
.ioh-demo-badge {
  display: inline-flex;
  align-items: center;
  margin-left: .5rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: var(--accent-amber);
  color: #1f2937;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Floating message */
.ioh-demo-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 150%);
  max-width: min(90vw, 32rem);
  padding: .65rem 1.1rem;
  border-radius: 12px;
  background: #111827;
  color: #f8fafc;
  border: 1px solid #334155;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .35);
  font-size: .875rem;
  font-weight: 600;
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
  pointer-events: none;
  z-index: 120;
}

.ioh-demo-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.ioh-demo-toast.is-warn {
  background: #78350f;
  border-color: #b45309;
}

html.light .ioh-demo-toast {
  background: #0f172a;
  color: #f8fafc;
}

/* Confirmation modal reuse */
#ioh-demo-modal .ioh-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

#ioh-demo-modal .modal-body-text {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

#ioh-demo-modal .ioh-modal-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

/* JSON viewer */
.ioh-json-view {
  max-height: 26rem;
  overflow: auto;
  margin: 0 0 .8rem;
  padding: .9rem;
  border-radius: 12px;
  background: #0f172a;
  color: #a7f3d0;
  border: 1px solid #1e293b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.45;
  white-space: pre;
}

/* Group climate blocks on the dashboard */
.ioh-group-climate {
  padding: .75rem;
  margin-bottom: .85rem;
  border: 1px solid #94a3b829;
  border-radius: 14px;
  background: #94a3b80a;
}

.ioh-group-climate .tz-zone {
  font-weight: 700;
  margin-bottom: .35rem;
}

/* Order buttons inside card headers */
.ioh-card-header-accent .ioh-device-order-actions {
  margin-left: auto;
}

.ioh-device-card-title {
  overflow-wrap: anywhere;
}

.tz-head-actions .ioh-device-order-btn {
  padding: .15rem .5rem;
}

/* Reboot ring defaults (kept identical to the firmware page) */
.rb-ring {
  transition: stroke-dashoffset .9s linear;
}

/* The shell is written into #demo-root, so it must participate in body's flex layout. */
#demo-root {
  display: contents;
}

/* Mobile: sidebar behaves like the firmware drawer */
.ioh-sidebar-backdrop.active {
  display: block;
}
