/* ===============================
   Base App Layout
================================ */

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* ❌ no page scroll */
}

body {
  font-family: "Cairo", sans-serif;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ===============================
   Chat Top Bar
================================ */

.chat-topbar {
  height: 54px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 16px;
  border-bottom: 1px solid #E5E7EB;
  background: #fff;
}

.chat-title {
  font-size: 15px;
  font-weight: 700;
}

.chat-avatar,
.chat-status {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}

.chat-avatar img,
.chat-status img {
  width: 100%;
  height: auto;
}

/* ===============================
   Chat Body (SCROLL HERE ONLY)
================================ */

.chat-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  background-image: url("/assets/ChatBody.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;

  padding: 16px;
}

/* ===============================
   Composer
================================ */

.composer {
  flex-shrink: 0;

  display: flex;
  align-items: flex-end;
  gap: 10px;

  padding: 10px 12px;
  border-top: 1px solid #E5E7EB;
  background: #fff;
}

.composer-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;

  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #BFD0FF;
  background: #EAF1FF;

  font-size: 16px; /* ✅ prevents iOS zoom */
  line-height: 1.6;
  resize: none;
  overflow: hidden;
  outline: none;
}

/* hide scrollbar */
.composer-input::-webkit-scrollbar {
  display: none;
}
/* ===============================
   Chat Messages
================================ */

/* ===============================
   Chat Messages (FINAL)
================================ */

/* Message wrapper */
.message {
  display: flex;
  margin-bottom: 12px;
}

/* Assistant message (RIGHT in RTL) */
.message.assistant {
  justify-content: flex-start;
}

/* User message (LEFT in RTL) */
.message.user {
  justify-content: flex-end;
}

/* Base bubble style */
.bubble {
  max-width: 75%;
  padding: 10px 14px;

  font-size: 15px;
  line-height: 1.7;

  border-radius: 14px;
  word-wrap: break-word;
}

/* Assistant bubble (PRIMARY) */
.message.assistant .bubble {
  background: #28367C; /* Primary color */
  color: #FFFFFF;

  border-top-right-radius: 4px; /* bubble tail feel */
}

/* User bubble (WHITE) */
.message.user .bubble {
  background: #FFFFFF;
  color: #0F172A;

  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ===============================
   Custom Chat Scrollbar
   Applies ONLY to chat body
================================ */

/* Firefox */
.chat-body {
  scrollbar-width: thin;
  scrollbar-color: #28367C transparent;
}

/* Chrome, Edge, Safari */
.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
  background-color: #28367C;
  border-radius: 10px;
  opacity: 0.6;
}

/* Hover effect (desktop only) */
.chat-body::-webkit-scrollbar-thumb:hover {
  opacity: 1;
}

/* Optional: hide scrollbar until scrolling */
.chat-body::-webkit-scrollbar {
  background: transparent;
}