@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Armenian:wght@400;600;700&display=swap");

/* Глобальный шрифт */
#ttc-widget-container,
#ttc-chat-box,
#ttc-admin-modal * {
  font-family: "Noto Sans Armenian", sans-serif !important;
  box-sizing: border-box;
}

/* Иконки прозрачны для клика */
#ttc-send svg,
#ttc-adm-send svg,
#ttc-toggle-btn svg {
  pointer-events: none !important;
}

/* === ФРОНТЕНД (КРУГЛЫЙ ДИЗАЙН) === */
#ttc-widget-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#ttc-toggle-btn {
  width: 60px;
  height: 60px;
  background-color: #1947c4;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(25, 71, 196, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: none;
}

@keyframes ttc-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 71, 196, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(25, 71, 196, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(25, 71, 196, 0);
  }
}

#ttc-chat-box {
  display: none;
  width: 350px;
  height: 500px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  margin-bottom: 20px;
  border: 1px solid #f0f0f0;
  flex-direction: column;
  overflow: hidden;
}

.ttc-header {
  background: #1947c4;
  color: #ffffff;
  padding: 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.ttc-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.ttc-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.95;
}

.ttc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b0b0b0;
}

.ttc-status-dot.online {
  background: #46b450;
}

.ttc-status-text {
  font-size: 12px;
}

.ttc-status-text.offline {
  color: #e6e6e6;
}

.ttc-status-text.online {
  color: #b4ffc7;
}

.ttc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

/* === НИЖНЯЯ ПАНЕЛЬ (ФРОНТ) === */
.ttc-input-area {
  padding: 12px 15px;
  background: #ffffff;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.ttc-input-area input {
  flex: 1;
  border: 1px solid #1947c4;
  padding: 10px 18px;
  border-radius: 25px;
  outline: none;
  font-size: 14px;
  height: 44px;
  min-width: 0;
}

.ttc-input-area button#ttc-send {
  background: #1947c4;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* маленькие кругляши: emoji + attach (фронт) */
.ttc-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #d0d7ff;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
}

.ttc-circle-btn:hover {
  background: #f3f5ff;
}

.ttc-emoji-btn {
  color: #ffb100;
}

.ttc-attach-btn {
  color: #1947c4;
}

/* file input скрыт (фронт) */
#ttc-file {
  display: none;
}

/* панель emoji (фронт) */
.ttc-emoji-panel {
  position: absolute;
  left: 15px;
  bottom: 65px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  padding: 10px 12px;
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 300px;
  z-index: 999;
}

.ttc-emoji-panel button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px;
}

/* сообщения */
.ttc-msg {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.ttc-msg.user {
  background: #1947c4;
  color: #ffffff;
  margin-left: auto;
  text-align: right;
  border-bottom-right-radius: 2px;
}

.ttc-msg.bot {
  background: #ffffff;
  border: 1px solid #eee;
  color: #333333;
  margin-right: auto;
  text-align: left;
  border-bottom-left-radius: 2px;
}

/* отдельный стиль для сообщений-emoji (фронт/админ) */
.ttc-msg.ttc-emoji-msg {
  background: transparent;
  border: none;
  padding: 0;
  margin-left: auto;
  margin-right: 4px;
  font-size: 26px;
  line-height: 1.2;
}

/* === АДМИН ПАНЕЛЬ === */
#ttc-admin-modal {
  display: none;
  position: fixed;
  top: 50px;
  right: 50px;
  width: 900px;
  height: 650px;
  background: #ffffff;
  z-index: 100000;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  border: 1px solid #ccc;
  flex-direction: column;
  display: flex;
}

.ttc-admin-top {
  height: 50px;
  background: #23282d;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.ttc-sound-btn {
  background: #444;
  border: 1px solid #666;
  color: #ddd;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ttc-sound-btn.active {
  background: #46b450;
  border-color: #46b450;
  color: #ffffff;
}

.ttc-admin-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.ttc-sidebar {
  width: 280px;
  background: #f8f9fa;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ttc-session-item {
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.ttc-session-item:hover {
  background: #eef4ff;
}

.ttc-session-item.active {
  background: #ffffff;
  border-left: 5px solid #1947c4;
}

.ttc-u-name {
  font-weight: 700;
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.ttc-u-msg {
  font-size: 12px;
  color: #777777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.ttc-u-woo {
  font-size: 11px;
  color: #2271b1;
  background: #e0f0ff;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 6px;
}

.ttc-list-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #d63638;
  color: #ffffff;
  font-size: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ttc-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.ttc-chat-info-bar {
  height: 50px;
  border-bottom: 1px solid #eee;
  background: #ffffff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-weight: bold;
  color: #1947c4;
  flex-shrink: 0;
}

/* WooCommerce orders bar */
.ttc-orders-bar {
  border-bottom: 1px solid #f0f0f0;
  background: #f9fbff;
  padding: 8px 20px 10px;
  display: none;
  flex-shrink: 0;
}

.ttc-orders-title {
  font-size: 12px;
  font-weight: 700;
  color: #1947c4;
  margin-bottom: 6px;
}

.ttc-order-chip {
  display: grid;
  grid-template-columns: auto auto auto auto;
  gap: 6px 12px;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e1e8ff;
  margin-bottom: 4px;
}

.ttc-order-status {
  font-weight: 600;
  color: #2271b1;
}

.ttc-order-date {
  text-align: right;
  color: #999999;
}

.ttc-orders-empty {
  font-size: 11px;
  color: #666666;
}

.ttc-admin-msgs-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.ttc-msg.client {
  background: #f0f2f5;
  color: #1c1e21;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.ttc-msg.me {
  background: #1947c4;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* Плавающая кнопка чата в админке (мобайл) */
.ttc-admin-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1947c4;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  cursor: pointer;
  color: #ffffff;
}

.ttc-admin-fab .dashicons {
  font-size: 24px;
  line-height: 1;
}

/* === АДАПТИВ ДЛЯ МОБИЛЬНОЙ АДМИНКИ === */
@media (max-width: 782px) {
  #ttc-admin-modal {
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    border-radius: 0;
    border: none;
  }

  .ttc-admin-top {
    height: 48px;
    padding: 0 12px;
  }

  .ttc-admin-body {
    flex-direction: column;
  }

  .ttc-sidebar {
    width: 100%;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  .ttc-chat-main {
    flex: 1;
  }

  .ttc-admin-fab {
    display: flex;
  }
}

/* === FIX ADMIN SEND BUTTON — BLUE ROUND LIKE FRONT === */
#ttc-admin-modal .ttc-input-area {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #ddd;
  background: #ffffff;
}

#ttc-adm-input {
  flex: 1;
  border: 2px solid #1e56a0;
  border-radius: 50px;
  height: 48px;
  padding: 0 18px;
  font-size: 15px;
  outline: none;
}

#ttc-adm-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #1e56a0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.2s ease;
}

#ttc-adm-send svg {
  width: 20px !important;
  height: 20px !important;
  fill: #ffffff !important;
}

#ttc-adm-send:hover {
  background: #0d3c8c;
}

#ttc-adm-send:active {
  transform: scale(0.95);
}

@media (max-width: 600px) {
  #ttc-adm-send {
    opacity: 1 !important;
  }
}

/* --- Красивый скролл для списка чатов и сообщений --- */
.ttc-sidebar,
.ttc-admin-msgs-area {
  scrollbar-width: thin;
  scrollbar-color: #c3d0ff #f5f7fb;
}

.ttc-sidebar::-webkit-scrollbar,
.ttc-admin-msgs-area::-webkit-scrollbar {
  width: 8px;
}

.ttc-sidebar::-webkit-scrollbar-track,
.ttc-admin-msgs-area::-webkit-scrollbar-track {
  background: #f5f7fb;
  border-radius: 10px;
}

.ttc-sidebar::-webkit-scrollbar-thumb,
.ttc-admin-msgs-area::-webkit-scrollbar-thumb {
  background: #c3d0ff;
  border-radius: 10px;
}

.ttc-sidebar::-webkit-scrollbar-thumb:hover,
.ttc-admin-msgs-area::-webkit-scrollbar-thumb:hover {
  background: #9caeff;
}
