/* Portfolio chat widget */

.gfq-wrap {
  z-index: 9999999;
  position: fixed;
  bottom: 40px;
  right: 40px;
}

.gfq-badge {
  background: #ffda08;
  position: relative;
  width: 64px;
  height: 64px;
  border: none;
  padding: 0;
  border-radius: 100%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease-in-out;
  transform: scale(1);
  float: right;
  cursor: pointer;
}

.gfq-badge:hover {
  transform: scale(1.08);
}

.gfq-panel {
  min-width: 380px;
  height: auto;
  max-width: 640px;
  width: 640px;
  max-height: 90vh;
  background: #f9fafa;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  position: absolute;
  bottom: 48px;
  right: 0;
  transition: all 0.28s ease;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #e7e7e7;
  display: none;
}

.gfq-panel.panel-active {
  bottom: 88px;
  display: block;
}

.vipul-chat-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 680px;
  max-height: min(82vh, 720px);
  background: #fff;
  font-family: "Inter", system-ui, sans-serif;
}

.gfq-panel.panel-active .vipul-chat-panel {
  display: flex;
}

.vipul-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #e7e7e7;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 243, 176, 0.45));
  flex-shrink: 0;
}

.vipul-chat-header__title {
  font-size: 17px;
  font-weight: 700;
  color: #262626;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vipul-chat-beta {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #262626;
  background: #ffda08;
  border-radius: 999px;
  line-height: 1.4;
  vertical-align: middle;
}

.vipul-chat-header__sub {
  font-size: 13px;
  color: #6e6e6e;
  margin: 3px 0 0;
}

.vipul-chat-close {
  width: 36px;
  height: 36px;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  background: #fff;
  color: #6e6e6e;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.vipul-chat-close:hover {
  background: #f7f7f7;
  color: #262626;
}

.vipul-chat-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 218, 8, 0.55);
}

.vipul-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafafa;
  -webkit-overflow-scrolling: touch;
}

.vipul-chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  overflow: visible;
  max-height: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vipul-chat-msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e7e7e7;
  color: #262626;
  border-bottom-left-radius: 5px;
}

.vipul-chat-msg--user {
  align-self: flex-end;
  background: #ffda08;
  color: #262626;
  border-bottom-right-radius: 5px;
}

.vipul-chat-msg--system {
  align-self: center;
  font-size: 12px;
  color: #6e6e6e;
  background: transparent;
  padding: 4px 8px;
  max-width: 100%;
}

.vipul-chat-turn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
}

.vipul-chat-turn .vipul-chat-msg {
  max-width: 85%;
}

.vipul-chat-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 16px;
  border-bottom-left-radius: 5px;
}

.vipul-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6e6e6e;
  animation: vipul-chat-bounce 1.2s infinite ease-in-out;
}

.vipul-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.vipul-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes vipul-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.vipul-chat-chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: transparent;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.vipul-chat-chips::-webkit-scrollbar {
  display: none;
}

.vipul-chat-chip {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e7e7e7;
  background: #fff;
  color: #262626;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.vipul-chat-chip:hover {
  border-color: #ffda08;
  background: #fff3b0;
}

.vipul-chat-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 218, 8, 0.45);
}

.vipul-chat-form {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e7e7e7;
  background: #fff;
  flex-shrink: 0;
}

.vipul-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e7e7e7;
  border-radius: 999px;
  font-size: 15px;
  font-family: inherit;
  color: #262626;
  outline: none;
}

.vipul-chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.vipul-chat-input:focus-visible {
  border-color: #ffda08;
  box-shadow: 0 0 0 3px rgba(255, 218, 8, 0.35);
}

.vipul-chat-send {
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: #ffda08;
  color: #262626;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.vipul-chat-send:hover:not(:disabled) {
  filter: brightness(1.05);
}

.vipul-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vipul-chat-send:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 218, 8, 0.55);
}

.gfq-badge img {
  position: absolute;
  left: 53%;
  top: 48%;
  transform: translate(-50%, -50%);
  border: none !important;
  width: 46% !important;
  height: auto !important;
  pointer-events: none;
}

@media (max-width: 720px) {
  .gfq-wrap {
    bottom: 20px;
    right: 20px;
  }

  .gfq-wrap.is-open .gfq-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000001;
  }

  .gfq-panel.panel-active {
    position: fixed;
    right: 12px;
    bottom: 88px;
    left: 12px;
    width: auto;
    max-width: none;
    min-width: 0;
    height: auto;
    max-height: min(75vh, 640px);
    border-radius: 16px;
    border: 1px solid #e7e7e7;
  }

  .vipul-chat-panel {
    height: min(75vh, 640px);
    max-height: min(75vh, 640px);
  }

  .vipul-chat-header {
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .vipul-chat-form {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
}
