/* CAT Messenger Chat Styles */

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

.msg {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  animation: pop 0.22s ease-out;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.in {
  align-items: flex-start;
  max-width: 70%;
}

.msg.out {
  align-items: flex-end;
  max-width: 70%;
  margin-left: auto;
}

.bubble {
  padding: 9px 14px;
  border-radius: 16px;
  font-size: var(--msg-font-size, 14px);
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: fit-content;
}

.msg.in .bubble {
  background: var(--bubble-in);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.msg.out .bubble {
  background: var(--bubble-out);
  color: var(--accent-text);
  border-bottom-right-radius: 4px;
}

.time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 4px;
}

body.light .time {
  color: rgba(0,0,0,0.5);
}

body.dark .time, body.ocean .time, body.forest .time, body.lavender .time, body.sunset .time, body.rose .time, body.mint .time, body.nord .time {
  color: rgba(255,255,255,0.5);
}

/* Typing indicator */
.typing {
  align-self: flex-start;
  background: var(--bubble-in);
  padding: 12px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: none;
  gap: 4px;
}

.typing.show { display: flex; }

.typing span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

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

@keyframes blink {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ===== Composer ===== */
.composer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
}

.composer-icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.composer-icon-btn:hover { background: var(--hover); color: var(--text); }

.attach-menu {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  gap: 8px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.attach-menu.show { display: flex; }

.attach-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  transition: background 0.15s;
}

.attach-menu-item:hover { background: var(--hover); }

.attach-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-primary { background: var(--accent); color: var(--accent-text); }

.composer input, .composer textarea {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid transparent;
  color: var(--text);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  resize: none;
}

.composer input::placeholder, .composer textarea::placeholder { color: var(--text-muted); }
.composer input:focus, .composer textarea:focus { border-color: var(--border); }

.send {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.send:hover { opacity: 0.85; transform: translateY(-1px); }
.send:active { transform: translateY(0); }

.time-gap {
  height: 16px;
}

.msg.compact .bubble {
  margin-top: 0;
}

.messages.empty-state {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 24px !important;
  width: 100% !important;
  gap: 12px !important;
}

.messages.empty-state svg {
  margin-bottom: 0;
}
