/* ═══════════════════════════════════════════════════
   nSmarTrac Schedule Demo page
   ═══════════════════════════════════════════════════ */

.demo-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
  overflow-x: hidden;
}

.demo-wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .demo-wrap {
    padding: 0 1.5rem;
  }
}

/* ─── Brand / header ─── */
.demo-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.demo-brand__icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.demo-brand__text {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.demo-brand__n,
.demo-brand__t {
  color: hsl(var(--primary));
}

.demo-brand__mid {
  color: hsl(var(--foreground));
}

.demo-header {
  position: relative;
  z-index: 10;
  padding: 1rem 0;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(12px);
}

.demo-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.demo-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ─── Page background ─── */
.demo-page {
  position: relative;
  flex: 1;
  padding: 2rem 0 3rem;
  overflow: hidden;
}

.demo-page__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(hsl(var(--border) / 0.35) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
  pointer-events: none;
}

.demo-page__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}

.demo-page__glow--1 {
  width: 360px;
  height: 280px;
  top: 5%;
  left: -8%;
  background: hsl(var(--primary) / 0.25);
}

.demo-page__glow--2 {
  width: 300px;
  height: 240px;
  top: 20%;
  right: -5%;
  background: hsl(var(--primary) / 0.15);
}

.demo-hero {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
}

.demo-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 0.75rem;
}

.demo-hero__lead {
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
}

.demo-layout {
  align-items: flex-start;
}

/* ─── Left panel ─── */
.demo-panel {
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card) / 0.7);
  backdrop-filter: blur(8px);
}

.demo-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.demo-panel__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.demo-panel__meta-item .far {
  color: hsl(var(--primary));
}

.demo-panel__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.demo-panel__text {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.25rem;
}

/* ─── Main card ─── */
.demo-card {
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .demo-card {
    padding: 2rem;
  }
}

.demo-card__title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.demo-card__subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.demo-selected-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.08);
  border: 1px solid hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  font-weight: 500;
  font-size: 0.875rem;
}

/* ─── Calendar ─── */
.demo-scheduler {
  --demo-scheduler-gap: 0.25rem;
}

.demo-scheduler__calendar,
.demo-scheduler__times {
  min-width: 0;
}

.demo-calendar-wrap {
  position: relative;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 0.75rem;
  background: hsl(var(--background));
  box-sizing: border-box;
}

#demoCalendar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.demo-calendar-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: hsl(var(--background) / 0.85);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Demo page — no landing.js reveal observer */
.demo-page .lp-reveal {
  opacity: 1;
  transform: none;
}

/* ─── Date picker (Bootstrap / shadcn style) ─── */
.demo-picker {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.demo-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.demo-picker__title {
  font-size: clamp(0.875rem, 3.5vw, 1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  flex: 1;
  min-width: 0;
}

.demo-picker__nav {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.demo-picker__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--demo-scheduler-gap);
  margin-bottom: var(--demo-scheduler-gap);
}

.demo-picker__weekday {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  text-align: center;
  padding: 0.125rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--demo-scheduler-gap);
  width: 100%;
}

.demo-picker__day {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  font-size: clamp(0.6875rem, 2.8vw, 0.875rem);
  font-weight: 500;
  line-height: 1;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  padding: 0;
  box-sizing: border-box;
}

.demo-picker__day:hover:not(.demo-picker__day--disabled):not(.is-selected) {
  background: hsl(var(--muted) / 0.6);
  border-color: hsl(var(--border));
}

.demo-picker__day--today {
  border-color: hsl(var(--primary) / 0.35);
  color: hsl(var(--primary));
  font-weight: 600;
}

.demo-picker__day.is-selected {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: #fff;
}

.demo-picker__day--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.demo-picker__day--empty {
  pointer-events: none;
}

/* ─── Time slots ─── */
.demo-times-panel {
  min-height: 0;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.25);
  padding: 1rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .demo-calendar-wrap {
    min-height: 360px;
  }

  .demo-times-panel {
    min-height: 360px;
  }

  .demo-scheduler {
    --demo-scheduler-gap: 0.25rem;
  }

  .demo-picker__weekday {
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
  }

  .demo-picker__nav {
    width: 2.25rem;
    height: 2.25rem;
  }
}

.demo-times-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 320px;
  color: hsl(var(--muted-foreground));
  gap: 0.75rem;
}

.demo-times-empty .far {
  font-size: 1.75rem;
  opacity: 0.5;
}

.demo-times-empty p {
  margin: 0;
  font-size: 0.875rem;
  max-width: 12rem;
}

.demo-times__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

.demo-times__date {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.demo-times__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.demo-time-slot {
  font-size: 0.875rem;
  font-weight: 500;
}

.demo-time-slot.is-selected,
.demo-time-slot:hover {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: #fff;
}

/* ─── Form ─── */
.demo-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.demo-form__actions .auth-card__submit {
  width: auto;
  margin: 0;
}

/* ─── Footer ─── */
.demo-footer {
  margin-top: auto;
  padding: 1.25rem 0;
  border-top: 1px solid hsl(var(--border) / 0.6);
}

.demo-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.demo-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.demo-footer__links a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}

.demo-footer__links a:hover {
  color: hsl(var(--primary));
}

@media (max-width: 991.98px) {
  .demo-panel-col {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .demo-page {
    padding: 1.25rem 0 2rem;
  }

  .demo-hero {
    margin-bottom: 1.5rem;
  }

  .demo-card {
    padding: 1rem;
  }

  .demo-card__title {
    font-size: 1.125rem;
  }

  .demo-card__subtitle {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }

  .demo-calendar-wrap {
    padding: 0.5rem;
  }

  .demo-scheduler {
    --demo-scheduler-gap: 0.125rem;
  }

  .demo-nav__actions .btn span {
    display: none;
  }

  .demo-nav__actions .btn .far {
    margin: 0 !important;
  }

  .demo-times-panel {
    padding: 0.875rem;
  }

  .demo-times-empty {
    min-height: 100px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 0.75rem;
  }

  .demo-times-empty .far {
    font-size: 1.25rem;
  }

  .demo-times-empty p {
    max-width: none;
  }

  .demo-times__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .demo-form__actions {
    flex-direction: column;
  }

  .demo-form__actions .btn {
    width: 100%;
  }

  .demo-selected-slot {
    display: flex;
    width: 100%;
    font-size: 0.8125rem;
  }
}
