/* ========== VARIABLES ========== */
:root {
  --primary: #e47911;
  --primary-dark: #c6650a;
  --primary-light: #fff4e8;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #5f5f5f;
  --border: #e5e7eb;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========== HEADER ========== */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), #f5a623);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* ========== CHAT CONTAINER ========== */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ========== MESSAGE BUBBLES ========== */
.message {
  display: flex;
  gap: 10px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.message.user {
  flex-direction: row-reverse;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.message.assistant .avatar {
  background: linear-gradient(135deg, var(--primary), #f5a623);
  color: white;
}

.message.user .avatar {
  background: #e5e7eb;
  color: #4b5563;
}

.bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.6;
  max-width: 85%;
}

.message.assistant .bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}

.message.user .bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Loading dots */
.typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
}

.typing span {
  width: 7px;
  height: 7px;
  background: #bbb;
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* ========== INPUT AREA ========== */
.input-area {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 16px 16px;
  flex-shrink: 0;
}

.input-wrapper {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#user-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 140px;
  line-height: 1.45;
}

#user-input:focus {
  border-color: var(--primary);
}

.btn-send {
  background: var(--primary);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-send:hover {
  background: var(--primary-dark);
}

.btn-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.disclaimer {
  max-width: 800px;
  margin: 10px auto 0;
  font-size: 12px;
  color: #999;
  text-align: center;
  line-height: 1.4;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  .header {
    padding: 12px 14px;
  }

  .brand-text h1 {
    font-size: 15px;
  }

  .chat-container {
    padding: 16px 12px;
  }

  .bubble {
    max-width: 90%;
  }
}