/* ═══════════════════════════════════════════════════════════════════════
   DGA Chatbot — Main Styles
   Brand: #1B8354 (green) | Font: IBM Plex Sans Arabic
   Replaces the original style2.css — purple brand removed
═══════════════════════════════════════════════════════════════════════ */

/* ── Outer wrapper ────────────────────────────────────────────────────── */
.fabs {
  position: fixed;
  bottom: 0;
  left: 0;
  margin: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
}

/* ── Chat window ──────────────────────────────────────────────────────── */
.chat {
  width: 340px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  border: 1px solid #D1D5DB;
  /* Hidden by default — shown via .is-visible toggled by script.js */
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95) translateY(8px);
  transform-origin: bottom left;
  transition: opacity .25s ease, transform .25s ease;
  order: 0;
}

.chat.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

/* Fullscreen override */
.chat_fullscreen {
  position: fixed;
  inset: 0;
  width: 100%;
  border-radius: 0;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.chat_header {
  background: #1B8354;
  padding: 14px 16px;
}

.chat_option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: right;
  font-size: 1rem;
}

.chat_fullscreen_loader {
  display: none;
  float: right;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.6;
  margin: -10px 10px;
  color: #fff;
}

/* Avatar */
.header_img img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.35);
  display: block;
  background: #fff;
}

/* ── Login / Welcome screen ───────────────────────────────────────────── */
.chat_body {
  background: #fff;
  width: 100%;
  display: inline-block;
  text-align: center;
  overflow-y: auto;
}

.chat_login {
  padding: 28px 20px 24px;
  background: #F7FDF9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #E5E7EB;
}

.chat_body p {
  font-family: 'IBM Plex Sans Arabic', Tahoma, sans-serif;
  font-size: .875rem;
  color: #374151;
  line-height: 1.7;
  padding: 0;
  margin: 0;
}

.chat_body a {
  width: auto;
  text-align: center;
  border: none;
  box-shadow: none;
  line-height: normal;
  font-size: .875rem;
}

/* ── Conversation area ────────────────────────────────────────────────── */
.chat_converse {
  position: relative;
  background: #F9FAFB;
  height: 380px;
  min-height: 0;
  font-size: .875rem;
  line-height: 1.6;
  overflow-y: auto;
  width: 100%;
  float: none;
  direction: rtl;
  font-family: 'IBM Plex Sans Arabic', Tahoma, sans-serif;
  border-radius: 0;
}

/* ── Tooltip label ────────────────────────────────────────────────────── */
.chatlbldiv {
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: 'IBM Plex Sans Arabic', Tahoma, sans-serif;
  font-size: .8125rem;
  color: #374151;
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
  line-height: 1.5;
  cursor: pointer;
  transition: box-shadow .2s;
  order: 1;
}

.chatlbldiv:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.14);
}

.chatlbldiv b {
  color: #1B8354;
  display: block;
}

/* ── Floating Action Button ───────────────────────────────────────────── */
.fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1B8354;
  color: #fff;
  box-shadow: 0 4px 16px rgba(27,131,84,.45);
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  text-decoration: none;
  position: relative;
  z-index: 9999;
  order: 2;
  border: none;
}

.fab:not(:last-child) {
  /* unused secondary fabs */
  width: 0;
  height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fab:not(:last-child).is-visible {
  width: 40px;
  height: 40px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#prime:hover {
  background: #14573A;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(27,131,84,.55);
}

#prime.is-float {
  box-shadow: 0 6px 20px rgba(27,131,84,.55);
}

/* Pulse ring */
#prime::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(27,131,84,.5);
  animation: chatPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes chatPulse {
  0%   { transform: scale(1);    opacity: 1; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

.fab > i { display: none; } /* original icon element — replaced with SVG */

/* ── Input field (at bottom of chat) ─────────────────────────────────── */
.fab_field {
  width: 100%;
  display: inline-block;
  text-align: center;
  background: #fff;
  border-top: 1px solid #eee;
  border-bottom-right-radius: 16px;
  border-bottom-left-radius: 16px;
}

.fab_field a { display: inline-block; text-align: center; }

.fab_field .fab {
  width: 34px;
  height: 34px;
  box-shadow: none;
  margin: 5px;
  order: unset;
}

.fab_field .fab > i {
  display: block;
  font-size: 1.4em;
  line-height: 34px;
  color: #9CA3AF;
}

.fab_field .fab > i:hover { color: #1B8354; }

/* ── Scrollbar ────────────────────────────────────────────────────────── */
.chat_converse::-webkit-scrollbar { width: 5px; }
.chat_converse::-webkit-scrollbar-track { border-radius: 0; background: transparent; }
.chat_converse::-webkit-scrollbar-thumb { border-radius: 10px; background: rgba(27,131,84,.2); }

/* ── Animations ───────────────────────────────────────────────────────── */
@keyframes zoomIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.chat_login p,
.chat_body li,
.chat_body p,
.chat_body a {
  animation: zoomIn .5s cubic-bezier(.42, 0, .58, 1);
}

/* ── State classes ────────────────────────────────────────────────────── */
.is-hide { opacity: 0; }
.is-active { transform: rotate(180deg); transition: transform .3s ease-in-out; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 480px) { .chat { width: 290px; } }
@media (max-width: 360px) { .chat { width: 260px; } }
