/* Full-screen demo layout with a black device-like frame */
.demo-wrapper {
  min-height: 92vh; /* reduce excessive top whitespace */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f7faff 0%, #eaf3ff 100%);
  padding: 40px 16px;
  position: relative;
  overflow: visible; /* allow page scrolling */
}

.device-frame {
  background: #ffffff; /* inner white area */
  border-radius: 18px;
  position: relative; /* create stacking context for footer */
  z-index: 2;
}
/* Outer black outline so inner space isn't reduced */
.device-frame::before {
  content: "";
  position: absolute;
  inset: -14px; /* expand outward */
  border-radius: 26px;
  background: #000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  z-index: -1;
}
/* size */
.device-frame { max-width: 1400px; width: 100%; }

/* Prevent horizontal overflow on medium screens by hiding outer border */
@media (max-width: 1200px) {
  .device-frame::before { display: none; }
}
/* size */
.device-frame { max-width: 1400px; width: 100%; }

.device-screen {
  background: #ffffff;
  border-radius: 16px;
  min-height: 620px; /* more inner space while border is outside */
  overflow: hidden;
  display: grid;                    /* two columns: content | chat */
  grid-template-columns: 3fr 7fr;   /* 30% title | 70% chat */
  grid-template-rows: 1fr auto;     /* main row + footer row */
}

/* Right-side chat area between header and footer */
.chat-area {
  grid-column: 2;
  grid-row: 1;
  margin: 8px 0 0 0; /* remove right margin to prevent overflow */
  width: auto;
  min-height: 280px;
  position: relative;
  display: flex;               /* vertical stack: messages over input */
  flex-direction: column;
  justify-content: flex-end;   /* keep input at bottom */
  border-left: 1px solid rgba(0,0,0,0.08); /* vertical divider between content and chat */
  padding-left: 16px;
  box-sizing: border-box;      /* prevent padding from causing overflow */
}
.chat-scroll {
  /* Anchor messages to same baseline as input (footer) */
  max-height: 100%;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch; /* each bubble decides its own side */
  gap: 8px;
  width: 100%;
}
.chat-bubble {
  display: block;
  max-width: 86%; /* give bubbles more width */
  padding: 10px 14px;
  border-radius: 14px;
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 2px 6px rgba(16,24,40,0.06);
}
.chat-user { background: #e3ecff; color: #1b2b8c; margin-left: auto; align-self: flex-end; border-bottom-right-radius: 6px; }
.chat-bot { background: #f5f7fb; color: #1f2937; margin-right: auto; align-self: flex-start; border-bottom-left-radius: 6px; }

/* Floating AI chat badge */
/* AI icon removed */

.demo-body { flex: 1; padding: 32px; grid-column: 1; grid-row: 1; }

/* Tablet / medium screens fixes */
@media (max-width: 1200px) and (min-width: 768px) {
  .demo-wrapper { padding: 24px 12px; }
  .chat-area { padding-left: 12px; }
  .device-screen { grid-template-columns: 2fr 5fr; } /* slightly narrower to fit container */
}

@media (max-width: 992px) {
  .demo-content { grid-template-columns: 1fr; }
}

.floating-illustration {
  position: absolute;
  left: max(-60px, calc(50% - 700px)); /* align to outer border */
  bottom: 48px; /* lower the image */
  width: min(360px, 38vw);
  max-width: 460px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.25));
  z-index: 3; /* in front of frame but below chat */
}

.demo-right { display: flex; flex-direction: column; justify-content: center; }
.demo-title { font-size: 32px; margin-bottom: 8px; color: #0d1b2a; }
.demo-subtitle { color: #445; margin-bottom: 24px; }

.demo-footer { padding: 12px 20px 16px; background: #fafcff; border-top: 1px solid #eef2f7; position: relative; z-index: 4; grid-column: 1 / -1; grid-row: 2; display: none; }
.demo-footer-inner { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.demo-messages { display: none; }
.bubble { padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.2; white-space: nowrap; max-width: 40ch; text-overflow: ellipsis; overflow: hidden; border: 1px solid rgba(0,0,0,0.06); }
.bubble-user { background: #e3ecff; color: #1b2b8c; }
.bubble-bot { background: #eef3f7; color: #1f2937; }
.demo-form { width: 100%; }
.demo-footer .demo-input-group { flex: 0 0 780px; max-width: 780px; margin-left: auto; margin-right: 12px; } /* 1.5x wider */

/* Responsive: mobile adjustments */
@media (max-width: 992px) {
  /* Remove outer border/frame and make content full-screen */
  .demo-wrapper { min-height: 100vh; padding: 0; }
  .device-frame { max-width: none; width: 100%; border-radius: 0; }
  .device-frame::before { display: none; }
  .device-screen { border-radius: 0; min-height: 100vh; position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  /* Background image with soft blur and low opacity */
  .device-screen::after { content: ""; position: absolute; inset: 0; background: url('/images/wcu.png') no-repeat left bottom/60vw auto; filter: blur(6px); opacity: 0.14; pointer-events: none; }
  /* Hide extra decorations */
  .floating-illustration { display: none; }
  .demo-body { display: block; grid-column: 1; grid-row: 1; }
  /* Chat fills the screen */
  .chat-area { grid-column: 1; grid-row: 1; width: 100%; margin: 0; padding: 12px 12px 0 12px; border-left: none; box-sizing: border-box; }
  /* Keep messages anchored at the bottom */
  .chat-scroll { height: calc(100vh - 120px); display: flex; flex-direction: column; justify-content: flex-end; }
  .chat-bubble { font-size: 16px; line-height: 1.4; padding: 12px 16px; }
  .demo-footer .demo-input { font-size: 16px; }
  .demo-send { width: 48px; height: 48px; }
  /* Footer sticks to bottom and spans full width */
  .demo-footer { position: sticky; bottom: 0; left: 0; right: 0; padding: 10px 12px 12px; background: #ffffff; border-top: 1px solid #eef2f7; }
  .demo-footer-inner { min-height: auto; }
  .demo-footer .demo-input-group { flex: 1 1 auto; max-width: none; width: 100%; margin: 0; }
  /* Hide AI badge on mobile */
  .chat-ai-badge { display: none; }
}
.demo-footer .demo-input { font-size: 15px; }
.demo-input-group {
  display: flex;
  align-items: center;
  background: linear-gradient(0deg, #ffffff, #ffffff) padding-box,
              linear-gradient(90deg, #e4ecff, #f6dfff) border-box;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 6px 18px rgba(13, 27, 42, 0.08);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.demo-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 16px;
  outline: none;
  min-width: 0; /* prevent flex overflow on narrow screens */
}
.demo-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  color: #ffffff;
  background: #3f5bd9; /* align with primary */
  transition: all .2s ease;
}
.demo-send:hover { filter: brightness(1.05); }
.demo-send-icon { display: block; }

/* Ensure page scrolls normally */
/* Removed overflow hidden to allow Home page to scroll */


