﻿:root {
  --bg: #070b12;
  --panel: #111827;
  --panel-soft: #1a2437;
  --text: #e5ecff;
  --muted: #97a7c6;
  --primary: #00d5b0;
  --primary-strong: #00b89a;
  --assistant: #1e2a3f;
  --user: #00d5b0;
  --border: #2c3850;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Inter", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, #13203a 0%, var(--bg) 50%);
  display: grid;
  place-items: center;
  padding: 16px;
}

.chat-app {
  width: min(900px, 100%);
  height: min(92vh, 860px);
  background: rgba(9, 14, 24, 0.92);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.chat-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}

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

.brand h1 {
  font-size: 1rem;
  margin: 0;
  letter-spacing: 0.04em;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(0, 213, 176, 0.2);
}

.messages {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 80%;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}

.message.assistant {
  align-self: flex-start;
  background: var(--assistant);
  border: 1px solid #344665;
}

.message.user {
  align-self: flex-end;
  background: var(--user);
  color: #042118;
  font-weight: 600;
}

.typing {
  padding: 0 20px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.hidden {
  display: none;
}

.chat-form {
  border-top: 1px solid var(--border);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.chat-form input {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  outline: none;
}

.chat-form input:focus {
  border-color: var(--primary);
}

.chat-form button {
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #03221a;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (max-width: 680px) {
  .chat-app {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  body {
    padding: 0;
  }

  .message {
    max-width: 90%;
  }
}
