/* 25/03/2026 | 22:40 - Chat ilustrativo (chat.php apenas) @filipemontt */
/* 07/04/2026 - Mobile: altura dvh, menos padding topo, thread-head flex, safe-area rodapé @filipemontt */
.page-chat-demo {
  background: #f4f6f8;
  min-height: 100vh;
  min-height: 100dvh;
}
/* 25/03/2026 | 23:35 - topo/rodapé; desktop: espaço p/ header fixo @filipemontt */
.page-chat-demo #wrapper-content {
  padding-top: 150px !important;
  padding-bottom: 100px !important;
}
.page-chat-demo .chat-demo {
  max-width: 1100px;
  margin: 0 auto;
}
.chat-demo__layout {
  background: #fff;
  border: 1px solid #e8edef;
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.chat-demo__list-col {
  background: #fafbfc;
  border-right: 1px solid #e8edef;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.chat-demo__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 1px solid #eef1f3;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-demo__item:hover,
.chat-demo__item:focus {
  background: #eef4f8;
  outline: none;
}
.chat-demo__item.active {
  background: #e3f0fa;
  border-left: 3px solid #1a6da7;
}
.chat-demo__item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #222;
}
.chat-demo__item-meta {
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
}
.chat-demo__item-preview {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-demo__thread-col {
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 560px);
  min-height: 0;
}
.chat-demo__thread-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8edef;
  background: #fff;
  flex-shrink: 0;
}
.chat-demo__thread-head-main {
  flex: 1;
  min-width: 0;
}
.chat-demo__thread-head h2 {
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}
.chat-demo__thread-head p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #777;
  line-height: 1.35;
  word-break: break-word;
}
.chat-demo__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  background: #f9fafb;
  -webkit-overflow-scrolling: touch;
}
.chat-demo__bubble-row {
  display: flex;
  margin-bottom: 0.65rem;
}
.chat-demo__bubble-row--me {
  justify-content: flex-end;
}
.chat-demo__bubble {
  max-width: 85%;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}
.chat-demo__bubble--them {
  background: #fff;
  border: 1px solid #e8edef;
  color: #333;
}
.chat-demo__bubble--me {
  background: #1a6da7;
  color: #fff;
}
.chat-demo__composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem;
  border-top: 1px solid #e8edef;
  background: #fff;
  flex-shrink: 0;
}
.chat-demo__composer input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #dde3e6;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}
.chat-demo__composer button {
  border-radius: 999px;
  white-space: nowrap;
}
.chat-demo__back {
  display: none;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
  gap: 0.35rem;
  background: none;
  border: 0;
  color: #1a6da7;
  font-size: 0.9rem;
  padding: 0.35rem 0.25rem 0.35rem 0;
  margin: 0;
  cursor: pointer;
  line-height: 1;
}
@media (max-width: 767px) {
  .page-chat-demo #wrapper-content {
    padding-top: 0.75rem !important;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 12px) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .page-chat-demo .container > .font-size-h4 {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-bottom: 0.65rem !important;
    font-size: 1.15rem !important;
  }
  .page-chat-demo .chat-demo {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    max-width: 100%;
  }
  .chat-demo__layout {
    min-height: 0;
    /* viewport − header + logo mobile + título página + menu inferior @filipemontt */
    height: calc(100vh - 180px - 72px);
    height: calc(100dvh - 180px - 72px);
    max-height: calc(100vh - 180px - 72px);
    max-height: calc(100dvh - 180px - 72px);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .chat-demo__layout > [class*="col-"] {
    flex: 1 1 auto !important;
    max-width: 100% !important;
    min-height: 0;
  }
  .chat-demo__layout--thread .chat-demo__list-col {
    display: none !important;
  }
  .chat-demo__layout:not(.chat-demo__layout--thread) .chat-demo__thread-col {
    display: none !important;
  }
  .chat-demo__layout--thread .chat-demo__thread-col {
    display: flex !important;
  }
  .chat-demo__list-col {
    max-height: none;
    flex: 1;
    min-height: 0;
  }
  .chat-demo__thread-col {
    max-height: none;
    flex: 1;
    min-height: 0;
  }
  .chat-demo__layout--thread .chat-demo__back {
    display: inline-flex;
  }
  .chat-demo__thread-head {
    align-items: center;
    padding: 0.65rem 0.85rem;
  }
  .chat-demo__composer {
    padding: 0.65rem 0.75rem;
    gap: 0.4rem;
  }
  .chat-demo__composer input {
    font-size: 16px;
    min-height: 44px;
    padding: 0.5rem 1rem;
  }
  .chat-demo__composer .btn {
    min-height: 44px;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .chat-demo__bubble {
    max-width: 88%;
  }
}
@media (max-width: 767px) and (max-height: 500px) {
  .chat-demo__layout {
    height: calc(100vh - 100px - 72px);
    height: calc(100dvh - 100px - 72px);
    max-height: calc(100vh - 100px - 72px);
    max-height: calc(100dvh - 100px - 72px);
  }
}
