:root {
  --primary: #0a6cff;
  --primary-600: linear-gradient(to right, #1c5baa, #76aadb);
  --soft: #f4f7fb;
  --card-radius: 8px;
  --shadow: 0 12px 30px rgba(10,30,60,0.12);
}
@font-face {
  font-family: "CoHeadlineW23-ArabicRegular";
  src: url("CoHeadlineTrial-Regular.ttf") format("truetype"); /* change path based on your project */
  font-weight: normal;
  font-style: normal;
}

html, body {
  height: 100%;
  margin: 0;
  font-family:"CoHeadlineW23-ArabicRegular", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

.copy-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.7;
  transition: 0.2s;
}

.copy-btn:hover {
  opacity: 1;
}
.copy-icon {
  width: 32px;
  height: 38px;
}

/* ---------- 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, rgba(12,91,255,0.12), rgba(0,115,230,0.06));
  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);
}

/* Minimize button (dot above chatbar) */
.bar-minimize {
  position: absolute;
  right: 50px;
  top: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: #324a64;
  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-right{    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; 
  margin-top: 10px;
}
.bar-left { display:flex; gap:10px; align-items:center; min-width:0; flex:1; }

.agent-avatar {
  width:46px; height:46px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; color:var(--primary-600);
 
  flex:0 0 46px;
}

/* Input pill */
.bar-input {
  border: 1px solid #d1cece;
  display:flex; align-items:center; gap:10px;
  background:#fff;
  border-radius:8px;
  padding:14px 13px;
  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 {
  display: flex;
  align-items: center;
}

.send-button {
  width: 40px;
  height: 40px;

  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.send-button:hover {
  border: 1px solid #ccc;
  background: #e1e4e7;
}

.send-icon {
  width: 22px;
  height: 22px;
  color: #605b5b;
  transform: rotate(0deg);
}
.modal-body {
    position: relative;
    padding: 0 150px;
    background-color: var(--color-light);
    overflow: hidden;
}

/* Background (rotated + white overlay) */
.modal-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Background image */
    background-image: url(https://softflew.com/public/assets/images/bg/bg-g1.webp);
    background-size: cover;
    background-position: center;
    transform: rotate(180deg);


    background-color: rgba(255, 255, 255, 0.70); /* adjust opacity */
    background-blend-mode: lighten;

    z-index: -1;
}



#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: 'CoHeadlineW23-ArabicRegular', sans-serif;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;      
  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: 8px;
  padding: 2px; /* border thickness */
  background: linear-gradient(to right, #1c5baa,#76aadb);


  /* 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: 8px;
  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(111vh - 160px) !important; /* fixed */
  border-radius:8px !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:7px 20px;
  background:transparent;
  cursor: move;
  user-select: none;
  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:13px; 
  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;
  }
}

.mic-wrapper {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.mic-button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    
    color: #605b5b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s 
ease;
}

.mic-button:hover {
  background: #e1e4e7;
  border: 1px solid #ccc;
}

/* When listening - ChatGPT blue glow */
.mic-button.listening {
  background: #0a84ff;
  box-shadow: 0 0 12px #0a84ff;
  animation: pulse 1.3s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 8px #0a84ff; }
  50%  { box-shadow: 0 0 18px #0a84ff; }
  100% { box-shadow: 0 0 8px #0a84ff; }
}



/* Modal body */
.modal-body {
  flex:1;
  overflow:hidden;
  display: flex;
  flex-direction: column;
  padding:2px 12px 13px 4px;
  
}

#chatbar.hidden {
 display: 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: 42px;
  margin-right: 8px;
}
.bot-text {
  font-family: "CoHeadlineW23-ArabicRegular", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: #fff;
  color: #123;
  padding: 12px 14px;
  border-radius: 12px;
  border-bottom-left-radius: 6px;
  max-width: 78%;
  font-size: 15px;
  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;  /* center horizontally */
  padding: 10px;
  z-index: 1;
}

/* Center modal footer */
#chat-modal:not(.docked) .modal-footer {
  width:90%;
  margin:0 auto;
  border-radius:8px 8px 0 0;
  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: 5px;
  width: 100%;
  max-width: 600px;   /* keeps it centered */
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 9px;
  padding: 5px 10px;
}
.modal-input input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px;
  background: transparent;
  font-size: 17px;
}
/* ---------- Floating mini button ---------- */
#mini-toggle {
  font-family: "CoHeadlineW23-ArabicRegular", sans-serif;
  font-weight: 100;
  position: fixed;
  right:22px;
  bottom:22px;
  width:218px;
  height:54px;
  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,#76aadb , #76aadb, #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: 'CoHeadlineW23-ArabicRegular', sans-serif;  
  font-size: 40px;
  font-weight: 700;
  margin: 0;
}
.bot-header h1 span {
  background: linear-gradient(to right, #1c5baa, #76aadb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; /* for Firefox */
  color: transparent;
}

.editable-input {
    flex: 1;
    min-height: 24px;
    padding: 10px;
    outline: none;
    border: none;
    background: transparent;
    font-size: 17px;
    font-family: inherit;
    white-space: pre-wrap;
}

.editable-input:empty:before {
    content: attr(placeholder);
    color: #999;
    pointer-events: none;
}



.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: 'CoHeadlineW23-ArabicRegular', sans-serif;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;       
  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: 8px;
  padding: 2px; /* 👈 thickness of gradient border */
  background: linear-gradient(to right, #1c5baa,#76aadb);
  
  /* 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%); }
 
  #rightPanel { display:none; }
}
@media (max-width: 768px) {
  .bot-msg,
  .user-msg {
    margin: 12px 0; /* on mobile/tablet */
  }
  .bot-text{max-width: 82%;
    
  }
   #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;            
  }
  .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;
}
#chat-modal{
  max-width: 100% !important;
  
}
.modal-footer{
  width: 96% !important;
}
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    position: absolute;
    right: 0;
}
.modal-footer{
  padding-bottom: 41px !important;
  
}
  
.modal-input{
  border-radius: 6px !important;
}
 #chatbar {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  #chat-modal {
    display: none;
  }

 #mini-toggle {
    display: none;   /* default hidden */
  }

  #mini-toggle.visible {
    display: flex;   /* JS controls visibility */
  }
   #modalDock,
  #modalMinimize {
    display: none !important;
  }
}


