/*
======================================================
Chatbot Design Starter
Web Design Course Demo

This stylesheet is intentionally written with clear
design zones so students can remix it.

Students can modify:
- color variables
- typography
- layout
- message bubbles
- prompt buttons
- animations
- fallback state
======================================================
*/


/*
======================================================
DESIGN VARIABLES

This is the easiest place for students to begin.
Change the color palette here and the whole interface
will shift.
======================================================
*/

:root {
  --page-bg: #111318;
  --panel-bg: #f4f0e8;
  --panel-bg-deep: #e7dfd0;

  --text-main: #171717;
  --text-soft: #5f5a52;

  --accent: #0f7f68;
  --accent-dark: #095545;
  --accent-light: #b8f4df;

  --user-bubble: #151515;
  --user-text: #ffffff;

  --bot-bubble: #ffffff;
  --bot-text: #151515;

  --fallback-bg: #fff3cc;
  --fallback-border: #d6a500;
  --fallback-text: #3f3100;

  --matched-border: rgba(15, 127, 104, 0.45);

  --shadow-main: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius-large: 28px;
  --radius-medium: 18px;
  --radius-small: 10px;

  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/*
======================================================
BASE PAGE
======================================================
*/

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background:
	radial-gradient(circle at top left, rgba(184, 244, 223, 0.18), transparent 34rem),
	radial-gradient(circle at bottom right, rgba(255, 243, 204, 0.12), transparent 28rem),
	var(--page-bg);
  color: var(--text-main);
}


/*
======================================================
ACCESSIBILITY UTILITY
======================================================
*/

.visually-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/*
======================================================
PAGE LAYOUT
======================================================
*/

.chatbot-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.chatbot-shell {
  width: min(920px, 100%);
  min-height: min(820px, calc(100vh - 64px));
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-large);
  background: linear-gradient(180deg, var(--panel-bg), var(--panel-bg-deep));
  box-shadow: var(--shadow-main);
  border: 1px solid rgba(255, 255, 255, 0.45);
}


/*
======================================================
HEADER / CHATBOT IDENTITY
======================================================
*/

.chatbot-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.bot-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
	radial-gradient(circle at 35% 30%, var(--accent-light), var(--accent));
  box-shadow:
	inset 0 0 0 2px rgba(255, 255, 255, 0.45),
	0 12px 24px rgba(15, 127, 104, 0.22);
}

.bot-mark-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
	0 0 0 6px rgba(255, 255, 255, 0.22),
	0 0 22px rgba(255, 255, 255, 0.85);
}

.bot-title-group h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.bot-role {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.bot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}


/*
======================================================
WELCOME PANEL
======================================================
*/

.welcome-panel {
  padding: 18px 20px;
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.welcome-panel p {
  margin: 0;
  max-width: 64ch;
  color: var(--text-soft);
  line-height: 1.5;
}


/*
======================================================
STARTER PROMPTS
======================================================
*/

.starter-prompts-section h2 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.starter-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.prompt-button {
  appearance: none;
  border: 1px solid rgba(15, 127, 104, 0.35);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  padding: 10px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition:
	transform 160ms ease,
	background 160ms ease,
	border-color 160ms ease;
}

.prompt-button:hover,
.prompt-button:focus-visible {
  transform: translateY(-2px);
  background: var(--accent-light);
  border-color: var(--accent);
  outline: none;
}


/*
======================================================
CHAT LOG
======================================================
*/

.chat-log {
  min-height: 280px;
  max-height: 48vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-medium);
  background:
	linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.5);
}


/*
======================================================
MESSAGE BUBBLES

Students can redesign these heavily.
Try:
- square bubbles
- terminal text
- speech balloons
- cards
- theatrical captions
- oracle fragments
- museum labels
======================================================
*/

.message-row {
  display: flex;
  width: 100%;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.bot {
  justify-content: flex-start;
}

.message-bubble {
  max-width: min(72ch, 82%);
  padding: 13px 15px;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 0.98rem;
  animation: messageIn 220ms ease both;
}

.user-message {
  color: var(--user-text);
  background: var(--user-bubble);
  border-bottom-right-radius: 5px;
}

.bot-message {
  color: var(--bot-text);
  background: var(--bot-bubble);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom-left-radius: 5px;
}

.bot-message.matched {
  border-color: var(--matched-border);
}

.bot-message.fallback {
  background: var(--fallback-bg);
  color: var(--fallback-text);
  border-color: var(--fallback-border);
}

.message-meta {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  opacity: 0.58;
}


/*
======================================================
CATEGORY DESIGN HOOKS

These are optional classes added by JavaScript.
Students can style categories differently.
======================================================
*/

.category-interface {
  box-shadow: inset 4px 0 0 rgba(15, 127, 104, 0.45);
}

.category-system {
  box-shadow: inset 4px 0 0 rgba(80, 80, 80, 0.35);
}

.category-design {
  box-shadow: inset 4px 0 0 rgba(214, 165, 0, 0.45);
}


/*
======================================================
CHAT FORM
======================================================
*/

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.message-input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.85);
}

.message-input:focus {
  outline: 3px solid rgba(15, 127, 104, 0.18);
  border-color: var(--accent);
}

.send-button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0 22px;
  font: inherit;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  transition:
	transform 160ms ease,
	background 160ms ease;
}

.send-button:hover,
.send-button:focus-visible {
  transform: translateY(-1px);
  background: var(--accent-dark);
  outline: none;
}

.send-button:disabled {
  opacity: 0.55;
  cursor: wait;
}


/*
======================================================
FOOTER
======================================================
*/

.chatbot-footer {
  color: var(--text-soft);
  font-size: 0.78rem;
  text-align: center;
}

.chatbot-footer p {
  margin: 0;
}


/*
======================================================
ANIMATION
======================================================
*/

@keyframes messageIn {
  from {
	opacity: 0;
	transform: translateY(8px) scale(0.98);
  }

  to {
	opacity: 1;
	transform: translateY(0) scale(1);
  }
}


/*
======================================================
RESPONSIVE ADJUSTMENTS
======================================================
*/

@media (max-width: 680px) {
  .chatbot-page {
	padding: 0;
  }

  .chatbot-shell {
	min-height: 100vh;
	border-radius: 0;
  }

  .chatbot-header {
	grid-template-columns: auto 1fr;
  }

  .bot-status {
	grid-column: 1 / -1;
	justify-self: start;
  }

  .message-bubble {
	max-width: 92%;
  }

  .chat-form {
	grid-template-columns: 1fr;
  }

  .send-button {
	min-height: 48px;
  }
}