/* SYBER STORE веб-версия — стили страницы «Чат» (префикс chat-).
   Подключается один раз из js/pages/chat.js (id="chat-css"), поверх app.css. */

/* Список тем */
.chat-list-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chat-unread {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
}

/* Лента сообщений */
.chat-msgs {
  display: flex; flex-direction: column; gap: 6px;
  padding-bottom: 76px; /* место под фиксированную строку ввода */
}
.chat-day {
  align-self: center; background: #E8EDF3; color: var(--muted);
  font-size: 11px; font-weight: 700; border-radius: 999px;
  padding: 4px 12px; margin: 10px 0 2px;
}
.chat-bubble {
  max-width: 78%; padding: 9px 12px 5px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.4;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.chat-bubble.mine {
  align-self: flex-end; background: var(--accent); color: #fff;
  border-bottom-right-radius: 5px; /* «хвостик» смотрит в сторону отправителя */
}
.chat-bubble.theirs {
  align-self: flex-start; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); border-bottom-left-radius: 5px;
}
.chat-author { font-size: 12px; font-weight: 800; margin-bottom: 2px; }
.chat-time { font-size: 10.5px; text-align: right; margin-top: 3px; }
.chat-bubble.mine .chat-time { color: rgba(255, 255, 255, 0.75); }
.chat-bubble.theirs .chat-time { color: var(--muted); }

/* Вложения: голосовые */
.chat-voice { display: flex; align-items: center; gap: 10px; padding: 2px 0; min-width: 150px; }
.chat-voice-play {
  width: 38px; height: 38px; border-radius: 50%; border: none; flex: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--accent); color: #fff;
}
.chat-bubble.mine .chat-voice-play { background: #fff; color: var(--accent); }
.chat-voice-play:active { transform: scale(0.94); }
.chat-voice-dur { font-size: 13px; font-weight: 700; white-space: nowrap; }
.chat-voice-audio { width: 220px; max-width: 100%; height: 40px; }

/* Вложения: фото */
.chat-att-imgbox { min-width: 120px; }
.chat-att-loading {
  display: flex; align-items: center; justify-content: center;
  width: 180px; height: 120px; border-radius: 10px; background: rgba(0, 0, 0, 0.06);
}
.chat-att-img {
  display: block; max-width: 200px; max-height: 260px;
  border-radius: 10px; cursor: zoom-in;
}
.chat-img-veil {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.88);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.chat-img-veil img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }
.chat-img-close {
  position: absolute; top: calc(12px + var(--safe-t, 0px)); right: 14px;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 18px;
}

/* Вложения: файлы */
.chat-file { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 170px; padding: 2px 0; }
.chat-file-ico {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.08); font-size: 17px;
}
.chat-bubble.mine .chat-file-ico { background: rgba(255, 255, 255, 0.22); }
.chat-file-body { min-width: 0; }
.chat-file-name { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.chat-file-size { font-size: 11.5px; opacity: 0.75; }

/* Вложение истекло (410) / ошибка загрузки миниатюры */
.chat-att-expired, .chat-att-retry { font-size: 12.5px; opacity: 0.72; font-style: italic; }
.chat-att-retry { cursor: pointer; }

/* Строка ввода — фиксирована над таббаром, как .paybar кассы */
.chat-bar {
  position: fixed; left: 0; right: 0; bottom: calc(58px + var(--safe-b)); z-index: 25;
  max-width: 760px; margin: 0 auto; padding: 10px 16px;
}
.chat-bar .inner {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
  padding: 6px 6px 6px 16px;
}
.chat-bar input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 16px; color: var(--ink);
}
.chat-send {
  width: 44px; height: 44px; border-radius: 50%; border: none; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 18px; font-weight: 800; cursor: pointer;
  transition: transform 0.06s ease, opacity 0.15s;
}
.chat-send:active { transform: scale(0.94); }
.chat-send:disabled { opacity: 0.5; pointer-events: none; }

/* Кнопки 🎤 и 📎 в строке ввода */
.chat-icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; flex: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent; font-size: 19px; color: var(--muted);
}
.chat-icon-btn:active { transform: scale(0.92); }
.chat-icon-btn:disabled { opacity: 0.45; pointer-events: none; }

/* Режим записи голосового: красная пульсирующая точка + таймер + «Стоп» */
.chat-rec { display: flex; align-items: center; gap: 10px; flex: 1; min-height: 44px; padding-right: 2px; }
.chat-rec-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #DC2626; flex: none;
  animation: chatRecPulse 1s ease-in-out infinite;
}
@keyframes chatRecPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.chat-rec-time { font-weight: 800; font-size: 15px; color: #DC2626; min-width: 44px; }
