:root {
  --adl-chat-accent: #ffba08;
  --adl-chat-accent-2: #ff8c00;
  --adl-chat-bg: #080b12;
  --adl-chat-panel: rgba(13, 17, 27, .96);
  --adl-chat-line: rgba(255, 186, 8, .22);
  --adl-chat-text: #f4f5f7;
  --adl-chat-muted: #aab0bd;
}

.adl-chatbot, .adl-chatbot * { box-sizing: border-box; }

.adl-chatbot {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 9998;
  font-family: Poppins, Rajdhani, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--adl-chat-text);
}

.adl-chat-launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 58px;
  height: 58px;
  padding: 0 19px;
  border: 1px solid rgba(255, 186, 8, .55);
  border-radius: 999px;
  color: #111;
  background: linear-gradient(135deg, #ffd45a, var(--adl-chat-accent-2));
  box-shadow: 0 10px 34px rgba(0, 0, 0, .38), 0 0 24px rgba(255, 186, 8, .12);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.adl-chat-launcher:hover { transform: translateY(-3px); box-shadow: 0 14px 38px rgba(0,0,0,.44), 0 0 28px rgba(255,186,8,.2); filter: brightness(1.04); }
.adl-chat-launcher:focus-visible, .adl-chatbot button:focus-visible, .adl-chatbot a:focus-visible {
  outline: 2px solid var(--adl-chat-accent); outline-offset: 3px;
}
.adl-chat-launcher svg { width: 23px; height: 23px; flex: 0 0 auto; }
.adl-chat-launcher-label { white-space: nowrap; }

/* PROZOR ZA RAČUNAR (Uvećan i komforan) */
.adl-chat-window {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  width: 480px; /* Povećano sa 390px */
  max-width: calc(100vw - 28px);
  height: 720px; /* Povećano sa 590px */
  max-height: calc(100dvh - 115px);
  min-height: 450px;
  overflow: hidden;
  border: 1px solid var(--adl-chat-line);
  border-radius: 20px;
  background: var(--adl-chat-panel);
  box-shadow: 0 24px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.035);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  transform-origin: bottom right;
  animation: adl-chat-in .22s ease both;
}
.adl-chat-window[hidden] { display: none; }
@keyframes adl-chat-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.adl-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(120deg, rgba(255,186,8,.09), transparent 65%);
}
.adl-chat-avatar {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,186,8,.42);
  border-radius: 13px;
  color: var(--adl-chat-accent);
  background: rgba(255,186,8,.09);
  overflow: hidden;
}
.adl-chat-avatar img { width: 100%; height: 100%; object-fit: contain; }
.adl-chat-heading { min-width: 0; flex: 1; }
.adl-chat-title { margin: 0; color: var(--adl-chat-text); font-size: 15px; font-weight: 700; line-height: 1.35; }
.adl-chat-subtitle { margin: 4px 0 0; color: var(--adl-chat-muted); font-size: 12px; line-height: 1.4; }
.adl-chat-online-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #42e86b; box-shadow: 0 0 9px rgba(66,232,107,.4); }
.adl-chat-close {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.09); border-radius: 10px;
  color: var(--adl-chat-muted); background: rgba(255,255,255,.035); cursor: pointer;
}
.adl-chat-close:hover { color: #fff; background: rgba(255,255,255,.09); }
.adl-chat-close svg { width: 17px; height: 17px; }

.adl-chat-messages {
  display: flex; flex: 1; flex-direction: column; gap: 13px;
  overflow-y: auto; padding: 17px 16px 14px;
  scrollbar-width: thin; scrollbar-color: rgba(255,186,8,.35) transparent;
}
.adl-chat-row { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; max-width: 94%; }
.adl-chat-row.is-user { align-self: flex-end; align-items: flex-end; }

/* KRUPNIJI TEKST PORUKA NA RAČUNARU */
.adl-chat-bubble {
  padding: 12px 15px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 14px 14px 14px 4px;
  color: var(--adl-chat-text);
  background: rgba(255,255,255,.055);
  font-size: 14px; /* Povećano sa 12px */
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.adl-chat-row.is-user .adl-chat-bubble {
  border-color: rgba(255,186,8,.2);
  border-radius: 14px 14px 4px 14px;
  color: #fff5d6; background: rgba(255,186,8,.12);
}
.adl-chat-time { padding: 0 4px; color: #7f8796; font-size: 10px; }

.adl-chat-quick { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 1px; }
.adl-chat-quick button {
  max-width: 100%; padding: 9px 12px; border: 1px solid rgba(255,186,8,.3);
  border-radius: 999px; color: #f4d98b; background: rgba(255,186,8,.055);
  font: inherit; font-size: 13px; line-height: 1.35; text-align: left; cursor: pointer; /* Povećan font dugmića */
  transition: background .18s ease, border-color .18s ease;
}
.adl-chat-quick button:hover { border-color: rgba(255,186,8,.65); background: rgba(255,186,8,.13); }

.adl-chat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.adl-chat-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 13px; border: 1px solid rgba(255,186,8,.36); border-radius: 10px;
  color: #111; background: var(--adl-chat-accent); font: inherit; font-size: 12px; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.adl-chat-action.secondary { color: var(--adl-chat-text); background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.13); }

.adl-chat-compose {
  display: flex; align-items: center; gap: 8px; padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.12);
}
.adl-chat-input {
  width: 100%; min-width: 0; height: 46px; padding: 0 14px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  color: var(--adl-chat-text); background: rgba(255,255,255,.045);
  font: inherit; font-size: 14px; outline: none; /* Povećan input */
}
.adl-chat-input::placeholder { color: #818998; }
.adl-chat-input:focus { border-color: rgba(255,186,8,.55); }
.adl-chat-send {
  display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto;
  border: 0; border-radius: 12px; color: #15120a; background: var(--adl-chat-accent); cursor: pointer;
}
.adl-chat-send:hover { background: #ffd15a; }
.adl-chat-send svg { width: 19px; height: 19px; }
.adl-chat-footnote {
  padding: 0 12px 10px;
  color: #ffbf00;
  background: rgba(0,0,0,.12);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 520px) {
  /* Na mobilnom podigni dugme iznad donjeg banera / fiksnog elementa. */
  .adl-chatbot { right: max(14px, env(safe-area-inset-right)); bottom: calc(90px + env(safe-area-inset-bottom)); }
  .adl-chat-launcher { width: 56px; min-width: 56px; height: 56px; padding: 0; border-radius: 50%; }
  .adl-chat-launcher-label { display: none; }
  .adl-chat-window {
    position: fixed; right: 10px; bottom: calc(78px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px); height: min(620px, calc(100dvh - 105px)); min-height: 360px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .adl-chat-window { animation: none; }
  .adl-chat-launcher, .adl-chat-quick button { transition: none; }
}

/* Contact details displayed directly inside the chat */
.adl-chat-contact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.adl-chat-contact-heading {
  display: block;
  color: var(--adl-accent, #ffba08);
  margin-bottom: 2px;
}
.adl-chat-contact-item {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.adl-chat-contact-item a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--adl-accent, #ffba08);
  text-underline-offset: 3px;
}
.adl-chat-contact-form-link {
  align-self: flex-start;
  margin-top: 2px;
  text-decoration: none;
}

@media (max-width: 768px) {
  .adl-chatbot {
    right: max(14px, env(safe-area-inset-right)) !important;
    bottom: calc(90px + env(safe-area-inset-bottom)) !important;
  }

  .adl-chat-launcher {
    width: 56px !important;
    min-width: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }

  .adl-chat-launcher-label {
    display: none !important;
  }

  /* Koristimo !important da poništimo širinu i visinu sa računara i otvorimo preko celog ekrana */
  .adl-chat-window:not([hidden]) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .adl-chat-messages {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .adl-chat-compose {
    flex: 0 0 auto !important;
    position: sticky !important;
    bottom: 0 !important;
    background: #111 !important;
  }
}
