:root {
  --bg-main: #0a0f1e;
  --bg-card: rgba(23, 32, 53, 0.7);
  --bg-hdr: rgba(30, 41, 59, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #0ea5e9;
  --primary-glow: rgba(14, 165, 233, 0.4);
  --accent: #f59e0b;
  --bot-msg: rgba(51, 65, 85, 0.6);
  --user-msg: #0ea5e9;
  --success: #22c55e;
  --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.2);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 0% 0%, rgba(14, 165, 233, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.1) 0%, transparent 40%),
    url('https://www.transparenttextures.com/patterns/dark-matter.png');
  color: var(--text-main);
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-wrapper {
  width: 100%;
  max-width: 100%;
  height: 100%;
  flex: 1;
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 24px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.chat-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  opacity: 0.5;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(60px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  padding: 24px;
  background: var(--bg-hdr);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  z-index: 10;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-container {
  position: relative;
}

.avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-shadow: 0 8px 16px rgba(14, 165, 233, 0.3);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: var(--success);
  border: 3px solid #1e293b;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.chat-header h1 {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  font-weight: 400;
  margin-top: 1px;
}

.reset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: rotate(180deg);
}

.chat-history {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-history::-webkit-scrollbar { width: 5px; }
.chat-history::-webkit-scrollbar-track { background: transparent; }
.chat-history::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.chat-history::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

.message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  position: relative;
  animation: messageIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(15px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; }

.message-content {
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  position: relative;
}

.message.bot .message-content {
  background: var(--bot-msg);
  color: #f1f5f9;
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.message.user .message-time { align-self: flex-end; }

/* Typing Indicator */
.typing-indicator {
  padding: 16px 20px;
  background: var(--bot-msg);
  border-radius: 20px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 5px;
  width: fit-content;
  border: 1px solid var(--glass-border);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

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

.chat-input-area {
  padding: 20px 24px 30px;
  background: var(--bg-hdr);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
}

.input-container {
  display: flex;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 6px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: rgba(15, 23, 42, 0.7);
}

.input-container input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 14px;
  color: white;
  font-size: 0.95rem;
  font-family: inherit;
}

.input-container input:focus { outline: none; }

.attach-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.attach-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.send-btn {
  background: var(--primary);
  color: white;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.send-btn:hover {
  background: #0284c7;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 15px rgba(14, 165, 233, 0.5);
}

.send-btn svg {
  transform: translateX(2px);
}

/* Response Buttons (Quick Replies) */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}
