/* ==================================================
   RESET & GLOBAL
================================================== */
* {
  box-sizing: revert;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f2f2f2;
}

/* ==================================================
   APP CONTAINER (MOBILE FIRST)
================================================== */
.app {
  width: 100%;
  max-width: 420px;
  height: 100dvh; /* mobile safe */
  margin: 0 auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
}

/* Tablet / Desktop */
@media (min-width: 600px) {
  .app {
    margin: 10px auto;
    height: calc(100dvh - 20px);
    border-radius: 22px;
  }
}

/* ==================================================
   HEADER
================================================== */
.header {
  flex-shrink: 0;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.header-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* VOICE LINK */
.voice-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #c2b9b9;
  background: #fff;
  font-size: 13px;
  color: #333;
  text-decoration: none;
}

/* iOS STYLE EQUALIZER */
.eq-ios {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}

.eq-ios i {
  display: block;
  width: 2px;
  background: #6d4aff;
  border-radius: 2px;
}

/* tinggi bar (mirip foto) */
.eq-ios i:nth-child(1) { height: 6px; }
.eq-ios i:nth-child(2) { height: 12px; }
.eq-ios i:nth-child(3) { height: 8px; }


.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.back-btn:hover {
  background: rgba(0,0,0,.05);
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

.title {
  font-weight: 600;
  font-size: 14px;
}

.header-right {
  font-size: 20px;
}

/* ==================================================
   CHAT BOX
================================================== */
.chat-box {
  flex: 1;
  padding: 14px;
  background: #fafafa;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* ==================================================
   CHAT ROW
================================================== */
.chat {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: flex-end;
}

.chat.user {
  justify-content: flex-end;
}

.chat.ai {
  justify-content: flex-start;
  align-items: flex-start;
}

/* ==================================================
   AVATAR
================================================== */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e9ff;
  color: #5b5bff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ==================================================
   AI CONTENT
================================================== */
.ai-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 75%;
}

.ai-name {
  font-size: 12px;
  font-weight: 600;
  color: #111;
}

/* ==================================================
   CHAT BUBBLE (GLOBAL)
================================================== */
.bubble {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  background: #f1f1f3;
}

/* USER BUBBLE */
.chat.user .bubble {
  background: #693BEF;
  color: #fff;
  border-top-right-radius: 4px;
}

/* AI BUBBLE */
.chat.ai .bubble {
  background: #f1f1f3;
  color: #111;
  border-top-left-radius: 4px;
}

/* TIME */
.time {
  font-size: 10px;
  color: #777;
  float: right;
  margin-left: 8px;
  margin-top: 4px;
}

/* ==================================================
   TYPING INDICATOR
================================================== */
.typing {
  background: #e9e9eb;
  padding: 10px 14px;
  border-radius: 18px;
  display: flex;
  gap: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.typing span:nth-child(2){ animation-delay:.2s }
.typing span:nth-child(3){ animation-delay:.4s }

@keyframes blink {
  0% { opacity:.2 }
  20% { opacity:1 }
  100% { opacity:.2 }
}

/* ==================================================
   INPUT BAR
================================================== */
/* INPUT WRAPPER */
.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 5px;
  background: #fff;
}

/* MIC CIRCLE */
.mic-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mic-circle svg {
  width: 18px;
  height: 18px;
  stroke: #666;
  fill: none;
  stroke-width: 2;
}

/* INPUT PILL */
.input-pill {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 8px 10px;
}

/* TEXTAREA */
.input-pill textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 14px;
  padding: 1px 8px;
  max-height: 120px;
}

/* SEND BUTTON */
.send-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #6d4aff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.send-circle svg {
  width: 16px;
  height: 16px;
}


/* ==================================================
   SEND BUTTON
================================================== */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn.send {
  background: #693BEF;
  color: #fff;
}

.icon-btn.send.disabled {
  opacity: .4;
  pointer-events: none;
}

/* ==================================================
   MIC BUTTON
================================================== */
.mic-input {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* MIC ICON */
.mic-icon {
  width: 18px;
  height: 18px;
  stroke: #111;
  fill: none;
  stroke-width: 2;
}

/* MINI EQUALIZER */
.eq-mini {
  display: none;
  gap: 3px;
  height: 16px;
  align-items: center;
}

.eq-mini span {
  width: 3px;
  height: 5px;
  background: #111;
  border-radius: 2px;
  animation: miniEq 1s infinite ease-in-out;
}

.eq-mini span:nth-child(1){ animation-delay:0s }
.eq-mini span:nth-child(2){ animation-delay:.15s }
.eq-mini span:nth-child(3){ animation-delay:.3s }

@keyframes miniEq {
  0% { height:5px; opacity:.5 }
  50% { height:14px; opacity:1 }
  100% { height:5px; opacity:.5 }
}

/* MIC LISTENING */
.mic-input.listening .mic-icon {
  display: none;
}

.mic-input.listening .eq-mini {
  display: flex;
}

/* EMPTY STATE */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.empty-avatar img {
  width: 90px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.quick-actions button {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s ease;
}

.quick-actions button:hover {
  background: #6d4aff;
  color: #fff;
  border-color: #6d4aff;
}
