/* === Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: linear-gradient(135deg,#0f172a,#0b1220);
  color: #e6eef8;
  overflow: hidden;
}

/* === Background Blob (ambil gaya dari login.css) === */
.bg-blob {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  filter: blur(60px);
  opacity: .6;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,.45) 0%, transparent 25%),
    radial-gradient(ellipse at 80% 80%, rgba(16,185,129,.35) 0%, transparent 25%),
    radial-gradient(ellipse at 50% 40%, rgba(59,130,246,.25) 0%, transparent 20%);
  animation: blobMove 12s infinite alternate ease-in-out;
  transform: translateZ(0);
}

@keyframes blobMove {
  from { transform: translate3d(-10px,-10px,0) scale(1); }
  to { transform: translate3d(10px,10px,0) scale(1.07); }
}

/* === Chat Container === */
.chat-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100dvh; /* ✅ dynamic viewport: tidak tertutup keyboard */
  max-width: 480px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  border-radius: 0;
  box-shadow: 0 0 30px rgba(2,6,23,.6);
  overflow: hidden;
  animation: cardIn .6s cubic-bezier(.2,.9,.3,1) forwards .08s;
}


@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

/* === Header === */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.05);
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.chat-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #e6eef8;
}

.chat-title span {
  color: #38bdf8; /* warna aksen biru muda */
}

.chat-back {
  color: #e6eef8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}
.chat-back:hover { opacity: 0.8; }

/* === Body === */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.chat-body::-webkit-scrollbar {
  width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,.1);
  border-radius: 10px;
}

/* === Message === */
.message {
  display: flex;
  align-items: flex-end;
  margin: 6px 0;
  animation: fadeIn 0.3s ease;
}

.message.user { justify-content: flex-end; }
.message.bot { justify-content: flex-start; }

.bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  color: #e6eef8;
  font-size: 0.9rem;
  line-height: 1.4;
}

.message.user .bubble {
  background: linear-gradient(90deg,#6366f1,#06b6d4);
  color: #042033;
  border-bottom-right-radius: 0;
}

.message.bot .bubble {
  background: rgba(255,255,255,.06);
  border-bottom-left-radius: 0;
}

.message .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 8px;
  flex-shrink: 0;
}

.message .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble .time {
  display: block;
  text-align: right;
  font-size: 0.7rem;
  opacity: .6;
  margin-top: 4px;
}

/* === Footer === */
.chat-footer {
  display: flex;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,.06);
  gap: 10px;
}

.chat-footer input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 25px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: #e6eef8;
  outline: none;
  font-size: 0.9rem;
  transition: border-color .2s, box-shadow .2s;
}

.chat-footer input:focus {
  border-color: rgba(59,130,246,.6);
  box-shadow: 0 0 10px rgba(59,130,246,.2);
}

.chat-footer button {
  padding: 0 20px;
  border: 0;
  border-radius: 25px;
  background: linear-gradient(90deg,#6366f1,#06b6d4);
  color: #042033;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(6,182,212,.08);
  transition: transform .14s ease, box-shadow .14s;
}

.chat-footer button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(6,182,212,.15);
}

/* === Animasi === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
