
/* chat_module/assets/css/chat.css - Telegram-style web UI (light) */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e5ebf1;
}

.tg-app {
  max-width: 1200px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
  position: relative;
}

.tg-header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #5682a3;
  color: #ffffff;
}

.tg-menu-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  margin-right: 8px;
  cursor: pointer;
  color: inherit;
}

.tg-title {
  flex: 1;
  font-weight: 600;
}

.tg-header-actions .tg-icon-btn {
  border: none;
  background: transparent;
  margin-left: 4px;
  cursor: pointer;
  color: inherit;
}

.tg-tabs {
  display: flex;
  background: #f4f6f9;
  border-bottom: 1px solid #d3dde7;
}

.tg-tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #6b7480;
}

.tg-tab-active {
  border-bottom: 2px solid #2b77c5;
  color: #2b77c5;
  font-weight: 600;
}

.tg-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 0;
}

.tg-chat-list {
  border-right: 1px solid #d3dde7;
  background: #ffffff;
  overflow-y: auto;
}

.tg-chat-item {
  display: flex;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.tg-chat-item:hover {
  background: #f1f4f7;
}

.tg-chat-item-active {
  background: #e3edf7;
}

.tg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #c4d5e4;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 10px;
  flex-shrink: 0;
}

.tg-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

.tg-chat-main {
  display: flex;
  flex-direction: column;
  background: #e5ebf1;
}

.tg-chat-empty {
  margin: auto;
  color: #7a8696;
  font-size: 15px;
}

.hidden {
  display: none;
}

.tg-chat-header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid #d3dde7;
}

.tg-chat-header-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.tg-chat-header-sub {
  font-size: 12px;
  color: #7a8696;
}

.tg-chat-messages {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  background: #dde6ef;
}

.tg-chat-input-bar {
  display: flex;
  padding: 8px;
  background: #ffffff;
  border-top: 1px solid #d3dde7;
}

.tg-chat-input-bar input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #c0cad7;
  outline: none;
}

.tg-chat-input-bar button {
  margin-left: 8px;
  padding: 0 16px;
  border-radius: 999px;
  border: none;
  background: #2b77c5;
  color: #ffffff;
  cursor: pointer;
}

/* message bubbles */
.tg-bubble {
  max-width: 70%;
  padding: 6px 10px;
  border-radius: 16px;
  margin-bottom: 6px;
  font-size: 14px;
  position: relative;
}

.tg-bubble-me {
  margin-left: auto;
  background: #cbe6ff;
}

.tg-bubble-them {
  margin-right: auto;
  background: #ffffff;
}

.tg-bubble-meta {
  margin-top: 2px;
  font-size: 11px;
  color: #7a8696;
  text-align: right;
}

.tg-fab {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #2b77c5;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

/* responsive */
@media (max-width: 768px) {
  .tg-layout {
    grid-template-columns: 1fr;
  }
  .tg-chat-list {
    display: block;
  }
}
