/* Tampilan chat bersama + tema Pesan, WhatsApp, X, Instagram */

/* WhatsApp / chat (komponen bersama) */
.chat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}
.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 50px 10px 8px;
  background: var(--bar);
  border-bottom: 0.5px solid var(--sep);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2;
}
.chat-head .back {
  margin-left: 0;
}
.chat-who {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}
.chat-who .av {
  width: 38px;
  height: 38px;
}
.who-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.who-txt b {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who-sub {
  font-size: 12px;
  color: var(--sub);
}
.chat-actions {
  display: flex;
  gap: 14px;
  color: var(--blue);
}
.chat-actions button {
  width: 28px;
}
.chat-actions svg {
  width: 24px;
  height: 24px;
}
.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: none;
}
.msgs::-webkit-scrollbar {
  display: none;
}
.day-sep {
  align-self: center;
  margin: 12px 0 6px;
  font-size: 12px;
  color: var(--sub);
}
.b {
  position: relative;
  max-width: 76%;
  padding: 7px 12px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.3;
  word-wrap: break-word;
  animation: msgIn 0.22s ease-out;
}
.b.tail {
  margin-bottom: 6px;
}
.b.me {
  align-self: flex-end;
}
.b.them {
  align-self: flex-start;
}
.b-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #e0457b;
  margin-bottom: 1px;
}
.b-img {
  display: block;
  width: 210px;
  max-width: 100%;
  border-radius: 12px;
  cursor: zoom-in;
}
.b.only-img {
  padding: 3px;
  background: transparent !important;
}
.b.only-img .b-img {
  border-radius: 16px;
}
.b-text {
  white-space: pre-wrap;
}
.b-img + .b-text {
  display: block;
  margin-top: 6px;
}
.b-status {
  align-self: flex-end;
  font-size: 11px;
  color: var(--sub);
  margin: -2px 4px 4px;
}
@keyframes dot {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@keyframes msgIn {
  from {
    transform: translateY(8px) scale(0.97);
    opacity: 0;
  }
}
.chat-input {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 30px;
  background: var(--bar);
  border-top: 0.5px solid var(--sep);
}
.ci-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--sub);
  flex: none;
}
.ci-btn svg {
  width: 22px;
  height: 22px;
}
.ci-field {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 36px;
  border-radius: 18px;
  border: 1px solid var(--sep);
  background: var(--bg);
  padding: 0 4px 0 14px;
}
.ci-field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  font-size: 16px;
  min-width: 0;
  height: 34px;
}
.ci-field input:disabled {
  color: inherit;
  opacity: 0.6;
  cursor: default;
}
.ci-send {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  transform: scale(0);
  transition: transform 0.18s;
  flex: none;
}
.ci-send svg {
  width: 17px;
  height: 17px;
}
.chat.has-text .ci-send {
  transform: scale(1);
}
/* tema Pesan */
.t-im .chat-head {
  flex-direction: row;
  padding-bottom: 6px;
}
.t-im .chat-who {
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}
.t-im .chat-who .av {
  width: 50px;
  height: 50px;
}
.t-im .who-txt {
  align-items: center;
}
.t-im .who-txt b {
  font-size: 12px;
  font-weight: 400;
}
.t-im .chat-actions {
  width: 36px;
}
.t-im .b.me {
  background: #0b84fe;
  color: #fff;
}
.t-im .b.them {
  background: #e9e9eb;
  color: #000;
}
.screen.dark .t-im .b.them {
  background: #262629;
  color: #fff;
}
.t-im .b.tail.me {
  border-bottom-right-radius: 6px;
}
.t-im .b.tail.them {
  border-bottom-left-radius: 6px;
}
.t-im .ci-btn {
  background: var(--fill);
  color: var(--sub);
}
/* tema WhatsApp */
.t-wa {
  --bar: #f6f5f3;
}
.screen.dark .t-wa {
  --bar: #1f2c33;
}
.t-wa .msgs {
  background: #efeae2 radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1.4px) 0 0 / 18px 18px;
}
.screen.dark .t-wa .msgs {
  background: #0b141a radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1.4px) 0 0 / 18px 18px;
}
.t-wa .chat-actions {
  color: #1e9e79;
}
.t-wa .back {
  color: #1e9e79;
}
.t-wa .b {
  border-radius: 9px;
  padding: 6px 9px 7px;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 8px;
  font-size: 15.5px;
}
.t-wa .b.me {
  background: #d9fdd3;
  color: #111;
}
.t-wa .b.them {
  background: #fff;
  color: #111;
}
.screen.dark .t-wa .b.me {
  background: #005c4b;
  color: #e9edef;
}
.screen.dark .t-wa .b.them {
  background: #202c33;
  color: #e9edef;
}
.t-wa .b.first.me {
  border-top-right-radius: 2px;
}
.t-wa .b.first.them {
  border-top-left-radius: 2px;
}
.t-wa .b-img,
.t-wa .b-name {
  flex-basis: 100%;
}
.t-wa .b.only-img {
  background: #d9fdd3 !important;
  padding: 3px;
}
.t-wa .b.them.only-img {
  background: #fff !important;
}
.b-meta {
  margin-left: auto;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.45);
  display: flex;
  gap: 3px;
  align-items: center;
  line-height: 1;
  padding-top: 4px;
}
.screen.dark .b-meta {
  color: rgba(255, 255, 255, 0.55);
}
.tick {
  color: #8696a0;
  letter-spacing: -3px;
  font-size: 12px;
  padding-right: 3px;
}
.tick.read {
  color: #34b7f1;
}
.t-wa .ci-send {
  background: #1e9e79;
}
.t-wa .ci-btn {
  color: #1e9e79;
}
.t-wa .ci-field {
  border-radius: 20px;
}
/* tema X & Instagram */
.t-kc .b.me {
  background: #1d9bf0;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.t-kc .b.them {
  background: var(--fill);
  border-bottom-left-radius: 4px;
}
.t-kc .ci-btn,
.t-kc .chat-actions,
.t-kc .back {
  color: #1d9bf0;
}
.t-kc .ci-send {
  background: transparent;
  color: #1d9bf0;
}
.t-ls .b {
  border-radius: 22px;
}
.t-ls .b.me {
  background: linear-gradient(135deg, #7b4dff, #b24bf3);
  color: #fff;
}
.t-ls .b.them {
  background: var(--fill);
}
.t-ls .ci-field {
  border-radius: 22px;
  background: var(--fill);
  border: 0;
}
.t-ls .ci-btn {
  background: #3797f0;
  color: #fff;
}
.t-ls .ci-send {
  background: transparent;
  color: #3797f0;
}
.t-ls .chat-actions,
.t-ls .back {
  color: var(--text);
}
/* daftar percakapan */
.clist {
  background: var(--bg);
}
.crow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px 9px 6px;
  cursor: pointer;
}
.crow:active {
  background: var(--fill);
}
.crow + .crow .cmain {
  border-top: 0.5px solid var(--sep);
}
.crow .cmain {
  flex: 1;
  min-width: 0;
  padding: 4px 0 6px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.crow + .crow {
  margin-top: -1px;
}
.udot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  flex: none;
}
.udot.off {
  visibility: hidden;
}
.ctop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.ctop b {
  font-weight: 600;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctime {
  color: var(--sub);
  font-size: 14px;
  white-space: nowrap;
}
.cbot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.cprev {
  flex: 1;
  color: var(--sub);
  font-size: 15px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ucount {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #25d366;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.msg-list .ucount {
  display: none;
}
.wa .udot,
.x .udot,
.ig .udot {
  display: none;
}
.wa .crow,
.x .crow,
.ig .crow {
  padding-left: 16px;
}
.wa .ctime.hot {
  color: #1fa855;
  font-weight: 600;
}
.wa .cprev {
  -webkit-line-clamp: 1;
}
.ig .ucount,
.x .ucount {
  background: #3797f0;
}

/* Nomor tidak dikenal (WhatsApp) */
.wa-unknown {
  align-self: center;
  margin: 4px 16px 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--card);
  text-align: center;
  font-size: 13px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.wa-unknown p {
  margin: 0 0 8px;
  color: var(--sub);
}
.wa-unknown div {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.wa-unknown button {
  color: #00a884;
  font-weight: 600;
  font-size: 15px;
}
.wa-unknown button:first-child {
  color: var(--red);
}

/* Pesan panggilan tak terjawab */
.b.call-b {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: var(--fill) !important;
  color: var(--text) !important;
  cursor: pointer;
}
.call-ic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}
.call-ic svg {
  width: 17px;
  height: 17px;
  transform: rotate(135deg);
}
.call-txt b {
  display: block;
  font-size: 15px;
}
.call-txt small {
  color: var(--sub);
  font-size: 12px;
}

/* Chat grup: bubble orang lain bergeser ke kanan untuk tempat foto pengirim */
.b.them.in-grp {
  margin-left: 34px;
}
.b-av {
  position: absolute;
  left: -34px;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.t-im .b-av {
  top: auto;
  bottom: 0;
}

