/* Inbox / Atendimento Styles - Inspired by Premium Dark Chat UI */

.inbox-container {
  display: flex;
  height: calc(100vh - 160px); 
  overflow: hidden;
  padding: 0;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.02);
  background: #15151c; /* Deep dark background */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .inbox-container {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* SIDEBAR - CONVERSATION LIST */
.inbox-sidebar {
  width: 320px;
  border-right: 1px solid rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  background: #15151c;
}

[data-theme="light"] .inbox-sidebar {
  background: #fdfdfd;
  border-right: 1px solid rgba(0,0,0,0.05);
}

.inbox-header {
  padding: 24px 20px 16px;
  background: transparent;
}

.inbox-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inbox-filters select {
  appearance: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 99px; /* Pill shape */
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237E8499' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

[data-theme="light"] .inbox-filters select {
  background: rgba(0,0,0,0.04);
}

.inbox-filters select:hover {
  background: rgba(255,255,255,0.08);
}

.inbox-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px 12px; /* Padding for floating items */
}

/* Scrollbar for inbox list */
.inbox-list::-webkit-scrollbar { width: 4px; }
.inbox-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.inbox-item {
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
}

.inbox-item:hover {
  background: rgba(255,255,255,0.03);
}

[data-theme="light"] .inbox-item:hover {
  background: rgba(0,0,0,0.02);
}

.inbox-item.active {
  background: rgba(255,255,255,0.06);
}

[data-theme="light"] .inbox-item.active {
  background: rgba(0,0,0,0.05);
}

.inbox-item-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
  object-fit: cover;
}

[data-theme="light"] .inbox-item-avatar {
  background: rgba(0,0,0,0.05);
}

.inbox-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.inbox-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.inbox-item-header strong {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.inbox-item-header small {
  font-size: 11px;
  color: var(--text-muted);
}

.inbox-item-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MAIN CHAT AREA */
.inbox-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #111117;
  position: relative;
}

[data-theme="light"] .inbox-main {
  background: #f8f9fc;
}

.inbox-chat-header {
  padding: 20px 30px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

[data-theme="light"] .inbox-chat-header {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.inbox-chat-messages {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.msg-row {
  display: flex;
  width: 100%;
}

.msg-row.left {
  justify-content: flex-start;
}

.msg-row.right {
  justify-content: flex-end;
}

.msg-bubble {
  max-width: 60%;
  padding: 14px 18px;
  border-radius: 20px;
  position: relative;
  font-size: 14px;
  line-height: 1.5;
}

/* Client messages (left) */
.msg-in {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

[data-theme="light"] .msg-in {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* Bot messages (right) */
.msg-bot {
  background: rgba(109, 74, 255, 0.15);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

[data-theme="light"] .msg-bot {
  background: rgba(109, 74, 255, 0.08);
}

/* Operator messages (right) */
.msg-op {
  background: var(--accent); /* #6D4AFF */
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(109, 74, 255, 0.3);
}

.msg-op .msg-time, .msg-op .msg-sender {
  color: rgba(255,255,255,0.7);
}

.msg-sender {
  display: none; /* Hide sender name inside bubble for cleaner look, like screenshot */
}

.msg-text {
  word-wrap: break-word;
  white-space: pre-wrap;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
  opacity: 0.8;
}

/* Chat avatar beside bubbles */
.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  margin-right: 12px;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
}

.msg-row.right .msg-avatar {
  margin-right: 0;
  margin-left: 12px;
}

.msg-sys {
  text-align: center;
  margin: 16px 0;
}

.msg-sys span {
  display: inline-block;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
}

/* CHAT COMPOSER */
.inbox-chat-composer {
  padding: 20px 30px;
  background: transparent;
  display: flex;
  gap: 12px;
  align-items: center;
}

.inbox-chat-composer input {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 14px 20px;
  border-radius: 99px; /* Pill shape like screenshot */
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
}

[data-theme="light"] .inbox-chat-composer input {
  border: 1px solid rgba(0,0,0,0.1);
  background: #ffffff;
}

.inbox-chat-composer input:focus {
  border-color: rgba(109, 74, 255, 0.5);
  background: rgba(255,255,255,0.02);
  outline: none;
}

.inbox-chat-composer input::placeholder {
  color: rgba(255,255,255,0.3);
}

[data-theme="light"] .inbox-chat-composer input::placeholder {
  color: rgba(0,0,0,0.3);
}

.inbox-chat-composer input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Send Button styled as icon pill */
.inbox-chat-composer button {
  border-radius: 99px;
  padding: 0 24px;
  height: 48px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.inbox-chat-composer button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.inbox-chat-composer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
