/* File: nutribrat-chat/assets/css/public.css */
/* Izgled A, Klasični panel (Marko 26.10.2026.). Sve je pod .nbchat-root, da ne curi u Divi. */

.nbchat-root {
  --nb-primary: #104f29;
  --nb-hover: #0c3d20;
  --nb-accent: #2ea66d;
  --nb-border: #b2dbc7;
  --nb-card: #f3f8f6;
  --nb-text: #333333;
  --nb-text-2: #444444;
  --nb-text-3: #555555;
  --nb-tint: #e7f5ec;
  --nb-line: #dcebd8;
  --nb-field: #5f957a;
  --nb-error: #b00020;
  --nb-font: 'Quicksand', sans-serif;
  position: fixed;
  bottom: 18px;
  z-index: 99999;
  font-family: var(--nb-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--nb-text);
}
.nbchat-root.nbchat-right { right: 18px; }
.nbchat-root.nbchat-left { left: 18px; }
.nbchat-root *, .nbchat-root *::before, .nbchat-root *::after { box-sizing: border-box; }
.nbchat-root [hidden] { display: none !important; } /* Divi zna prepisati display, a hidden mora vrijediti */
.nbchat-root button { font-family: inherit; }
.nbchat-root button:focus-visible,
.nbchat-root a:focus-visible,
.nbchat-root input:focus-visible,
.nbchat-root textarea:focus-visible { outline: 3px solid var(--nb-primary); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }

.nbchat-sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
  margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important; border: 0 !important;
}

/* ---------- gumb za otvaranje ---------- */
.nbchat-launcher {
  display: flex; align-items: center; gap: 10px;
  background: var(--nb-primary); color: #fff; border: 0; border-radius: 30px;
  padding: 10px 18px 10px 10px; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 79, 41, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.nbchat-launcher:hover { background: var(--nb-hover); transform: translateY(-2px); }
.nbchat-root.is-open .nbchat-launcher { display: none; }
.nbchat-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--nb-primary);
  font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.nbchat-avatar--lg { width: 40px; height: 40px; font-size: 14px; }

/* ---------- oblačić s pozdravom ---------- */
.nbchat-peek {
  position: absolute; bottom: 64px; width: 270px; max-width: calc(100vw - 36px);
  background: #fff; border: 1px solid var(--nb-line); border-radius: 14px 14px 4px 14px;
  box-shadow: 0 10px 25px rgba(16, 79, 41, 0.12);
}
.nbchat-right .nbchat-peek { right: 0; }
.nbchat-left .nbchat-peek { left: 0; border-radius: 14px 14px 14px 4px; }
.nbchat-peek__open {
  display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 14px 36px 14px 16px; font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--nb-text);
}
.nbchat-peek__close {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; background: none;
  font-size: 20px; line-height: 1; color: var(--nb-text-3); cursor: pointer; border-radius: 50%;
}
.nbchat-peek.is-attention { animation: nbchat-nudge 0.6s ease 2; }
@keyframes nbchat-nudge { 50% { transform: translateY(-4px); } }

/* ---------- prozor ---------- */
.nbchat-window {
  position: absolute; bottom: 0; width: 360px; height: 560px; max-height: calc(100vh - 36px);
  background: #fff; border: 1px solid var(--nb-line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 14px 40px rgba(16, 79, 41, 0.22);
  display: flex; flex-direction: column;
}
.nbchat-right .nbchat-window { right: 0; }
.nbchat-left .nbchat-window { left: 0; }

.nbchat-header {
  background: var(--nb-primary); color: #fff; padding: 14px 12px 14px 16px;
  display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
}
.nbchat-header__text { min-width: 0; }
.nbchat-root .nbchat-title { margin: 0; padding: 0; font-family: inherit; font-size: 16px; font-weight: 700; color: #fff; line-height: 1.3; letter-spacing: 0; text-transform: none; }
.nbchat-subtitle { margin: 2px 0 0; font-size: 12.5px; color: #fff; opacity: 0.92; line-height: 1.35; }
.nbchat-close {
  margin-left: auto; width: 36px; height: 36px; border: 0; background: none; color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer; border-radius: 50%; flex: 0 0 auto;
}
.nbchat-close:hover { background: rgba(255, 255, 255, 0.14); }
.nbchat-header .nbchat-close:focus-visible { outline-color: #fff; }

.nbchat-chatview { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.nbchat-body {
  flex: 1 1 auto; overflow-y: auto; padding: 16px; background: var(--nb-card);
  display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain;
}
.nbchat-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.nbchat-msg--bot { background: #fff; border: 1px solid var(--nb-line); border-bottom-left-radius: 4px; align-self: flex-start; }
.nbchat-msg--user { background: var(--nb-primary); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.nbchat-msg a { color: var(--nb-primary); font-weight: 700; text-decoration: underline; }
.nbchat-msg--user a { color: #fff; }
.nbchat-affnote { display: block; margin-top: 6px; font-size: 12.5px; color: var(--nb-text-3); }
.nbchat-typing { display: flex; gap: 4px; padding: 12px 13px; }
.nbchat-typing .nbchat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nb-field); animation: nbchat-dot 1.2s infinite ease-in-out; }
.nbchat-typing .nbchat-dot:nth-child(3) { animation-delay: 0.15s; }
.nbchat-typing .nbchat-dot:nth-child(4) { animation-delay: 0.3s; }
@keyframes nbchat-dot { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.nbchat-footer { border-top: 1px solid var(--nb-line); padding: 10px 12px 8px; background: #fff; flex: 0 0 auto; }
.nbchat-input { display: flex; gap: 8px; align-items: center; }
.nbchat-input input {
  flex: 1 1 auto; min-width: 0; border: 1px solid var(--nb-field); border-radius: 22px; padding: 10px 14px;
  font: inherit; font-size: 16px; color: var(--nb-text); background: #fff;
}
.nbchat-send {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; border: 0; background: var(--nb-primary);
  color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.nbchat-send:hover { background: var(--nb-hover); }
.nbchat-send:disabled { opacity: 0.55; cursor: default; }

.nbchat-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.nbchat-cta {
  background: #fff; color: var(--nb-primary); border: 2px solid var(--nb-field); border-radius: 8px;
  padding: 7px 12px; font-weight: 700; font-size: 14px; cursor: pointer; transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.nbchat-cta:hover { border-color: var(--nb-primary); background: var(--nb-tint); }
.nbchat-cta.is-highlighted { background: var(--nb-tint); border: 3px solid var(--nb-primary); padding: 6px 11px; box-shadow: 0 0 0 4px rgba(46, 166, 109, 0.22); }
.nbchat-cta.is-highlighted::before { content: "\2192\00a0"; } /* strelica, da istaknuto ne nosi samo boja */
.nbchat-cta.is-highlighted:focus-visible { box-shadow: 0 0 0 5px #fff; }
.nbchat-cta:disabled { opacity: 0.6; cursor: default; }
.nbchat-links { display: flex; gap: 12px; }
.nbchat-textbtn {
  background: none; border: 0; padding: 4px 0; font-size: 12.5px; color: var(--nb-text-3);
  text-decoration: underline; cursor: pointer;
}
.nbchat-textbtn:hover { color: var(--nb-primary); }

/* ---------- oblačić Privatnost ---------- */
.nbchat-pop {
  position: absolute; left: 14px; right: 14px; bottom: 108px; z-index: 2;
  background: #fff; border: 1px solid var(--nb-field); border-radius: 12px;
  box-shadow: 0 10px 25px rgba(16, 79, 41, 0.15); padding: 14px 40px 14px 16px;
  font-size: 13px; line-height: 1.55; color: var(--nb-text-2);
  max-height: calc(100% - 130px); overflow-y: auto; overscroll-behavior: contain;
}
@media (max-height: 420px) {
  .nbchat-pop { bottom: auto; top: 8px; max-height: calc(100% - 16px); }
}
.nbchat-pop__title { margin: 0 0 4px; color: var(--nb-primary); font-size: 14px; font-weight: 700; }
.nbchat-pop__text, .nbchat-pop__more { margin: 0 0 4px; }
.nbchat-pop a { color: var(--nb-primary); font-weight: 700; }
.nbchat-privacy-close {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; background: none;
  font-size: 20px; line-height: 1; color: var(--nb-text-3); cursor: pointer; border-radius: 50%;
}

/* ---------- obrazac ---------- */
.nbchat-lead { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px 16px; background: #fff; }
.nbchat-back { margin-bottom: 4px; }
.nbchat-lbl { display: block; font-size: 13px; font-weight: 700; color: var(--nb-text-2); margin: 10px 0 4px; }
.nbchat-field {
  width: 100%; border: 1px solid var(--nb-field); border-radius: 8px; padding: 9px 11px;
  font: inherit; font-size: 16px; color: var(--nb-text); background: #fff;
}
.nbchat-field[aria-invalid="true"] { border-color: var(--nb-error); }
.nbchat-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.nbchat-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--nb-text-2); margin: 12px 0 6px; }
.nbchat-consent input { margin-top: 3px; accent-color: var(--nb-primary); width: 16px; height: 16px; flex: 0 0 auto; }
.nbchat-err { margin: 4px 0 8px; min-height: 0; font-size: 13px; color: var(--nb-error); font-weight: 600; }
.nbchat-err:empty { margin: 0; }
.nbchat-submit {
  width: 100%; background: var(--nb-primary); color: #fff; border: 2px solid var(--nb-primary); border-radius: 8px;
  padding: 11px 16px; font-weight: 700; font-size: 15px; cursor: pointer; transition: background-color 0.2s ease;
}
.nbchat-submit:hover { background: var(--nb-hover); }
.nbchat-submit:disabled { opacity: 0.6; cursor: default; }

/* ---------- mobitel: prozor preko cijelog ekrana ---------- */
@media (max-width: 480px) {
  .nbchat-root.is-open { left: 0; right: 0; top: 0; bottom: 0; }
  .nbchat-root.is-open .nbchat-window {
    position: fixed; left: 0; right: 0; top: 0; bottom: 0; width: auto; height: auto; max-height: none;
    border-radius: 0; border: 0;
  }
  .nbchat-peek { width: min(270px, calc(100vw - 36px)); }
  .nbchat-textbtn { min-height: 44px; padding: 10px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .nbchat-root * { animation: none !important; transition: none !important; }
}
