/* suporte.css — ajustes específicos do sistema de tickets (sobre auroria.css) */

/* ============================================================
   CHAT — Modern bubble layout
   ============================================================ */

.chat-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 520px;
  padding: 16px 12px;
  background: rgba(5, 8, 18, 0.72);
  border-radius: var(--r-md);
  border: 1px solid rgba(30, 46, 78, 0.7);
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.45);
  scroll-behavior: smooth;
}

/* Row: posiciona avatar + bolha */
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-row.own   { flex-direction: row-reverse; }
.chat-row.other { flex-direction: row; }
.chat-row.system {
  justify-content: center;
  margin: 4px 0;
}

/* Avatar com iniciais */
.chat-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-head);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
}
.chat-row.other .chat-avatar {
  background: linear-gradient(135deg, var(--bg-raised), #2a4a7a);
  border: 1px solid var(--border-main);
  color: var(--gold-mid);
}
.chat-row.own .chat-avatar {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: 1px solid rgba(201, 150, 42, 0.5);
  color: #07080f;
}

/* Wrapper da bolha */
.chat-bubble {
  max-width: 72%;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.chat-row.own   .chat-bubble { align-items: flex-end; }
.chat-row.other .chat-bubble { align-items: flex-start; }

/* Bolha */
.chat-bubble-body {
  padding: 9px 13px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}
.chat-row.other .chat-bubble-body {
  background: rgba(19, 31, 56, 0.92);
  border: 1px solid var(--border-main);
  border-radius: 14px 14px 14px 3px;
  color: var(--txt-body);
}
.chat-row.own .chat-bubble-body {
  background: linear-gradient(135deg, #3e2808 0%, #6a4a0c 55%, #5a3a06 100%);
  border: 1px solid rgba(201, 150, 42, 0.38);
  border-radius: 14px 14px 3px 14px;
  color: var(--txt-parchment);
}

/* Metadata: nome + hora */
.chat-bubble-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
}
.chat-row.own   .chat-bubble-meta { flex-direction: row-reverse; }
.chat-row.other .chat-bubble-meta { flex-direction: row; }

.chat-bubble-name {
  font-family: var(--ff-head);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.chat-row.other .chat-bubble-name { color: var(--gold-mid); }
.chat-row.own   .chat-bubble-name { color: var(--teal-light); }

.chat-bubble-time {
  font-size: 0.68rem;
  color: var(--txt-dim);
  white-space: nowrap;
}

/* ============================================================
   Estado da bolha (UI otimista)
   ============================================================ */
.chat-bubble-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  color: var(--txt-dim);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.chat-bubble-status i { font-size: 0.78rem; line-height: 1; }
.chat-bubble-status .status-text { white-space: nowrap; }

.chat-row.optimistic.sending .chat-bubble-body,
.chat-row.optimistic.uploading .chat-bubble-body {
  opacity: 0.78;
  position: relative;
}
.chat-row.optimistic.sending .chat-bubble-body::after,
.chat-row.optimistic.uploading .chat-bubble-body::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 45%,
    transparent 90%
  );
  background-size: 200% 100%;
  animation: aur-shimmer 1.4s linear infinite;
  pointer-events: none;
}
.chat-row.optimistic.sending .chat-bubble-status i,
.chat-row.optimistic.uploading .chat-bubble-status i {
  animation: aur-pulse 1.1s ease-in-out infinite;
}
.chat-row.optimistic.sent .chat-bubble-status {
  color: var(--online, #4ddd9a);
}
.chat-row.optimistic.failed .chat-bubble-body {
  border-color: rgba(220, 80, 80, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(220, 80, 80, 0.18);
}
.chat-row.optimistic.failed .chat-bubble-status {
  color: #ff8b8b;
}
.chat-bubble-status .retry-action,
.chat-bubble-status .discard-action {
  background: transparent;
  border: 1px solid rgba(220, 80, 80, 0.45);
  color: #ffb3b3;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.chat-bubble-status .retry-action:hover {
  background: rgba(220, 80, 80, 0.18);
  color: #ffd4d4;
}
.chat-bubble-status .discard-action {
  border-color: rgba(180, 180, 180, 0.3);
  color: var(--txt-muted);
  padding: 1px 6px;
}
.chat-bubble-status .discard-action:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--txt-body);
}

@keyframes aur-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes aur-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* Shake quando o usuário tenta enviar mensagem vazia */
@keyframes aur-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.aur-shake {
  animation: aur-shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
  border-color: rgba(220, 80, 80, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(220, 80, 80, 0.18) !important;
}

#ticket_mensagem {
  transition: height 90ms ease, border-color 120ms ease, box-shadow 120ms ease;
  min-height: 80px;
  max-height: 320px;
}

/* Mensagem de sistema (VALIDACAO_DONO, etc.) */
.chat-system-bubble {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(7, 12, 24, 0.78);
  border: 1px solid rgba(201, 150, 42, 0.22);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.78rem;
  color: var(--txt-muted);
  font-style: italic;
  max-width: 88%;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.chat-system-bubble i {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--gold-mid);
  font-style: normal;
}
.chat-system-bubble.validated i { color: var(--online); }
.chat-system-bubble.closure {
  background: rgba(60, 18, 22, 0.42);
  border-color: rgba(220, 110, 90, 0.42);
  color: rgba(252, 218, 210, 0.92);
}
.chat-system-bubble.closure i { color: rgba(255, 150, 130, 0.95); }
.chat-system-bubble.reopen {
  background: rgba(18, 50, 32, 0.42);
  border-color: rgba(90, 200, 130, 0.42);
  color: rgba(210, 252, 222, 0.92);
}
.chat-system-bubble.reopen i { color: rgba(130, 220, 150, 0.95); }
/* Painel staff: detalhes do encerramento */
.closure-field { margin-bottom: 0.6rem; }
.closure-field-label {
  font-family: var(--ff-head, inherit);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-bottom: 0.15rem;
}
.closure-field-value {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--txt-body);
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(201, 150, 42, 0.18);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
}
.aur-btn-sm {
  font-size: 0.72rem;
  padding: 0.32rem 0.7rem;
  letter-spacing: 0.1em;
}
.chat-system-bubble .chat-sys-time {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.65rem;
  color: var(--txt-dim);
  font-style: normal;
  margin-top: 2px;
}

.aur-card .form-control,
.aur-card .form-select,
.aur-card textarea {
  background: rgba(7, 12, 24, 0.88);
  border: 1px solid var(--border-main);
  color: var(--txt-parchment);
}

.aur-card .form-control:focus,
.aur-card .form-select:focus,
.aur-card textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 150, 42, 0.22);
}

.aur-hint {
  color: var(--txt-muted);
  font-size: 0.82rem;
}

.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: start;
  gap: 4px;
}

.stars input[type="radio"] { display: none; }
.stars label {
  color: rgba(122, 138, 172, 0.65);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, transform 0.1s ease;
}
.stars label:hover,
.stars label:hover ~ label,
.stars input[type="radio"]:checked ~ label {
  color: var(--gold-light);
}
.stars label:active { transform: translateY(1px); }

.upload-dropzone {
  border: 1px dashed rgba(201, 150, 42, 0.45);
  border-radius: var(--r-md);
  background: rgba(13, 22, 40, 0.45);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--gold-light);
  background: rgba(26, 42, 74, 0.55);
}
.upload-dropzone-title {
  font-family: var(--ff-head);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.upload-dropzone-hint {
  font-size: 0.78rem;
  color: var(--txt-muted);
  margin-top: 4px;
}

.attachments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.attachment-chip {
  background: rgba(7, 12, 24, 0.72);
  border: 1px solid rgba(30, 46, 78, 0.65);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  color: var(--txt-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.attachment-thumb {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(201,150,42,.28);
}
.attachment-remove {
  border: none;
  background: transparent;
  color: var(--gold-mid);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.owner-validation-box {
  border: 1px solid rgba(201,150,42,.22);
  border-radius: var(--r-md);
  padding: 10px;
  background: rgba(13,22,40,.38);
}

.chat-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-light);
  text-decoration: underline;
  font-size: 0.85rem;
}
.chat-attachment-link::before {
  content: '📎';
}
.chat-attachment-thumb {
  display: block;
  margin-top: 6px;
  max-width: 240px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid rgba(201,150,42,.35);
  object-fit: cover;
}

