/* ============================================================
   D-SMART — AI agent «Νίκος»
   Παλέτα ευθυγραμμισμένη με το dsmart.gr:
   graphite #232527 · signal #8CD2F0
   Όλοι οι selectors έχουν πρόθεμα .nk- ώστε να μην επηρεάζουν
   τίποτα άλλο στο site.
   ============================================================ */

.nk {
  --nk-graphite: #232527;
  --nk-graphite-2: #2c2f32;
  --nk-graphite-3: #383c40;
  --nk-signal: #8cd2f0;
  --nk-signal-deep: #4aa8ce;
  --nk-ink: #f2f5f7;
  --nk-ink-dim: #a7b0b6;
  --nk-surface: #ffffff;
  --nk-line: rgba(255, 255, 255, .1);
  --nk-radius: 18px;
  --nk-shadow: 0 18px 50px rgba(10, 12, 14, .38);

  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
}

.nk *,
.nk *::before,
.nk *::after { box-sizing: border-box; }

/* Σημείωση: το reset δεν ορίζει background ή color. Ο selector «.nk button»
   έχει μεγαλύτερη ειδικότητα από τα «.nk-launcher / .nk-send / .nk-chip»
   και θα ακύρωνε τα χρώματά τους. */
.nk button {
  font: inherit;
  cursor: pointer;
  border: 0;
  letter-spacing: normal;
  text-transform: none;
}
.nk :focus-visible { outline: 2px solid var(--nk-signal); outline-offset: 2px; border-radius: 6px; }

/* ── Launcher ─────────────────────────────────────────────── */

.nk-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 20px 7px 7px;
  background: var(--nk-graphite);
  color: var(--nk-ink);
  border-radius: 999px;
  box-shadow: var(--nk-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.nk-launcher:hover { transform: translateY(-2px); box-shadow: 0 22px 56px rgba(10, 12, 14, .46); }
.nk-launcher img { width: 46px; height: 46px; border-radius: 50%; display: block; }

.nk-launcher-text { text-align: left; }
.nk-launcher-name { font-weight: 600; letter-spacing: .01em; }
.nk-launcher-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--nk-ink-dim);
}

.nk-dot {
  flex: none;
  align-self: center;
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nk-signal);
  box-shadow: 0 0 0 0 rgba(140, 210, 240, .6);
  animation: nk-pulse 2.6s ease-out infinite;
}
@keyframes nk-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(140, 210, 240, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(140, 210, 240, 0); }
  100% { box-shadow: 0 0 0 0 rgba(140, 210, 240, 0); }
}

.nk[data-open="true"] .nk-launcher { display: none; }

/* ── Panel ────────────────────────────────────────────────── */

.nk-panel {
  display: none;
  flex-direction: column;
  width: min(392px, calc(100vw - 32px));
  height: min(624px, calc(100vh - 44px));
  background: var(--nk-surface);
  border-radius: var(--nk-radius);
  box-shadow: var(--nk-shadow);
  overflow: hidden;
}
.nk[data-open="true"] .nk-panel {
  display: flex;
  animation: nk-rise .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes nk-rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* Header */
.nk-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--nk-graphite);
  color: var(--nk-ink);
}
.nk-head img { width: 42px; height: 42px; border-radius: 50%; display: block; }
.nk-head-meta { flex: 1; min-width: 0; }
.nk-head-name { font-weight: 600; }
.nk-head-role {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--nk-ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nk-close {
  background: transparent;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--nk-ink-dim);
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease;
}
.nk-close:hover { background: rgba(255, 255, 255, .08); color: var(--nk-ink); }

/* Μηνύματα */
.nk-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 8px;
  background: #f6f8f9;
  color: #1a1d1f;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nk-log::-webkit-scrollbar { width: 8px; }
.nk-log::-webkit-scrollbar-thumb { background: #d3dade; border-radius: 8px; }

.nk-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.nk-msg img { width: 30px; height: 30px; border-radius: 50%; flex: none; margin-top: 2px; }

.nk-bubble {
  padding: 11px 14px;
  border-radius: 14px;
  background: #fff;
  color: #1a1d1f;
  box-shadow: 0 1px 2px rgba(35, 37, 39, .07);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
/* Το site έχει δικά του global styles για p / ul / li / a. Τα ουδετεροποιούμε
   εδώ, αλλιώς «περνούν» μέσα στις φούσκες του chat. */
.nk-bubble p,
.nk-bubble ul,
.nk-bubble li,
.nk-bubble strong,
.nk-bubble a {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.55;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  max-width: none;
}
.nk-bubble p { margin: 0 0 .6em; }
.nk-bubble p:last-child { margin-bottom: 0; }
.nk-bubble ul { margin: .3em 0 .6em; padding-left: 1.15em; list-style: disc; }
.nk-bubble li { margin: .18em 0; padding: 0; }
.nk-bubble li::marker { color: var(--nk-signal-deep); }
.nk-bubble a {
  color: var(--nk-signal-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: inherit;
}
.nk-msg.nk-me .nk-bubble a { color: var(--nk-signal); }
.nk-bubble strong { font-weight: 600; }

.nk-msg.nk-me { flex-direction: row-reverse; }
.nk-msg.nk-me .nk-bubble {
  background: var(--nk-graphite);
  color: var(--nk-ink);
  border-bottom-right-radius: 5px;
}
.nk-msg.nk-bot .nk-bubble { border-bottom-left-radius: 5px; }

/* Πηγές */
.nk-sources {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #e7ebed;
  font-size: 12.5px;
  color: #6b757b;
}
.nk-sources a {
  display: block;
  color: var(--nk-signal-deep);
  margin-top: 3px;
  font-size: inherit;
  font-family: inherit;
  text-decoration: none;
}
.nk-sources a:hover { text-decoration: underline; }

/* Κατάσταση αναζήτησης */
.nk-thinking { display: flex; align-items: center; gap: 8px; color: #6b757b; font-size: 13.5px; }
.nk-thinking span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--nk-signal-deep);
  animation: nk-blink 1.3s ease-in-out infinite;
}
.nk-thinking span:nth-child(2) { animation-delay: .18s; }
.nk-thinking span:nth-child(3) { animation-delay: .36s; }
@keyframes nk-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.nk-error {
  background: #fff4f2;
  color: #8c2f1c;
  border: 1px solid #f4d5cd;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 13.5px;
}

/* Έτοιμες ερωτήσεις */
.nk-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 6px 40px; }
.nk-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #d6dee2;
  background: #fff;
  color: #384046;
  font-size: 13px;
  transition: border-color .15s ease, color .15s ease;
}
.nk-chip:hover { border-color: var(--nk-signal-deep); color: var(--nk-signal-deep); }

/* Είσοδος */
.nk-foot { border-top: 1px solid #e7ebed; background: #fff; padding: 10px 12px 8px; }
.nk-form { display: flex; align-items: flex-end; gap: 8px; }
.nk-input {
  flex: 1;
  resize: none;
  max-height: 116px;
  padding: 10px 12px;
  border: 1px solid #d6dee2;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.45;
  color: #1a1d1f;
  background: #fff;
}
.nk-input:focus { outline: none; border-color: var(--nk-signal-deep); }
.nk-send {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--nk-graphite);
  color: var(--nk-signal);
  display: grid;
  place-items: center;
  transition: opacity .15s ease;
}
.nk-send[disabled] { opacity: .4; cursor: not-allowed; }

.nk-actions { display: flex; gap: 8px; margin-top: 8px; }
.nk-action {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  background: #eef4f7;
  color: #2b3236;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s ease;
}
.nk-action:hover { background: #e1ecf2; }

.nk-legal {
  margin: 7px 2px 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #939ca2;
  text-align: center;
  max-width: none;
  font-family: inherit;
}

/* Mobile: πλήρης οθόνη */
@media (max-width: 520px) {
  .nk { right: 14px; bottom: 14px; }
  .nk-launcher { padding-right: 16px; }
  .nk[data-open="true"] {
    inset: 0;
    right: 0;
    bottom: 0;
  }
  .nk[data-open="true"] .nk-panel {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nk *, .nk *::before, .nk *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
