:root {
  --primary: #0a6cff;
  --primary-600: linear-gradient(to right, #1c5baa, #ed1b24);
  --soft: #f4f7fb;
  --card-radius: 28px;
  --shadow: 0 12px 30px rgba(10,30,60,0.12);
}

html, body {
  height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

/* ---------- Backdrop ---------- */
.backdrop {
  position: fixed; inset:0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  display: none; z-index: 9990;
  transition: opacity .28s ease;
  opacity: 0;
}
.backdrop.visible { display:block; opacity:1; }

/* ---------- Chat bar (bottom collapsed) ---------- */
#chatbar {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 100px); 
  width: min(820px, 86%);
  max-width: 980px;
  background: linear-gradient(90deg, #fff);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  z-index: 10010;
  overflow: visible;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
  align-items: stretch;

  opacity: 0;
  transition: transform 0.6s cubic-bezier(.2,.9,.2,1), opacity 0.6s;
}

/* Visible state */
#chatbar.show-animate {
  opacity: 1;
  transform: translate(-50%, 0);
}

#chatbar.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(8px) scale(.995); }

/* Minimize button (dot above chatbar) */
.bar-minimize {
  position: absolute;
  right: 14px;
  top: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  font-size: 16px;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.06);
}

/* Bar row layout */
.bar-row { display:flex; gap:12px; align-items:center; }
.bar-left { display:flex; gap:10px; align-items:center; min-width:0; flex:1; }

.agent-avatar {
  width:46px; height:46px; border-radius:12px; background:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; color:var(--primary-600);
  box-shadow:0 6px 18px rgba(10,30,60,0.06);
  flex:0 0 46px;
}

/* Input pill */
.bar-input {
  display:flex; align-items:center; gap:10px;
  background:#fff;
  border-radius:15px;
  padding:10px 14px;
  flex:1;
  box-shadow:0 6px 18px rgba(10,30,60,0.04);
  min-width:0;
}
.bar-input input { border:none; outline:none; font-size:15px; width:100%; }
.send-thumb {
  width: 40px; 
  height: 40px; 
  border-radius: 50%;
  background: url(../images/send.png) no-repeat center;
  background-size: 110%;  
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,115,230,0.18);
}
#chatbar,
#chat-modal,
#messagesModal,
#rightPanel,
.bot-loading,
.bot-loading-line {
  font-family: 'Nunito', sans-serif;
}
  .bot-option-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  padding: 8px 14px;
  border: 1px solid #007bff;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.bot-option-btn:hover {
  background: #007bff;
  color: #fff;
}

/* Quick actions (pills) */
.quick-actions {
  display:flex; gap:10px; flex-wrap:wrap;
  padding:6px 6px 0;
}
/* Style for .pill buttons inside .quick-actions */
.quick-actions .pill {
  position: relative;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 12px;      
  background: #fff;
  color: black;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 4px 6px;
  z-index: 1;
  border: none;             
}

.quick-actions .pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px; /* border thickness */
  background: linear-gradient(to right, #1c5baa, #ed1b24);


  /* WebKit browsers */
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;

  /* Firefox */
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;

  z-index: -1;
}
.pill:hover {
  background: var(--primary-600);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 115, 230, 0.18);
}

/* ---------- Modal expanded chat ---------- */
#chat-modal {
  position: fixed;
  left: 50%;
  top: 66%;
  transform: translate(-50%,-50%) scale(.98);
  width: 1076px;
  max-width: calc(100% - 48px);
  height: 80vh;
  border-radius: 14px;
  background: linear-gradient(180deg,#ffffff 0%, #f7fbff 100%);
  box-shadow: 0 30px 80px rgba(3,18,38,0.44);
  z-index: 10020;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: transform 260ms cubic-bezier(.2,.9,.2,1), opacity 200ms;
}
#chat-modal.visible { display:flex; transform: translate(-50%,-50%) scale(1); }

/* Docked state */
#chat-modal.docked {
  left:auto !important;
  right:18px !important;
  top:80px !important;
  bottom:80px !important;
  transform:none !important;
  width:360px !important;
  height: calc(100vh - 160px) !important; /* fixed */
  border-radius:10px !important;
  box-shadow:0 18px 50px rgba(2,16,40,0.18) !important;
}

/* Modal header */
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px;
  background:transparent;
  border-bottom:2px solid rgb(106 107 109 / 17%);
}
.modal-title { 
  font-weight:700;
  font-size:18px; 
  color:#09304a; 
  display:flex; 
  gap:10px; 
  align-items:center; 
}
.modal-controls { 
  display:flex; 
  gap:8px; 
  align-items:center; 
}
.icon-btn { 
  background:transparent; 
  border:none; 
  cursor:pointer; 
  font-size:18px; 
  padding:8px; 
  border-radius:8px; 
  color:#324a64; 
}
.icon-btn:hover { 
  background: rgba(0,0,0,0.04); 
}
.icon-btn.active { 
  background: rgba(0,115,230,0.08); 
}
/* loading animation */
.bot-loading {
  display: flex;
  flex-direction: column;
  gap: 8px; 
  margin-top: 6px;
  width: 100%; 
}

.bot-loading-line {
  height: 14px;
  width: 80%;                
  max-width: 80%;             
  border-radius: 8px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 37%, #e0e0e0 63%);
  background-size: 400% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

/* Variations for second and third line */
.bot-loading-line:nth-child(2) {
  width: 70%;                  
  animation-delay: 0.2s;
}
.bot-loading-line:nth-child(3) {
  width: 50%;                  
  animation-delay: 0.4s;
}

@keyframes shimmer {
  0% {
    background-position: -400% 0;
  }
  100% {
    background-position: 400% 0;
  }
}


/* Modal body */
.modal-body {
  flex:1;
  overflow:hidden;
  display: flex;
  flex-direction: column;
  padding:26px;
  
}

#chatbar.hidden {
  opacity: 0;
  transform: translateY(200px); 
  pointer-events: none;
}

#chatbar.show-animate {
  opacity: 1;
  
  transition: all 0.6s ease;
}


/* Docked mode override */
#chat-modal.docked .messagesModals {
  flex: 1;                
  padding: 10px;
  overflow-y: auto;         /* messages scroll */
  max-height: none;         /* remove the fixed height */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;                
}

/* Center modal styling */
.chat-center {
  max-width: 600px;
  margin: 40px auto;
  background: linear-gradient(to bottom, #fff, #f0f6ff);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.chat-header {
  text-align: center;
  padding: 20px;
  border-bottom: 1px solid #e5eaf0;
}
.chat-header h2 {
  font-size: 22px;
  font-weight: 600;
}
.chat-header span {
  color: #0056ff;
}

/* Chat body */
.chat-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
/* BOT messages */
.bot-msg {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  margin: 12px 10;
}
.bot-avatar {
  width: 32px;
  height: 32px;
  margin-right: 8px;
}
.bot-text {
  background: #fff;
  color: #123;
  padding: 12px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 6px;
  max-width: 78%;
  font-size: 17px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(12,40,80,0.04);
}
.bot-msg,
.user-msg {
  margin: 12px 80px;   /* top/bottom 12px, left/right 20px */
}

.bot-text,
.user-text {
  max-width: 70%;      /* prevent stretching to edges */
}
#chat-modal.docked .bot-msg,
#chat-modal.docked .user-msg {
  margin: 12px 0;
}

/* USER messages */
.user-msg {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0;
}
.user-text {
  background: var(--primary-600);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  border-bottom-right-radius: 6px;
  max-width: 78%;
  font-size: 15px;
  line-height: 1.45;
  text-align: right;
}



/* Footer */
.chat-footer {
  padding: 15px;
  border-top: 1px solid #e5eaf0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.action-btn {
  background: #0056ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  align-self: flex-end;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d6dbe5;
  border-radius: 12px;
  padding: 5px 10px;
}
.input-wrap input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
}
.send-btn {
  background: #0056ff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
}


/* Modal footer (input area) */
.modal-footer {
  display: flex;
  justify-content: center !important;  /* center horizontally */
  padding: 10px;
}

/* Center modal footer */
#chat-modal:not(.docked) .modal-footer {
  width:100%;
  margin:0 auto;
  /* border-radius:15px 15px 0 0; */
  background-color: #fff;
  position:absolute;
  bottom:40px;
  
  padding-bottom:23px;
}

/* Docked modal footer */
#chat-modal.docked .modal-footer {
  width:95%;
  margin:0;
  bottom:0;
  border-radius:0;
  background:#fff;
  position:relative;
}

/* Modal input */
.modal-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 600px;   /* keeps it centered */
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 15px;
  padding: 5px 10px;
}
.modal-input input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px;
  background: transparent;
  font-size: 14px;
}
/* ---------- Floating mini button ---------- */
#mini-toggle {
  position: fixed;
  right:22px;
  bottom:22px;
  width:243px;
  height:63px;
  border-radius:15px;
  justify-content:center;
  border:none;
  color:#fff;
  display:none;
  align-items:center;
  font-size:22px;
  cursor:pointer;
  box-shadow:0 14px 36px rgba(0,115,230,0.18);
  z-index:10030;
}

.toggle {
  background-image: linear-gradient(to right, #1c5baa, #ed1b24 , #ed1b24, #1c5baa);
  border:none;
  background-size:300% 100%;
  transition: all .4s ease-in-out;
}
.toggle:hover { background-position:100% 0; transition:all .4s ease-in-out; }
.toggle:focus { outline:none; }
#mini-toggle.visible { display:flex; animation: pop .36s ease; }
@keyframes pop {
  0%{ transform: scale(.7); opacity:0 }
  70%{ transform: scale(1.05); opacity:1 }
  100%{ transform: scale(1); }
}

.bot-header {
  width: 100%;
  display: flex;
  justify-content: center;   /* centers horizontally */
  text-align: center;
}
/* ---------- Messages area ---------- */
.bot-header h1 {
  color: #03234d;
  font-family: 'Nunito', sans-serif;  
  font-size: 40px;
  font-weight: 700;
  margin: 0;
}
.bot-header h1 span {
  background: linear-gradient(to right, #1c5baa, #ed1b24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; /* for Firefox */
  color: transparent;
}



.messagesModals {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    max-height: calc(100% - 100px);
    box-sizing: border-box;
}
.messagesModals::-webkit-scrollbar { width:6px; }
.messagesModals::-webkit-scrollbar-thumb { background:#ccc; border-radius:3px; }
.messagesModals::-webkit-scrollbar-thumb:hover { background:#999; }

.quick-btn {
  position: relative;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 12px;        /* 👈 smooth rounded corners */
  background: #fff;
  color: black;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 4px 6px;
  z-index: 1;
  border: none;               /* remove default border */
}

.quick-btn::before {
  content: "";
  position: absolute;
  inset: 0; /* cover the whole button */
  border-radius: 12px;
  padding: 2px; /* 👈 thickness of gradient border */
  background: linear-gradient(to right, #1c5baa, #ed1b24);
  
  /* Mask for WebKit browsers */
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;

  /* Mask for Firefox */
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;

  z-index: -1;
}



.quick-btn:hover {
  background: var(--primary-600);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 115, 230, 0.18);
}

.quick-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 115, 230, 0.15);
}

/* ---------- Right panel ---------- */
#rightPanel {
  position:fixed;
  right:14px;
  top:120px;
  width:320px;
  height:520px;
  background:#fff;
  border-radius:12px;
  box-shadow:0 18px 50px rgba(2,16,40,0.12);
  z-index:10040;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  transition:transform .28s ease, opacity .24s ease;
}
#rightPanel.hidden { transform:translateX(12px) scale(.98); opacity:0; pointer-events:none; }

#rightPanelHeader {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px;
  background: linear-gradient(90deg,#fff,#f3f8ff);
  border-bottom:1px solid rgba(10,40,80,0.03);
}
#rightPanelHeader .title { font-weight:700; color:#0b3b6b; }
#rightPanelHeader .mini-controls { display:flex; gap:8px; align-items:center; }
.rp-btn { background:transparent; border:none; cursor:pointer; font-size:16px; padding:6px; border-radius:8px; }

#rightPanelBody { padding:12px; overflow:auto; flex:1; }
#rightPanelFooter { padding:10px; border-top:1px solid rgba(10,40,80,0.03); display:flex; gap:8px; align-items:center; }
.rp-launch { flex:1; padding:10px 12px; background:var(--primary-600); color:#fff; border-radius:10px; text-align:center; cursor:pointer; }
.rp-minimize { width:38px; height:38px; border-radius:8px; display:flex; align-items:center; justify-content:center; background:#f2f5fb; cursor:pointer; }

/* ---------- Responsive ---------- */
@media (max-width:900px) {
  #chatbar { width:min(680px,92%); }
  #chat-modal { width:calc(100% - 32px); height:82vh; }
  #rightPanel { display:none; }
}
@media (max-width: 768px) {
  .bot-msg,
  .user-msg {
    margin: 12px 0; /* on mobile/tablet */
  }
   #mini-toggle {
    width: 55px;              /* make it small */
    height: 55px;
    border-radius: 50%;       /* circle shape */
    padding: 0;               /* no extra padding */
    justify-content: center;  /* center the icon */
  }

  #mini-toggle h5 {
    display: none;            /* hide the "Ask Agentflew" text */
  }
 
  .quick-actions {
    display: none !important;
  }
  #chatbar { width:min(680px,83%); }
  .send-thumb{
    height: 30px;
  }
  #chat-modal.docked #messagesModal .bot-header h1 {
  font-size: 33px !important;
}
}


