/*  Reset & Base ─ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black:        #0A0A0A;
  --black-2:      #111111;
  --black-3:      #1A1A1A;
  --black-4:      #222222;
  --red:          #CC0000;
  --red-bright:   #E60000;
  --red-dim:      #990000;
  --red-glow:     rgba(204, 0, 0, 0.25);
  --red-subtle:   rgba(204, 0, 0, 0.08);
  --white:        #FFFFFF;
  --gray-1:       #F0F0F0;
  --gray-2:       #AAAAAA;
  --gray-3:       #555555;
  --border:       rgba(204, 0, 0, 0.2);
  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

html, body {
  height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/*  Scrollbar  */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black-2); }
::-webkit-scrollbar-thumb { background: var(--red-dim); border-radius: 4px; }

/*  Header ─ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--black-2);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--red-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--gray-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 160, 0, 0.1);
  border: 1px solid rgba(0, 160, 0, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: #4CAF50;
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #4CAF50;
  border-radius: 50%;
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/*  Chat Wrap  */
.chat-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 88px 16px 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/*  Chat Window ─ */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 24px 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/*  Message Rows  */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: fadeUp 0.25s ease both;
}

.bot-row {
  flex-direction: row;
}

.user-row {
  flex-direction: row-reverse;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/*  Avatar ─ */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--red-dim);
  font-family: var(--font-display);
}

/*  Bubbles  */
.bubble {
  max-width: 68%;
  padding: 13px 16px;
  border-radius: var(--radius-lg);
  font-size: 14.5px;
  line-height: 1.65;
  position: relative;
}

.bubble p + p {
  margin-top: 6px;
}

.bot-bubble {
  background: var(--black-3);
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-sm);
  color: var(--gray-1);
}

.bot-bubble strong {
  color: var(--red-bright);
}

.user-bubble {
  background: var(--red);
  border: 1px solid var(--red-dim);
  border-bottom-right-radius: var(--radius-sm);
  color: var(--white);
}

/*  Timestamp  */
.timestamp {
  display: block;
  font-size: 10px;
  color: var(--gray-3);
  margin-top: 6px;
  text-align: right;
}

.user-bubble .timestamp {
  color: rgba(255,255,255,0.5);
}

/*  Typing Indicator  */
.typing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 0 4px 8px;
}

.typing-bubble {
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-bubble span {
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.2s ease-in-out infinite;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/*  Quick Suggestions ─ */
.suggestions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 4px 12px;
}

.suggestion-btn {
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--gray-1);
  font-family: var(--font-body);
  font-size: 12.5px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.suggestion-btn:hover {
  background: var(--red-subtle);
  border-color: var(--red);
  color: var(--white);
}

/*  Input Bar  */
.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--black-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 10px 10px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-bar:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.msg-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
}

.msg-input::placeholder {
  color: var(--gray-3);
}

.send-btn {
  width: 40px;
  height: 40px;
  background: var(--red);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.send-btn:hover {
  background: var(--red-bright);
  box-shadow: 0 0 12px var(--red-glow);
}

.send-btn:active {
  transform: scale(0.93);
}

.send-btn:disabled {
  background: var(--gray-3);
  cursor: not-allowed;
  box-shadow: none;
}

/*  Input Hint  */
.input-hint {
  text-align: center;
  font-size: 11px;
  color: var(--gray-3);
  padding: 8px 0 12px;
  letter-spacing: 0.02em;
}

/*  Error Bubble  */
.error-bubble {
  background: rgba(180, 0, 0, 0.15);
  border: 1px solid rgba(180, 0, 0, 0.4);
  color: #FF6B6B;
}

/*  Responsive  */
@media (max-width: 600px) {
  .header-inner { padding: 12px 16px; }
  .brand-name   { font-size: 16px; }
  .status-pill  { display: none; }
  .bubble       { max-width: 82%; }
  .chat-wrap    { padding-top: 80px; }
  .suggestions  { gap: 6px; }
  .suggestion-btn { font-size: 11.5px; padding: 6px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}