/* public/css/demo.css */

.demo-page {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 14% 0%, rgba(243, 112, 33, 0.14), transparent 28rem),
    linear-gradient(135deg, #fff9f3 0%, #f8fafc 48%, #fff3e8 100%);
  color: #152033;
}

.demo-topbar {
  height: 72px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(243, 112, 33, 0.16);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 36px rgba(21, 32, 51, 0.06);
  position: relative;
  z-index: 20;
}

.demo-topbar h1 {
  font-size: 1.28rem;
  margin: 0;
  color: #152033;
  letter-spacing: -0.03em;
}

.demo-topbar .eyebrow {
  color: #f37021;
}

.demo-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.demo-layout {
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(330px, 370px) minmax(0, 1fr);
}

.demo-sidebar {
  min-height: 0;
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable both-edges;
  padding: 16px 16px 72px;
  border-right: 1px solid rgba(21, 32, 51, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-content: flex-start;
  background: rgba(255, 255, 255, 0.58);
  position: relative;
  z-index: 5;
  cursor: default;
}

.demo-sidebar::after {
  content: "";
  display: block;
  flex: 0 0 40px;
}

.demo-sidebar::-webkit-scrollbar {
  width: 12px;
}

.demo-sidebar::-webkit-scrollbar-track {
  background: rgba(21, 32, 51, 0.04);
}

.demo-sidebar::-webkit-scrollbar-thumb {
  background: rgba(243, 112, 33, 0.44);
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
}

.demo-section {
  min-width: 0;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(21, 32, 51, 0.08);
  border-radius: 22px;
  padding: 17px;
  box-shadow: 0 18px 44px rgba(21, 32, 51, 0.07);
}

.demo-section h2 {
  font-size: 0.98rem;
  color: #152033;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.demo-section label {
  color: #344054;
  font-weight: 800;
}

.demo-section input,
.demo-section select,
.demo-section textarea {
  background: #fff;
  color: #152033;
  border: 1px solid rgba(21, 32, 51, 0.12);
}

.demo-section input[type="color"] {
  height: 44px;
  padding: 6px;
  border-radius: 14px;
}

.demo-section input[type="range"] {
  accent-color: #f37021;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-list label {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  font-weight: 800;
  border-bottom: 1px solid rgba(21, 32, 51, 0.08);
  padding: 6px 0;
}

.check-list input {
  width: auto;
  accent-color: #f37021;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #f2f4f7;
  padding: 5px;
  border-radius: 999px;
}

.segmented button {
  border: 0;
  border-radius: 999px;
  padding: 10px;
  color: #667085;
  background: transparent;
  font-weight: 900;
}

.segmented button.is-active {
  background: #f37021;
  color: #fff;
  box-shadow: 0 10px 20px rgba(243, 112, 33, 0.24);
}

.note-form {
  display: grid;
  gap: 9px;
}

.phone-stage {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 14px 22px 18px;
  background:
    radial-gradient(circle at center, rgba(243, 112, 33, 0.13), transparent 34rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 247, 239, 0.86));
}

.phone-frame {
  box-sizing: border-box;
  width: auto;
  height: clamp(520px, calc(100dvh - 116px), 662px);
  max-height: calc(100dvh - 116px);
  aspect-ratio: 390 / 760;
  max-width: min(390px, calc(100vw - 430px));
  border: 12px solid #101828;
  border-radius: 38px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 80px rgba(21, 32, 51, 0.22);
  position: relative;
  padding-top: 34px;
  flex: 0 0 auto;
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 112px;
  height: 24px;
  border-radius: 999px;
  background: #060818;
  z-index: 3;
  pointer-events: none;
}

.phone-frame iframe {
  width: 100%;
  height: calc(100% - 34px);
  border: 0;
  background: white;
  display: block;
}

.demo-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(255, 247, 239, 0.78);
  backdrop-filter: blur(12px);
}

.demo-login-card {
  width: min(420px, calc(100% - 28px));
  background: #fff;
  color: #152033;
  border-radius: 26px;
  padding: 28px;
  box-shadow: 0 28px 80px rgba(21, 32, 51, 0.18);
  border: 1px solid rgba(243, 112, 33, 0.14);
  display: grid;
  gap: 14px;
}

.demo-login-card h1 {
  color: #152033;
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.demo-login-card .eyebrow {
  color: #f37021;
}

@media (max-height: 760px) and (min-width: 981px) {
  .demo-topbar {
    height: 64px;
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .demo-layout {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
  }

  .demo-sidebar {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
  }

  .phone-stage {
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .phone-frame {
    height: calc(100dvh - 92px);
    max-height: calc(100dvh - 92px);
  }
}

@media (max-width: 980px) {
  .demo-page {
    overflow: hidden !important;
  }

  .demo-layout {
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
    grid-template-columns: minmax(310px, 42vw) minmax(0, 1fr);
  }

  .demo-sidebar {
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
    overflow-y: scroll !important;
    padding-bottom: 72px;
  }

  .phone-stage {
    min-height: 0;
    height: 100%;
    padding: 12px;
  }

  .phone-frame {
    width: auto;
    height: min(680px, calc(100dvh - 96px));
    max-width: min(340px, calc(58vw - 28px));
    max-height: calc(100dvh - 96px);
  }
}
