/* =============================================================================
 * TNT Studio — PREMIUM AAA Messages Redesign
 * Clean, polished dark UI with subtle depth and smooth interactions
 * =========================================================================== */

/* -- Search bar -- */
#view-messages .msg-search-bar {
  padding: 16px 16px 12px;
  background: var(--bg);
  border-bottom: none;
  backdrop-filter: none;
}
#view-messages .msg-search-input {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 12px 16px 12px 42px;
  font-size: 15px;
  font-weight: 450;
  transition: all .2s ease;
}
#view-messages .msg-search-input:focus {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,107,26,.4);
  box-shadow: 0 0 0 4px rgba(255,107,26,.08), 0 4px 20px -4px rgba(0,0,0,.3);
}
#view-messages .msg-search-icon {
  left: 16px;
  font-size: 16px;
  opacity: .5;
}

/* -- Active strip -- */
#view-messages .msg-active-strip {
  padding: 14px 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
#view-messages .msg-active-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255,255,255,.35);
  padding: 0 18px 10px;
}
#view-messages .msg-active-row {
  gap: 14px;
  padding: 4px 16px 10px;
}
#view-messages .msg-active-chip {
  width: 66px;
  gap: 6px;
  transition: transform .15s ease;
}
#view-messages .msg-active-chip:active {
  transform: scale(.92);
}
#view-messages .msg-active-chip .msg-avatar {
  width: 54px; height: 54px;
  padding: 2.5px;
  background: linear-gradient(135deg, #ff6b1a, #ff3d7f, #ff6b1a);
  box-shadow: 0 4px 12px -4px rgba(255,107,26,.3);
}
#view-messages .msg-active-chip .msg-avatar .avatar,
#view-messages .msg-active-chip .msg-avatar .avatar-init {
  border: 2.5px solid var(--bg);
}
#view-messages .msg-active-chip .presence-dot {
  width: 11px; height: 11px;
  bottom: 2px; right: 2px;
  background: #22c55e;
  box-shadow: 0 0 0 2.5px var(--bg), 0 0 8px rgba(34,197,94,.5);
}
#view-messages .msg-active-name {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
}

/* -- Conversation list -- */
#view-messages .msg-list {
  padding: 2px 0 20px;
}
#view-messages .msg-row {
  padding: 14px 16px;
  gap: 14px;
  border-radius: 0;
  transition: background .12s ease;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
#view-messages .msg-row:hover {
  background: rgba(255,255,255,.03);
}
#view-messages .msg-row:active {
  background: rgba(255,255,255,.05);
  transform: scale(.995);
}

/* Avatar */
#view-messages .msg-avatar .avatar,
#view-messages .msg-avatar .avatar-init {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
#view-messages .msg-avatar .avatar-init {
  background: linear-gradient(135deg, #1e293b, #334155);
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
#view-messages .msg-avatar .presence-dot {
  width: 13px; height: 13px;
  border: 2.5px solid var(--bg);
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,.4);
  right: -1px; bottom: -1px;
}

/* Name / time / preview */
#view-messages .msg-name {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -.01em;
  color: rgba(255,255,255,.92);
}
#view-messages .msg-time {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.3);
}
#view-messages .msg-preview {
  font-size: 13.5px;
  color: rgba(255,255,255,.4);
  margin-top: 4px;
  font-weight: 400;
}
#view-messages .msg-preview.is-unread,
#view-messages .msg-row.unread .msg-preview {
  color: rgba(255,255,255,.75);
  font-weight: 600;
}

/* Unread indicator */
#view-messages .msg-row.unread::after {
  width: 10px; height: 10px;
  right: 18px;
  background: linear-gradient(135deg, #ff6b1a, #ff3d7f);
  box-shadow: 0 0 12px rgba(255,107,26,.6), 0 0 4px rgba(255,61,127,.4);
  border-radius: 50%;
  animation: none;
}
#view-messages .msg-unread-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff6b1a, #e8440a);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(255,107,26,.4);
}

/* Remove swipe elements */
#view-messages .msg-swipe-wrap {
  overflow: visible;
}
#view-messages .msg-swipe-surface {
  padding: 0;
  gap: 14px;
}
#view-messages .msg-swipe-actions {
  display: none !important;
}

/* -- Chat header -- */
#view-messages .chat-head {
  padding: 12px 16px;
  gap: 12px;
  background: rgba(10,10,18,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
#view-messages .chat-back {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.7);
  font-size: 18px;
  transition: all .15s ease;
  border: none;
}
#view-messages .chat-back:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
#view-messages .chat-head .avatar,
#view-messages .chat-head .avatar-init {
  width: 40px; height: 40px;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
#view-messages .chat-head-name {
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -.01em;
  color: rgba(255,255,255,.92);
}
#view-messages .chat-head-sub {
  font-size: 12px;
  color: rgba(255,255,255,.35);
  margin-top: 1px;
  font-weight: 500;
}
#view-messages .chat-head-actions {
  gap: 6px;
}
#view-messages .chat-head-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  border: none;
  color: rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}
#view-messages .chat-head-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
#view-messages .fps-corner {
  display: none !important;
}

/* -- Chat body -- */
#view-messages .chat-body {
  background: var(--bg);
  padding: 16px 14px 20px;
  gap: 3px;
}

/* -- Bubbles -- */
#view-messages .bubble {
  max-width: 75%;
  padding: 11px 16px;
  border-radius: 20px;
  font-size: 14.5px;
  line-height: 1.45;
  animation: bubbleFadeIn .2s ease-out;
  position: relative;
  letter-spacing: .005em;
}
@keyframes bubbleFadeIn {
  from { opacity: 0; transform: translateY(4px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#view-messages .bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff6b1a 0%, #e8440a 100%);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 16px -4px rgba(255,107,26,.4);
  border: none;
  font-weight: 450;
}
#view-messages .bubble.in {
  align-self: flex-start;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  border-bottom-left-radius: 6px;
  color: rgba(255,255,255,.9);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

#view-messages .bubble.group-cont.out {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 6px;
  margin-top: -1px;
}
#view-messages .bubble.group-cont.in {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 6px;
  margin-top: -1px;
}

/* Bubble meta */
#view-messages .bubble-meta {
  margin-top: 4px;
  gap: 5px;
}
#view-messages .bubble-time {
  font-size: 10.5px;
  color: rgba(255,255,255,.35);
  font-weight: 500;
}
#view-messages .bubble.out .bubble-time {
  color: rgba(255,255,255,.6);
}
#view-messages .bubble-status.seen {
  color: #22c55e;
  font-size: 13px;
}
#view-messages .bubble-status.sent {
  color: rgba(255,255,255,.45);
  font-size: 13px;
}
#view-messages .bubble-status.failed {
  color: #ef4444;
  font-weight: 700;
}

/* Time / day separators */
#view-messages .bubble-time-sep {
  font-size: 11px;
  color: rgba(255,255,255,.25);
  font-weight: 600;
  text-align: center;
  padding: 12px 0 6px;
}
#view-messages .bubble-day-sep {
  text-align: center;
  padding: 16px 0 8px;
}
#view-messages .bubble-day-sep span {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  padding: 4px 14px;
  border-radius: 20px;
}

/* -- Compose bar -- */
#view-messages .chat-compose {
  padding: 12px 14px calc(var(--safe-bot, 0px) + 12px);
  background: rgba(10,10,18,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,.05);
  gap: 10px;
  align-items: flex-end;
}
#view-messages .chat-compose textarea {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 15px;
  color: rgba(255,255,255,.9);
  line-height: 1.4;
  min-height: 46px;
  transition: all .2s ease;
}
#view-messages .chat-compose textarea:focus {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,107,26,.3);
  box-shadow: 0 0 0 3px rgba(255,107,26,.06);
}
#view-messages .chat-compose textarea::placeholder {
  color: rgba(255,255,255,.3);
}
#view-messages .chat-send {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b1a, #e8440a);
  color: #fff;
  box-shadow: 0 4px 16px -4px rgba(255,107,26,.5);
  transition: all .15s ease;
  font-size: 18px;
}
#view-messages .chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px -4px rgba(255,107,26,.6);
}
#view-messages .chat-send:active {
  transform: scale(.9);
}
#view-messages .chat-compose-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(255,255,255,.4);
  transition: all .15s ease;
  font-size: 18px;
}
#view-messages .chat-compose-btn:hover {
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.05);
}

/* -- Typing indicator -- */
#view-messages .bubble.typing {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 14px 18px;
}
#view-messages .bubble.typing .tdot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  animation: tdotBounce .6s ease-in-out infinite;
}
#view-messages .bubble.typing .tdot:nth-child(2) { animation-delay: .1s; }
#view-messages .bubble.typing .tdot:nth-child(3) { animation-delay: .2s; }
@keyframes tdotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .3; }
  30% { transform: translateY(-4px); opacity: .8; }
}

/* -- Kebab menu -- */
#view-messages .msg-kebab {
  color: rgba(255,255,255,.2);
  font-size: 16px;
  transition: color .15s;
}
#view-messages .msg-kebab:hover {
  color: rgba(255,255,255,.6);
}
.msg-kebab-menu {
  background: rgba(20,20,30,.97) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.3) !important;
  padding: 6px 0 !important;
  overflow: hidden;
}
.msg-kebab-menu .msg-kebab-item {
  padding: 10px 18px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,.8) !important;
  transition: background .12s !important;
}
.msg-kebab-menu .msg-kebab-item:hover {
  background: rgba(255,255,255,.06) !important;
}
.msg-kebab-menu .msg-kebab-item.danger {
  color: #ef4444 !important;
}

/* -- Call bubbles -- */
#view-messages .bubble-call {
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  padding: 12px 16px;
}
#view-messages .bubble-call--missed {
  border-color: rgba(239,68,68,.2);
  background: rgba(239,68,68,.04);
}

/* -- Media -- */
#view-messages .msg-media {
  border-radius: 16px;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
#view-messages .bubble.out .msg-media {
  border: none;
}
#view-messages .bubble.in .msg-media {
  border: none;
}

/* -- Empty states -- */
#view-messages .empty,
#view-messages .chat-empty {
  color: rgba(255,255,255,.3);
  font-size: 15px;
  font-weight: 500;
  padding: 60px 20px;
  text-align: center;
}

/* -- Skeleton loading -- */
#view-messages .msg-row.skeleton {
  opacity: .5;
}
#view-messages .msg-row.skeleton .msg-avatar,
#view-messages .sk-block {
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.03) 100%);
  background-size: 200% 100%;
  animation: skelShimmer 1.5s ease-in-out infinite;
}
#view-messages .sk-line {
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.03) 0%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.03) 100%);
  background-size: 200% 100%;
  animation: skelShimmer 1.5s ease-in-out infinite;
}

/* -- Slide transition -- */
#view-messages .chat.slide-in {
  animation: chatSlideIn .25s ease-out;
}
@keyframes chatSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* -- Emoji panel -- */
#view-messages .emoji-panel {
  background: rgba(15,15,25,.98);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.4);
  padding: 10px;
}
#view-messages .emoji-tabs {
  border-bottom: 1px solid rgba(255,255,255,.05);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
#view-messages .emoji-tab {
  border-radius: 10px;
  padding: 6px 8px;
  transition: background .12s;
}
#view-messages .emoji-tab.active {
  background: rgba(255,107,26,.12);
}
#view-messages .emoji-search {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  color: rgba(255,255,255,.9);
  padding: 8px 14px;
  font-size: 14px;
}
#view-messages .emoji-btn {
  border-radius: 8px;
  padding: 6px;
  transition: background .1s;
}
#view-messages .emoji-btn:hover {
  background: rgba(255,255,255,.06);
}

/* -- Scrollbar -- */
#view-messages ::-webkit-scrollbar {
  width: 5px;
}
#view-messages ::-webkit-scrollbar-track {
  background: transparent;
}
#view-messages ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08);
  border-radius: 10px;
}
#view-messages ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.15);
}

/* -- Search results -- */
#view-messages .msg-search-results {
  border-bottom: 1px solid rgba(255,255,255,.04);
}
#view-messages .msg-search-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: 10px 18px 8px;
}
#view-messages .msg-search-item {
  padding: 10px 16px;
  border-radius: 12px;
  margin: 2px 8px;
  transition: background .12s;
}
#view-messages .msg-search-item:hover {
  background: rgba(255,255,255,.04);
}
#view-messages .msg-search-name {
  font-weight: 600;
  font-size: 14px;
  color: rgba(255,255,255,.85);
}
#view-messages .msg-search-cta {
  font-size: 12px;
  font-weight: 700;
  color: #ff6b1a;
  letter-spacing: .02em;
}
