/* JBay Floorplan — live demo (/demo/): a full-window app around the library's components */

html,
body.demo-page {
  height: 100%;
}
body.demo-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--soft);
  font-size: 15px;
}

/* ------------------------------------------------------------------ header */
.demo-nav .nav-inner {
  height: 60px;
  padding: 0 20px;
}
.demo-nav .wordmark {
  font-size: 24px;
}
.demo-tag {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--navy-950);
  background: var(--lime);
  border-radius: 999px;
  padding: 3px 10px;
}
.demo-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}
.demo-links a:not(.btn) {
  color: var(--navy);
  font-weight: 500;
  text-decoration: none;
}
.demo-links a:not(.btn):hover {
  text-decoration: underline;
  text-decoration-color: var(--lime);
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}
.demo-links .btn {
  height: 36px;
}

/* ------------------------------------------------------------------ app shell */
.demo-app {
  flex: 1;
  min-height: 0;
  display: flex;
}
.demo-loading,
.demo-fallback {
  margin: auto;
  color: var(--muted);
}
.demo-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* toolbar */
.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 10px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.bar-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar-field > span {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.seg button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.seg button:hover:not(:disabled):not(.on) {
  color: var(--navy);
  background: rgba(10, 36, 99, 0.06);
}
.seg button.on {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 10px -6px rgba(10, 36, 99, 0.8);
}
.seg button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.seg-sm button {
  font-size: 12.5px;
  padding: 3px 10px;
}
.bar-select {
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--navy);
  text-transform: capitalize;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a2463' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  appearance: none;
  cursor: pointer;
}
.bar-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--navy);
  cursor: pointer;
}
.bar-check input {
  accent-color: var(--navy);
  width: 16px;
  height: 16px;
  margin: 0;
}
.bar-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.bar-btn,
.icon-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.bar-btn:hover,
.icon-btn:hover {
  border-color: var(--navy);
}
.bar-btn svg,
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.icon-btn {
  padding: 0;
  width: 32px;
  height: 32px;
  justify-content: center;
}

/* stage and panes */
.demo-main {
  flex: 1;
  min-height: 0;
  display: flex;
}
.demo-stage {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
}
.demo-stage--split {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}
.demo-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px -24px rgba(10, 36, 99, 0.5);
}
.pane-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.pane-label b {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  color: var(--navy);
}
.pane-label span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pane-label {
  align-items: center;
  min-height: 37px;
}
.pane-seg {
  margin-left: auto;
  flex: none;
}
.pane-seg button {
  font-size: 12px;
  padding: 2px 9px;
}
.demo-pane > :last-child {
  flex: 1;
  min-height: 0;
}
.pane-wait {
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

/* side panel: events and code */
.demo-side {
  width: 360px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-left: 1px solid var(--line);
  min-height: 0;
}
.side-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.side-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.side-intro {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.event-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.event-log li {
  background: var(--navy-950);
  color: #c9d3ea;
  border-radius: 8px;
  padding: 8px 10px;
  animation: ev-in 0.35s var(--ease);
}
.event-log li:first-child {
  box-shadow: 0 0 0 2px var(--lime);
}
@keyframes ev-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
.ev-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 12.5px;
}
.ev-head b {
  color: var(--lime);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
}
.ev-head time {
  margin-left: auto;
  color: #7684a5;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.ev-src {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #dfe6f7;
}
.ev-src--3d {
  background: rgba(29, 211, 176, 0.2);
  color: var(--teal);
}
.ev-src--editor {
  background: rgba(124, 206, 37, 0.18);
  color: #a5e05f;
}
.event-log code {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}
.event-log .n {
  color: #f5b971;
}
.event-log .s {
  color: #8fe0c9;
}
.event-log .k {
  color: #b9a7ff;
}
.event-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.plan-stats {
  margin: auto 0 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  font-size: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.plan-stats dt {
  color: var(--muted);
}
.plan-stats dd {
  margin: 0;
  font-weight: 650;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.code-box {
  position: relative;
  background: var(--navy-950);
  border-radius: 10px;
}
.code-box pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #dfe6f7;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}
.side-links {
  font-size: 13px;
  color: var(--muted);
}
.side-links a {
  color: var(--navy);
  font-weight: 550;
}

/* footer line and toast */
.demo-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 20px;
  font-size: 12px;
  color: var(--muted);
  background: var(--white);
  border-top: 1px solid var(--line);
}
.demo-foot a {
  color: var(--muted);
}
.demo-toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  background: var(--navy-950);
  color: #fff;
  font-size: 14px;
  font-weight: 550;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 60;
  animation: ev-in 0.3s var(--ease);
}

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 1500px) {
  .bar-btn span {
    display: none;
  }
  .bar-btn {
    padding: 0 9px;
  }
}
@media (max-width: 1180px) {
  .demo-side {
    width: 300px;
  }
}
@media (max-width: 900px) {
  /* the page scrolls; panes get a fixed height */
  body.demo-page {
    overflow: auto;
  }
  .demo-app,
  .demo-main {
    display: block;
  }
  .demo-stage {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }
  .demo-pane {
    height: min(72vh, 620px);
  }
  .demo-side {
    width: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .side-body {
    max-height: 60vh;
  }
  .demo-bar {
    padding: 10px 16px;
    gap: 10px 14px;
  }
  .bar-actions {
    margin-left: 0;
  }
  .demo-foot {
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px;
  }
}
@media (max-width: 640px) {
  .demo-nav .nav-inner {
    padding: 0 16px;
    gap: 12px;
  }
  .demo-nav .wordmark,
  .demo-nav .brand-sep,
  .demo-links a:not(.btn) {
    display: none;
  }
  .demo-bar {
    overflow-x: hidden;
  }
  .bar-field {
    width: 100%;
    overflow-x: auto;
  }
  .bar-field > span {
    width: 48px;
    flex: none;
  }
}
