/* =========================================================
   TCHAT STARTUP UI
   Skeleton loading sebelum status login Firebase diketahui
   ========================================================= */

body.tchat-booting > #login,
body.tchat-booting > #app {
  visibility: hidden !important;
}

#tchatBootScreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  background: #f7f9fc;
  color: #17212b;
  opacity: 1;
  visibility: visible;
  transition:
    opacity .22s ease,
    visibility .22s ease;
}

body.tchat-boot-ready #tchatBootScreen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tchat-boot-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 56px 320px minmax(0, 1fr);
  overflow: hidden;
}

/* =========================
   LEFT NAVIGATION
   ========================= */

.tchat-boot-rail {
  background: #ffffff;
  border-right: 1px solid #e5eaf0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 18px;
}

.tchat-boot-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg,#0b6bff,#00bfff);
  position: relative;
  overflow: hidden;
}

.tchat-boot-logo::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 6px;
  background: rgba(255,255,255,.35);
}

.tchat-boot-nav {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #edf3f9;
}

.tchat-boot-nav.small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-top: auto;
}

/* =========================
   CHAT LIST
   ========================= */

.tchat-boot-sidebar {
  background: #ffffff;
  border-right: 1px solid #e5eaf0;
  overflow: hidden;
}

.tchat-boot-sidebar-head {
  height: 72px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0f4;
}

.tchat-boot-brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tchat-boot-brand-main {
  width: 74px;
  height: 18px;
  border-radius: 6px;
}

.tchat-boot-brand-sub {
  width: 48px;
  height: 9px;
  border-radius: 5px;
}

.tchat-boot-action {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.tchat-boot-search {
  height: 42px;
  margin: 16px;
  border-radius: 11px;
}

.tchat-boot-security {
  height: 58px;
  margin: 0 16px 10px;
  border-radius: 11px;
}

.tchat-boot-chat {
  height: 72px;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf0f4;
}

.tchat-boot-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.tchat-boot-chat-text {
  flex: 1;
  min-width: 0;
}

.tchat-boot-line {
  height: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.tchat-boot-line.name {
  width: 80px;
}

.tchat-boot-line.message {
  width: 125px;
}

.tchat-boot-time {
  width: 30px;
  height: 8px;
  border-radius: 5px;
}

/* =========================
   CHAT AREA
   ========================= */

.tchat-boot-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
}

.tchat-boot-head {
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: #ffffff;
  border-bottom: 1px solid #e5eaf0;
}

.tchat-boot-title {
  flex: 1;
}

.tchat-boot-title-main {
  width: 90px;
  height: 13px;
  border-radius: 6px;
  margin-bottom: 7px;
}

.tchat-boot-title-sub {
  width: 60px;
  height: 8px;
  border-radius: 5px;
}

.tchat-boot-head-action {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

/* =========================
   MESSAGE AREA
   ========================= */

.tchat-boot-messages {
  flex: 1;
  min-height: 0;
  padding: 30px 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}

.tchat-boot-message {
  height: 42px;
  width: 180px;
  border-radius: 14px;
  align-self: flex-start;
}

.tchat-boot-message.short {
  width: 110px;
}

.tchat-boot-message.right {
  align-self: flex-end;
  width: 160px;
}

/* =========================
   COMPOSER
   ========================= */

.tchat-boot-composer {
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #ffffff;
  border-top: 1px solid #e5eaf0;
}

.tchat-boot-composer-action {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.tchat-boot-input {
  flex: 1;
  height: 44px;
  border-radius: 14px;
}

.tchat-boot-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

/* =========================
   SKELETON ANIMATION
   ========================= */

.tchat-boot-logo,
.tchat-boot-nav,
.tchat-boot-brand-main,
.tchat-boot-brand-sub,
.tchat-boot-action,
.tchat-boot-search,
.tchat-boot-security,
.tchat-boot-avatar,
.tchat-boot-line,
.tchat-boot-time,
.tchat-boot-title-main,
.tchat-boot-title-sub,
.tchat-boot-head-action,
.tchat-boot-message,
.tchat-boot-composer-action,
.tchat-boot-input,
.tchat-boot-send {
  background-image:
    linear-gradient(
      90deg,
      rgba(230,235,242,.75) 0%,
      rgba(248,250,252,.95) 50%,
      rgba(230,235,242,.75) 100%
    );

  background-size: 200% 100%;
  animation: tchatSkeleton 1.25s ease-in-out infinite;
}

@keyframes tchatSkeleton {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 700px) {

  .tchat-boot-shell {
    grid-template-columns: 1fr;
  }

  .tchat-boot-rail {
    display: none;
  }

  .tchat-boot-sidebar {
    display: none;
  }

  .tchat-boot-main {
    width: 100%;
  }

  .tchat-boot-head {
    height: 64px;
    padding: 0 14px;
  }

  .tchat-boot-messages {
    padding: 20px 14px;
  }

  .tchat-boot-composer {
    height: 64px;
    padding: 9px 10px;
  }

  .tchat-boot-input {
    height: 42px;
  }
}