/* =====================================================
   ISO 27001:2022 AI Consulting Bot — iso27001-bot.css
   TechX Digital Solutions
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

/* ── Variables ── */
:root {
  --iso-blue:      #1a56db;
  --iso-blue-dk:   #1e40af;
  --iso-blue-lt:   #eff6ff;
  --iso-blue-bd:   #bfdbfe;
  --iso-green:     #10b981;
  --iso-text:      #1e293b;
  --iso-muted:     #64748b;
  --iso-border:    #e2e8f0;
  --iso-bg:        #f8fafc;
  --iso-white:     #ffffff;
  --iso-radius:    16px;
  --iso-font:      'Plus Jakarta Sans', system-ui, sans-serif;
  --iso-shadow:    0 16px 56px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.08);
}

/* ── Launcher Button ── */
#iso-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--iso-blue), var(--iso-blue-dk));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(26,86,219,0.5);
  z-index: 9997;
  transition: transform 0.2s, box-shadow 0.2s;
}
#iso-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(26,86,219,0.6);
}

/* Unread badge */
#iso-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--iso-font);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--iso-white);
}

/* ── Chat Window ── */
#iso-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 400px;
  max-height: 620px;
  border-radius: var(--iso-radius);
  background: var(--iso-white);
  border: 0.5px solid var(--iso-border);
  box-shadow: var(--iso-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  font-family: var(--iso-font);
}
#iso-window.open {
  display: flex;
  animation: isoSlideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes isoSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── Header ── */
.iso-hdr {
  background: linear-gradient(135deg, var(--iso-blue), var(--iso-blue-dk));
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.iso-hdr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.iso-hdr-name {
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 2px;
}
.iso-hdr-status {
  color: rgba(255,255,255,0.75);
  font-size: 11.5px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.iso-dot {
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(52,211,153,0.3);
}
.iso-hdr-close {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 7px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.iso-hdr-close:hover { background: rgba(255,255,255,0.28); }

/* ── Message Feed ── */
.iso-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--iso-bg);
  scroll-behavior: smooth;
}
.iso-feed::-webkit-scrollbar { width: 4px; }
.iso-feed::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ── Messages ── */
.iso-row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  animation: isoFadeIn 0.22s ease;
}
@keyframes isoFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.iso-row.bot  { align-self: flex-start; max-width: 92%; }
.iso-row.user { align-self: flex-end;   max-width: 80%; flex-direction: row-reverse; }

.iso-av {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--iso-blue), var(--iso-blue-dk));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.iso-bbl {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--iso-text);
}
.iso-row.bot  .iso-bbl {
  background: var(--iso-white);
  border: 0.5px solid var(--iso-border);
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.iso-row.user .iso-bbl {
  background: linear-gradient(135deg, var(--iso-blue), #2563eb);
  color: #fff;
  border-radius: 14px 4px 14px 14px;
}
.iso-bbl strong { font-weight: 600; }
.iso-bbl br + br { display: block; content: ""; margin-top: 2px; }

/* ── Timestamp ── */
.iso-ts {
  font-size: 10.5px;
  color: var(--iso-muted);
  margin-top: 4px;
  padding: 0 2px;
}
.iso-row.user .iso-ts { text-align: right; }

/* ── Contact Card ── */
.iso-contact {
  margin-top: 10px;
  background: var(--iso-blue-lt);
  border: 0.5px solid var(--iso-blue-bd);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
}
.iso-contact-title {
  font-weight: 600;
  font-size: 11px;
  color: var(--iso-blue-dk);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 9px;
}
.iso-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e3a8a;
  margin-bottom: 6px;
  font-size: 13px;
}
.iso-contact-row:last-of-type { margin-bottom: 10px; }
.iso-contact-row svg { width: 13px; height: 13px; flex-shrink: 0; }
.iso-contact-row a { color: #1d4ed8; font-weight: 500; text-decoration: none; }
.iso-contact-row a:hover { text-decoration: underline; }
.iso-contact-actions {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}
.iso-contact-actions a {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}
.iso-contact-actions a:hover { opacity: 0.88; }
.cta-call  { background: var(--iso-blue);   color: #fff; }
.cta-wa    { background: #25d366;            color: #fff; }
.cta-email { background: var(--iso-white); color: var(--iso-blue); border: 0.5px solid var(--iso-blue-bd); }

/* ── Typing Indicator ── */
.iso-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  background: var(--iso-white);
  border: 0.5px solid var(--iso-border);
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  width: fit-content;
}
.iso-typing span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: isoBounce 1.3s infinite ease-in-out;
}
.iso-typing span:nth-child(2) { animation-delay: 0.18s; }
.iso-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes isoBounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: 0.5; }
  40%           { transform: translateY(-6px); opacity: 1;   }
}

/* ── Suggested Question Chips ── */
.iso-chips {
  padding: 8px 14px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--iso-white);
  border-top: 0.5px solid var(--iso-border);
}
.iso-chip {
  background: var(--iso-blue-lt);
  border: 0.5px solid var(--iso-blue-bd);
  color: #1d4ed8;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--iso-font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.iso-chip:hover { background: #dbeafe; border-color: #93c5fd; }

/* ── Input Bar ── */
.iso-bar {
  background: var(--iso-white);
  border-top: 0.5px solid var(--iso-border);
  padding: 10px 12px 8px;
  flex-shrink: 0;
}
.iso-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.iso-input {
  flex: 1;
  resize: none;
  border: 0.5px solid var(--iso-border);
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: var(--iso-font);
  background: var(--iso-bg);
  color: var(--iso-text);
  outline: none;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
  max-height: 110px;
  overflow-y: auto;
}
.iso-input:focus { border-color: var(--iso-blue); background: var(--iso-white); }
.iso-input::placeholder { color: #94a3b8; }
.iso-send {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--iso-blue), #2563eb);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
}
.iso-send:hover  { opacity: 0.9; }
.iso-send:active { transform: scale(0.95); }
.iso-send:disabled { opacity: 0.45; cursor: not-allowed; }
.iso-bar-note {
  text-align: center;
  font-size: 10.5px;
  color: #94a3b8;
  margin: 6px 0 0;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  #iso-window  { width: calc(100vw - 24px); right: 12px; bottom: 88px; max-height: 75vh; }
  #iso-launcher { right: 12px; bottom: 18px; }
  .iso-chips { display: none; }
}
