:root {
  --bg: #0f0f0f;
  --input-bg: #1b1b1b;
  --primary: #4e9eff;
  --text: #ffffff;
  --user-msg: #cce7ff;
  --bot-msg: #ffeeb2;
  --card: #1e1e1e;
  --transition: 0.25s ease;
}

body.light {
  --bg: #f4f4f4;
  --text: #000000;
  --input-bg: #ffffff;
  --user-msg: #0077ff;
  --bot-msg: #d97706;
  --card: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  font-family: 'Segoe UI', sans-serif;
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  transition: var(--transition);
}

.container {
  width: 95%;
  max-width: 700px;
  height: 95vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

header {
  background-color: var(--card);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.4rem;
}

.controls button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 10px;
  transition: var(--transition);
}

.chat-box {
  flex: 1;
  padding: 20px;
  background-color: var(--bg);
  overflow-y: auto;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  margin: 12px 0;
  align-items: flex-start;
}

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

.message .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 10px;
}

.message .text {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 10px;
  background-color: var(--card);
  position: relative;
}

.message.user .text {
  background-color: var(--input-bg);
  color: var(--user-msg);
}

.message.bot .text {
  color: var(--bot-msg);
}

.timestamp {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 4px;
}

.copy-btn {
  font-size: 0.7rem;
  position: absolute;
  bottom: 4px;
  right: 8px;
  cursor: pointer;
  opacity: 0.6;
}

form {
  display: flex;
  border-top: 1px solid #444;
  background-color: var(--input-bg);
}

form input {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 1rem;
}

form button {
  padding: 0 20px;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}
