/*
 * xLoyalty Chatbot — εμφάνιση
 * Τα χρώματα ταιριάζουν με τον pricing calculator (#0F1B3D / #FF6B35).
 */

#xlb-root {
  --xlb-navy:   #0F1B3D;
  --xlb-accent: #FF6B35;
  --xlb-blue:   #3B7DDD;
  --xlb-ink:    #1E293B;
  --xlb-muted:  #64748B;
  --xlb-line:   #E2E8F0;
  position: fixed;
  z-index: 2147482000;
  bottom: 20px; right: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
#xlb-root[data-pos="left"] { right: auto; left: 20px; }
#xlb-root * { box-sizing: border-box; }

/* ───────────────────────────────── κουμπί */

.xlb-launcher {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--xlb-navy); color: #fff;
  border: 0; border-radius: 30px;
  padding: 13px 20px; cursor: pointer;
  font-size: 14.5px; font-weight: 600; font-family: inherit;
  box-shadow: 0 6px 24px rgba(15, 27, 61, .32);
  transition: transform .18s, box-shadow .18s;
}
.xlb-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15, 27, 61, .4); }
.xlb-launcher:focus-visible { outline: 3px solid var(--xlb-accent); outline-offset: 3px; }
#xlb-root.xlb-open .xlb-launcher { display: none; }

/* ───────────────────────────────── παράθυρο */

.xlb-window {
  width: 390px; max-width: calc(100vw - 32px);
  height: 580px; max-height: calc(100vh - 110px);
  background: #fff; border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(15, 27, 61, .3);
  animation: xlb-pop .22s ease-out;
}
@keyframes xlb-pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.xlb-head {
  background: var(--xlb-navy); color: #fff;
  padding: 15px 18px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.xlb-head-name { font-size: 15px; font-weight: 700; }
.xlb-x {
  background: none; border: 0; color: rgba(255, 255, 255, .7);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.xlb-x:hover { color: #fff; }
.xlb-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ───────────────────────────────── μηνύματα */

.xlb-body {
  flex: 1; overflow-y: auto;
  padding: 16px 16px 8px;
  background: #F8FAFC;
  scroll-behavior: smooth;
}

.xlb-msg { display: flex; margin-bottom: 10px; }
.xlb-msg.xlb-user { justify-content: flex-end; }

.xlb-bubble {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px; line-height: 1.6;
  color: var(--xlb-ink);
  background: #fff; border: 1px solid var(--xlb-line);
  border-bottom-left-radius: 4px;
  overflow-wrap: anywhere;
}
.xlb-user .xlb-bubble {
  background: var(--xlb-navy); color: #fff; border-color: var(--xlb-navy);
  border-bottom-left-radius: 14px; border-bottom-right-radius: 4px;
}

.xlb-bubble p  { margin: 0 0 8px; }
.xlb-bubble p:last-child { margin-bottom: 0; }
.xlb-bubble ul { margin: 6px 0 8px; padding-left: 18px; }
.xlb-bubble li { margin-bottom: 4px; }
.xlb-bubble strong { font-weight: 700; }
.xlb-bubble a { color: var(--xlb-blue); }

.xlb-table { width: 100%; border-collapse: collapse; margin: 8px 0 10px; font-size: 12.5px; }
.xlb-table th {
  text-align: left; font-weight: 700; color: var(--xlb-muted);
  border-bottom: 1.5px solid var(--xlb-ink); padding: 0 6px 5px 0; font-size: 11px;
  text-transform: uppercase; letter-spacing: .4px;
}
.xlb-table td { padding: 6px 6px 6px 0; border-bottom: 1px solid var(--xlb-line); vertical-align: top; }
.xlb-mo { color: var(--xlb-muted); font-size: 11px; }

/* γράφει… */
.xlb-typing { display: flex; gap: 4px; padding: 14px; }
.xlb-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1;
  animation: xlb-dot 1.1s infinite;
}
.xlb-typing span:nth-child(2) { animation-delay: .18s; }
.xlb-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes xlb-dot { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }

/* ───────────────────────────────── κουμπιά θεμάτων */

.xlb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px 2px; }
.xlb-chip {
  background: #fff; border: 1px solid var(--xlb-blue); color: var(--xlb-blue);
  border-radius: 16px; padding: 7px 13px;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s, color .15s;
}
.xlb-chip:hover { background: var(--xlb-blue); color: #fff; }
.xlb-chip:focus-visible { outline: 2px solid var(--xlb-accent); outline-offset: 2px; }

/* ───────────────────────────────── φόρμα */

.xlb-form { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.xlb-form input[type="text"],
.xlb-form input[type="email"],
.xlb-form input[type="tel"],
.xlb-form textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--xlb-line); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--xlb-ink);
  background: #fff;
}
.xlb-form input:focus, .xlb-form textarea:focus {
  outline: 0; border-color: var(--xlb-blue); box-shadow: 0 0 0 3px rgba(59, 125, 221, .15);
}
.xlb-row { display: flex; gap: 7px; }
.xlb-row input { flex: 1; min-width: 0; }

/* honeypot — αόρατο για ανθρώπους, ορατό για bots */
.xlb-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; }

.xlb-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--xlb-muted); line-height: 1.5; }
.xlb-consent input { margin-top: 2px; flex-shrink: 0; }
.xlb-consent a { color: var(--xlb-blue); }

.xlb-submit {
  background: var(--xlb-accent); color: #fff; border: 0; border-radius: 8px;
  padding: 11px; font-size: 13.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; margin-top: 3px;
}
.xlb-submit:hover:not(:disabled) { background: #E55A2B; }
.xlb-submit:disabled { opacity: .6; cursor: default; }

.xlb-err { font-size: 12px; color: #DC2626; font-weight: 600; }
.xlb-ok  { color: #16A34A; font-weight: 600; margin: 0; }

/* ───────────────────────────────── γραμμή εισαγωγής */

.xlb-input {
  display: flex; gap: 8px; padding: 11px 13px;
  border-top: 1px solid var(--xlb-line); background: #fff; flex-shrink: 0;
}
.xlb-input input {
  flex: 1; min-width: 0; padding: 10px 13px;
  border: 1px solid var(--xlb-line); border-radius: 20px;
  font-size: 13.5px; font-family: inherit; color: var(--xlb-ink);
}
.xlb-input input:focus { outline: 0; border-color: var(--xlb-blue); }
.xlb-input button {
  width: 40px; height: 40px; flex-shrink: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--xlb-navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.xlb-input button:hover { background: var(--xlb-blue); }
.xlb-input button:focus-visible { outline: 3px solid var(--xlb-accent); outline-offset: 2px; }

/* ───────────────────────────────── κινητό */

@media (max-width: 480px) {
  #xlb-root { bottom: 14px; right: 14px; left: 14px; }
  #xlb-root[data-pos="left"] { left: 14px; right: 14px; }
  .xlb-launcher-text { display: none; }
  .xlb-launcher { padding: 15px; border-radius: 50%; margin-left: auto; display: flex; }
  #xlb-root { display: flex; flex-direction: column; align-items: flex-end; }
  .xlb-window { width: 100%; height: calc(100vh - 90px); }
}

@media (prefers-reduced-motion: reduce) {
  .xlb-window { animation: none; }
  .xlb-typing span { animation: none; opacity: .6; }
  .xlb-launcher { transition: none; }
  .xlb-body { scroll-behavior: auto; }
}
