/* ============================================================
   Disenis AI Chat Widget
   ============================================================ */

/* ── Toggle button ───────────────────────────────────────────── */
.dc-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.dc-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #ff2d78;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 45, 120, .4);
  transition: transform .2s, box-shadow .2s;
}
.dc-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255, 45, 120, .5);
}
.dc-toggle.is-open .dc-icon-chat { display: none; }
.dc-toggle.is-open .dc-icon-close { display: block !important; }

/* ── Chat panel ──────────────────────────────────────────────── */
.dc-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 440px;
  max-height: 680px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .15), 0 0 0 1px rgba(0, 0, 0, .05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dcSlideUp .3s ease;
}

@keyframes dcSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ──────────────────────────────────────────────────── */
.dc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #1d1d1f;
  color: #fff;
}

.dc-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ff2d78;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.dc-header-title {
  font-size: 15px;
  font-weight: 600;
}

.dc-header-status {
  font-size: 11px;
  color: #86868b;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dc-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
  display: inline-block;
}

.dc-header-close {
  border: none;
  background: none;
  color: #86868b;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .2s;
}
.dc-header-close:hover { color: #fff; }

/* ── Messages area ───────────────────────────────────────────── */
.dc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 400px;
  max-height: 500px;
  background: #f5f5f7;
}

/* ── Message bubbles ─────────────────────────────────────────── */
.dc-msg {
  display: flex;
  max-width: 85%;
}

.dc-msg-bot {
  align-self: flex-start;
}

.dc-msg-user {
  align-self: flex-end;
}

.dc-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.dc-msg-bot .dc-msg-bubble {
  background: #fff;
  color: #1d1d1f;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.dc-msg-user .dc-msg-bubble {
  background: #ff2d78;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Links in bot messages */
.dc-msg-bot .dc-msg-bubble a {
  color: #ff2d78;
  text-decoration: none;
  font-weight: 600;
}
.dc-msg-bot .dc-msg-bubble a:hover {
  text-decoration: underline;
}

/* Bold text */
.dc-msg-bot .dc-msg-bubble strong {
  font-weight: 700;
  color: #1d1d1f;
}

/* ── Typing indicator ────────────────────────────────────────── */
.dc-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
}

.dc-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c7c7cc;
  animation: dcBounce 1.4s infinite ease-in-out both;
}
.dc-typing span:nth-child(1) { animation-delay: -.32s; }
.dc-typing span:nth-child(2) { animation-delay: -.16s; }

@keyframes dcBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ── Input area ──────────────────────────────────────────────── */
.dc-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e5e5ea;
  background: #fff;
}

.dc-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: #1d1d1f;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
  padding: 8px 0;
}
.dc-input::placeholder { color: #aeaeb2; }

.dc-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #ff2d78;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .2s, transform .15s;
}
.dc-send:disabled {
  opacity: .3;
  cursor: not-allowed;
}
.dc-send:not(:disabled):hover {
  transform: scale(1.08);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .dc-panel {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    right: -8px;
  }
  .dc-messages {
    min-height: 200px;
    max-height: calc(100vh - 280px);
  }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
.dc-messages::-webkit-scrollbar { width: 4px; }
.dc-messages::-webkit-scrollbar-track { background: transparent; }
.dc-messages::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: 2px; }
#hubspot-messages-iframe-container, .widget-visible, #hs-chat-open, #hubspot-conversations-inline-parent, #hubspot-conversations-inline-iframe, [data-hubspot-rendered], iframe[src*="hubspot"], .hs-messages-widget-open, .shadow-container { display: none !important; visibility: hidden !important; }

/* ── Suggestion buttons ──────────────────────────────────────── */
.dc-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dc-suggest-btn { background: #fff; border: 1.5px solid #e5e5ea; border-radius: 20px; padding: 6px 14px; font-size: 13px; font-weight: 500; color: #1d1d1f; cursor: pointer; transition: all .2s; white-space: nowrap; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.dc-suggest-btn:hover { border-color: #ff2d78; color: #ff2d78; background: #fff5f8; }
