/* ── DEMO PAGE STYLES ── */
.demo-section {
  max-width: 800px;
  margin: 6rem auto 2rem auto;
  padding: 0 1rem;
}

.demo-container {
  background: rgba(8, 14, 28, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
}

.demo-container.chat-mode {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  max-height: 700px;
  padding: 1.5rem;
  overflow: hidden;
  box-sizing: border-box;
}

.demo-container h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.demo-container p {
  color: var(--muted);
  margin-bottom: 2rem;
}

.word-counter {
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-family: 'DM Mono', monospace;
}

.demo-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.demo-chat-header h3 {
  font-size: 1.2rem;
  color: #fff;
}

.message-counter {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

.demo-chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-right: 0.5rem;
  scroll-behavior: smooth;
}

.demo-chat-body::-webkit-scrollbar {
  width: 8px;
}

.demo-chat-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.demo-chat-body::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.demo-chat-body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.demo-msg:first-child {
  margin-top: auto;
}

.demo-chat-input {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  border-top: 1px solid rgba(0, 240, 255, 0.2);
  padding-top: 1rem;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.demo-chat-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.8rem 1.2rem;
  color: #fff;
  outline: none;
  transition: border-color 0.3s;
}

.demo-chat-input input:focus {
  border-color: var(--accent);
}

.demo-send-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.demo-send-btn svg {
  width: 20px;
  height: 20px;
  fill: #000;
  margin-left: 2px;
}

.demo-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.demo-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.demo-chip-btn {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.demo-chip-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent);
}

.demo-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.demo-user-msg {
  align-self: flex-end;
  align-items: flex-end;
}

.demo-bot-msg {
  align-self: flex-start;
  align-items: flex-start;
}

.demo-msg-bubble {
  padding: 1rem 1.2rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #fff;
}

.demo-user-msg .demo-msg-bubble {
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 4px;
}

.demo-bot-msg .demo-msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
}

@media (max-width: 768px) {
  .demo-section {
    margin: 5rem auto 1rem auto;
    padding: 0 0.5rem;
  }

  .demo-container {
    padding: 1.5rem;
  }

  .demo-container.chat-mode {
    height: calc(100vh - 100px);
    max-height: 700px;
    padding: 1rem;
  }

  .demo-chat-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
  }

  .demo-chip-btn {
    white-space: normal;
    text-align: center;
    padding: 0.6rem 0.4rem;
    font-size: 0.72rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
  }

  .demo-chat-input {
    gap: 0.4rem;
    padding-top: 0.8rem;
  }

  .demo-chat-input input {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
  }

  .demo-send-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    margin-right: 0;
  }

  .demo-send-btn svg {
    width: 18px;
    height: 18px;
  }

  .demo-msg {
    max-width: 92%;
  }
}