/* =========================================================
   FLOATING CHAT WIDGET (GAZKOO)
   ========================================================= */
.gz-chat-root {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 9999;
  font-family: var(--font-sans);
}

.gz-chat-launcher {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  border: 1px solid #133628;
  background: #133628;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(19, 54, 40, 0.24);
  transition:
    transform 100ms ease-out,
    background-color 140ms ease-out,
    border-color 140ms ease-out;
  position: relative;
}

.gz-chat-launcher:hover {
  background: #0d261c;
  border-color: #fd850b;
}

.gz-chat-launcher:active {
  transform: scale(0.98);
}

.gz-chat-launcher svg {
  width: 20px;
  height: 20px;
}

.gz-chat-launcher-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: #fd850b;
  border: 2px solid #ffffff;
}

@keyframes gzChatPopIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gz-chat-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  width: 368px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100svh - 118px);
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e8ecea;
  box-shadow: 0 12px 32px rgba(11, 15, 13, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: gzChatPopIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Home View */
.gz-chat-home {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px 20px;
  background: linear-gradient(
    180deg,
    #133628 0%,
    #1e4d3b 32%,
    #7f9d90 62%,
    #f1f5f3 86%,
    #ffffff 100%
  );
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gz-chat-home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gz-chat-brand-circle {
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.gz-chat-brand-circle img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.gz-chat-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease;
}

.gz-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.gz-chat-close-btn svg {
  width: 16px;
  height: 16px;
}

.gz-chat-greeting {
  color: #ffffff;
  margin-bottom: 8px;
  padding: 0 2px;
}

.gz-chat-greeting h2 {
  margin: 0;
  font-size: 1.52rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* Home Cards */
.gz-chat-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  padding: 15px 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition:
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.gz-chat-card:hover {
  border-color: rgba(19, 54, 40, 0.18);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.09);
}

.gz-chat-card-kicker {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
}

.gz-chat-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gz-chat-recent-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.gz-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: #eef4f1;
  border: 1px solid rgba(19, 54, 40, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  padding: 6px;
}

.gz-chat-avatar img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.gz-chat-avatar-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: #22c55e;
  border: 2px solid #ffffff;
}

.gz-chat-recent-text {
  min-width: 0;
}

.gz-chat-recent-text strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gz-chat-recent-text span {
  display: block;
  font-size: 0.77rem;
  color: #6b7280;
  margin-top: 2px;
}

.gz-chat-chevron {
  width: 18px;
  height: 18px;
  color: #133628;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gz-chat-send-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gz-chat-send-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

.gz-chat-send-sub {
  display: block;
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 2px;
}

.gz-chat-send-circle {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: #133628;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.16s ease;
}

.gz-chat-card:hover .gz-chat-send-circle {
  background: #1b4b38;
}

.gz-chat-send-circle svg {
  width: 16px;
  height: 16px;
}

/* Messages View */
.gz-chat-messages-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f9fafb;
}

.gz-chat-msg-header {
  background: #133628;
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gz-chat-msg-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gz-chat-msg-header-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.25;
}

.gz-chat-msg-header-info span {
  display: block;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 1px;
}

.gz-chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gz-chat-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 84%;
}

.gz-chat-bubble-row.bot {
  align-self: flex-start;
}

.gz-chat-bubble-row.user {
  align-self: flex-end;
}

.gz-chat-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.48;
}

.gz-chat-bubble-row.bot .gz-chat-bubble {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.gz-chat-bubble-row.user .gz-chat-bubble {
  background: #133628;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.gz-chat-bubble-time {
  font-size: 0.68rem;
  color: #9ca3af;
  margin-top: 4px;
  padding: 0 3px;
}

.gz-chat-bubble-row.user .gz-chat-bubble-time {
  text-align: right;
}

.gz-chat-quick-prompts {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gz-chat-quick-prompts::-webkit-scrollbar {
  display: none;
}

.gz-chat-chip {
  flex-shrink: 0;
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #1f2937;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gz-chat-chip:hover:not(:disabled) {
  background: #f3f7f5;
  border-color: #133628;
  color: #133628;
}

.gz-chat-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gz-chat-quota-banner {
  margin: 0 12px 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
}

.gz-chat-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.gz-chat-compose input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 9px 14px;
  font-size: 0.84rem;
  color: #111827;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.gz-chat-compose input:focus {
  border-color: #133628;
  background: #ffffff;
}

.gz-chat-compose input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.gz-chat-compose-btn {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: none;
  background: #133628;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.gz-chat-compose-btn:hover:not(:disabled) {
  background: #1b4b38;
}

.gz-chat-compose-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.gz-chat-compose-btn svg {
  width: 15px;
  height: 15px;
}

/* Bottom Tab Bar (Beranda / Pesan) */
.gz-chat-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.gz-chat-tab {
  position: relative;
  border: none;
  background: transparent;
  padding: 10px 8px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.16s ease;
}

.gz-chat-tab.is-active {
  color: #133628;
  font-weight: 600;
}

.gz-chat-tab.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 2px;
  border-radius: 9999px;
  background: #133628;
}

.gz-chat-tab svg {
  width: 18px;
  height: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .gz-chat-panel {
    animation: none;
  }
}

@media (max-width: 720px) {
  .gz-chat-root {
    right: 16px;
    bottom: 18px;
  }
  .gz-chat-panel {
    width: calc(100vw - 32px);
    bottom: 62px;
  }
}
