/* ============================================================
   DLProject AI — Sales Assistant Widget
   dl-ai-widget.css  (dlproject.tech — isti widget kao io/travel)

   Aesthetic: clean single-line character look — v2 restyle 2026-07-02.
   Palette: teal #0d9488/#14b8a6, navy #0a1322, violet #8b5cf6 (AI dot only).
   Fonts: Outfit.
   Scoped under #dl-ai so it never clashes with site styles.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Outfit:wght@300;400;500;600&display=swap');

#dl-ai,
#dl-ai * {
  box-sizing: border-box;
}

#dl-ai {
  --dl-lava: #0d9488;
  --dl-lava-light: #14b8a6;
  --dl-lava-deep: #0a5568;
  --dl-vio: #8b5cf6;
  --dl-dark: #0a1322;
  --dl-dark-soft: #0d1830;
  --dl-cream: #f6fafc;
  --dl-cream-2: #eef5f8;
  --dl-text: #0f2430;
  --dl-muted: #5b7280;
  --dl-border: #dfeaf0;
  --dl-radius: 18px;
  --dl-shadow: 0 18px 50px rgba(6, 11, 20, 0.25);

  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--dl-text);
}

/* ---- Floating launcher ---- */
#dl-ai .dl-ai-launcher {
  position: relative;
  height: 56px;
  border: 1px solid rgba(59, 130, 246, 0.55);
  border-radius: 999px;
  background: #0d1b3e;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(6, 11, 20, 0.5), 0 0 20px rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0 22px 0 15px;
}

#dl-ai .dl-ai-launcher-label {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.8px;
  line-height: 1;
  color: #ffffff;
}

#dl-ai .dl-ai-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.45), 0 0 22px rgba(250, 204, 21, 0.22);
}

#dl-ai .dl-ai-launcher svg {
  width: 58px;
  height: 36px;
  display: block;
  color: #facc15;
}

/* "živa linija" — crta oblačić, otkuca tačkice, otrči dalje */
#dl-ai .dl-ai-line {
  stroke-dasharray: 100;
  animation: dlAiDraw 6.5s ease-in-out infinite;
}
#dl-ai .dl-ai-dots circle { opacity: 0; }
#dl-ai .dl-ai-dots circle:nth-child(1) { animation: dlAiDot 6.5s infinite; }
#dl-ai .dl-ai-dots circle:nth-child(2) { animation: dlAiDot 6.5s 0.25s infinite; }
#dl-ai .dl-ai-dots circle:nth-child(3) { animation: dlAiDot 6.5s 0.5s infinite; }
@keyframes dlAiDraw {
  0% { stroke-dashoffset: 100; }
  30% { stroke-dashoffset: 0; }
  72% { stroke-dashoffset: 0; }
  95% { stroke-dashoffset: -100; }
  100% { stroke-dashoffset: -100; }
}
@keyframes dlAiDot {
  0%, 32% { opacity: 0; }
  40%, 64% { opacity: 1; }
  70%, 100% { opacity: 0; }
}

/* ---- Chat panel ---- */
#dl-ai .dl-ai-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 372px;
  max-width: calc(100vw - 44px);
  height: 540px;
  max-height: calc(100vh - 130px);
  background: var(--dl-cream);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  box-shadow: var(--dl-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#dl-ai.dl-ai-open .dl-ai-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#dl-ai.dl-ai-open .dl-ai-launcher {
  transform: scale(0.9);
}

/* ---- Header ---- */
#dl-ai .dl-ai-header {
  background: var(--dl-dark);
  color: var(--dl-cream);
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(45, 212, 191, 0.4);
}

#dl-ai .dl-ai-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

#dl-ai .dl-ai-avatar {
  width: 52px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: 999px;
  background: #0d1b3e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #facc15;
}

#dl-ai .dl-ai-avatar svg {
  width: 34px;
  height: 21px;
  display: block;
}

#dl-ai .dl-ai-header-title {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.4px;
  color: #2dd4bf;
  line-height: 1.1;
}

#dl-ai .dl-ai-header-sub {
  font-size: 12px;
  font-weight: 300;
  opacity: 0.7;
  margin-top: 2px;
  letter-spacing: 0.2px;
}

#dl-ai .dl-ai-close {
  background: transparent;
  border: none;
  color: var(--dl-cream);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 8px;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;
}

#dl-ai .dl-ai-close:hover {
  opacity: 1;
  color: #2dd4bf;
}

/* ---- Messages ---- */
#dl-ai .dl-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--dl-cream);
}

#dl-ai .dl-ai-messages::-webkit-scrollbar { width: 8px; }
#dl-ai .dl-ai-messages::-webkit-scrollbar-thumb {
  background: rgba(20, 184, 166, 0.35);
  border-radius: 8px;
}

#dl-ai .dl-ai-msg {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14.5px;
}

#dl-ai .dl-ai-msg.dl-ai-bot {
  align-self: flex-start;
  background: #ffffff;
  color: var(--dl-text);
  border: 1px solid var(--dl-border);
  border-bottom-left-radius: 5px;
}

#dl-ai .dl-ai-msg.dl-ai-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--dl-lava), var(--dl-lava-light));
  color: #ffffff;
  font-weight: 500;
  border-bottom-right-radius: 5px;
}

/* Typing indicator */
#dl-ai .dl-ai-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 13px 15px;
  background: #ffffff;
  border: 1px solid var(--dl-border);
  border-radius: 14px;
  border-bottom-left-radius: 5px;
}

#dl-ai .dl-ai-typing span {
  width: 7px;
  height: 7px;
  background: var(--dl-lava);
  border-radius: 50%;
  opacity: 0.5;
  animation: dl-ai-bounce 1.2s infinite ease-in-out;
}

#dl-ai .dl-ai-typing span:nth-child(2) { animation-delay: 0.15s; }
#dl-ai .dl-ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dl-ai-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---- Quick replies ---- */
#dl-ai .dl-ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
  background: var(--dl-cream);
}

#dl-ai .dl-ai-quick button {
  border: 1px solid var(--dl-lava);
  background: transparent;
  color: var(--dl-lava-deep);
  border-radius: 20px;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

#dl-ai .dl-ai-quick button:hover {
  background: linear-gradient(135deg, var(--dl-lava), var(--dl-lava-light));
  color: #ffffff;
}

/* ---- Composer ---- */
#dl-ai .dl-ai-composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--dl-border);
  background: #ffffff;
}

#dl-ai .dl-ai-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--dl-border);
  border-radius: 12px;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  max-height: 110px;
  outline: none;
  color: var(--dl-text);
  background: var(--dl-cream);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#dl-ai .dl-ai-input:focus {
  border-color: var(--dl-lava);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
  background: #fff;
}

#dl-ai .dl-ai-input::placeholder { color: #8fa5b3; }

#dl-ai .dl-ai-send {
  border: none;
  background: linear-gradient(135deg, var(--dl-lava), var(--dl-lava-light));
  color: #ffffff;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: filter 0.15s ease, transform 0.1s ease;
}

#dl-ai .dl-ai-send:hover { filter: brightness(1.07); }
#dl-ai .dl-ai-send:active { transform: scale(0.95); }
#dl-ai .dl-ai-send:disabled { opacity: 0.5; cursor: default; }
#dl-ai .dl-ai-send svg { width: 21px; height: 21px; }

#dl-ai .dl-ai-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 300;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--dl-muted);
  padding: 0 12px 11px;
  background: #ffffff;
}

#dl-ai .dl-ai-footnote a {
  color: var(--dl-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

#dl-ai .dl-ai-footnote a:hover {
  color: var(--dl-lava);
  text-decoration: underline;
}

#dl-ai .dl-ai-clear-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 300;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--dl-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

#dl-ai .dl-ai-clear-btn:hover {
  color: var(--dl-lava);
  text-decoration: underline;
}

/* ---- Exit-intent CTA (once per visit, on first close) ---- */
#dl-ai .dl-ai-exit-wrap {
  background: transparent;
  padding: 2px 0 4px;
  box-shadow: none;
}

#dl-ai .dl-ai-exit-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--dl-lava), var(--dl-lava-light));
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 12px;
  transition: filter 0.15s ease, transform 0.1s ease;
}

#dl-ai .dl-ai-exit-cta:hover { filter: brightness(1.07); }
#dl-ai .dl-ai-exit-cta:active { transform: scale(0.97); }

/* ---- Mobile ---- */
@media (max-width: 480px) {
  #dl-ai {
    right: 14px;
    bottom: 14px;
  }

  #dl-ai .dl-ai-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 92px);
    right: -2px;
    bottom: 74px;
    border-radius: 16px;
  }

  #dl-ai .dl-ai-launcher {
    height: 50px;
    padding: 0 16px 0 13px;
  }

  #dl-ai .dl-ai-launcher svg {
    width: 48px;
    height: 30px;
  }

  #dl-ai .dl-ai-launcher-label { font-size: 15px; }

  #dl-ai .dl-ai-header-title { font-size: 20px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #dl-ai .dl-ai-panel,
  #dl-ai .dl-ai-launcher,
  #dl-ai .dl-ai-typing span {
    transition: none;
    animation: none;
  }
  #dl-ai .dl-ai-line { animation: none; stroke-dashoffset: 0; }
  #dl-ai .dl-ai-dots circle { animation: none; opacity: 1; }
}
