/* #chat-button {
  position: fixed;
  right: 0;
  bottom: 0;
  background-color: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  z-index: 1000;
} */

/* ===== Chat button:  ===== */
#chat-button {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 1000;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  display: grid;            
  place-items: center;
  -webkit-tap-highlight-color: transparent;


  --metal-top:    #6fa3ff; 
  --metal-bottom: #1a2e6a; 
  background:
    radial-gradient(110% 130% at 30% 0%, rgba(255,255,255,.40) 0, rgba(255,255,255,0) 60%),
    linear-gradient(20deg, rgba(0,0,0,.35), rgba(255,255,255,.08) 55%, rgba(0,0,0,.45)),
    linear-gradient(180deg, var(--metal-top), var(--metal-bottom));

  border: 1px solid rgba(40, 72, 150, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 -1px 0 rgba(0,0,0,.40);
}

#chat-button img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
  z-index: 1;             
  pointer-events: none;    
}


#chat-button:hover { transform: translateY(-1px); filter: saturate(1.03); }
#chat-button:active { transform: translateY(0); }

@media (prefers-color-scheme: dark){
  #chat-button{
    --metal-top: #4a4f57;
    --metal-bottom: #23262b;
    border-color: rgba(255,255,255,.06);
  }
}


/* #chat-button img {
  width: 50px;
  height: 50px;
} */

.chat-widget {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
   pointer-events: none;     
  outline: none; 
}

#chat-interface {

  border-radius: 1px;
  width: 100%;
  height: 100%;
   pointer-events: auto;
  outline: none;
}

.chat-widget:focus,
.chat-widget:focus-visible,
#chat-interface:focus,
#chat-interface:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

iframe#chat-widget-container,
iframe#chat-widget-container:focus,
iframe#chat-widget-container:focus-visible {
  outline: none !important;
  border: none;
}

#chat-header {
  padding: 10px;
  background-color: #333;
  color: #fff;
  width: 100%;
  height: 15%;
  display: flex;
  flex-direction: row;
}

#chat-conversation {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 70%;
  overflow-y: auto;
}

#chat-input {
  display: flex;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #e0e0e0;
  background-color: #fff;
  width: 100%;
  height: 15%;
}

#chat-header #chat-avatar {
  order: 0;
  flex-grow: 1;

  display: flex;
  justify-content: center;
  align-items: center;
}

#chat-avatar img {
  width: 55px;
  object-fit: cover;
}

#chat-header .chat-info {
  order: 1;
  flex-grow: 4;
  box-sizing: border-box;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.chat-info .bot-name, .chat-info .bot-status {
  text-align: left; 
  margin: 5px 0;
}

.chat-info .bot-name {
  font-size: larger;
}

.chat-info .bot-status{
  font-size: small;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.chat-card {
  background-color: #F0F8FF !important;
}

.chat-body {
  flex-grow: 1;
  overflow-y: auto;
}

.chat-content {
  padding: 10px;
}



.close-button,
.send-button {
  cursor: pointer;
}



.close-chat {
  position: absolute;
  right: 10px;
  top: 0px;
  font-size: 30px;
  cursor: pointer;
  background-color: transparent;
  border: none;
  color: white;
}

.back-button {
  font-size: 30px;
  cursor: pointer;
  background-color: transparent;
  border: none;
  color: white;
}

.chat-message {
  display: flex;
  align-items: start;
  padding: 10px;
}

.chat-message img {
  width: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

.message-content {
  background-color: #F0F8FF;
  padding: 10px 15px;
  border-radius: 10px;
  position: relative;
  word-wrap: break-word;
}

.message-content p:first-child {
  margin-bottom: 5px;
  font-size: 14px;
}

.timestamp {
  padding: 3px;
  display: inline-block;
  align-self: flex-end;
  text-align: center;
  max-width: 90%;
  margin-right: 10px;
  margin-top: -0.75em;
  background-color: #D7ECFF;
  border-radius: 5px;
  font-size: 13px;
}


#chat-input textarea {
  flex-grow: 1;
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  resize: none;
  outline: none;
  margin-right: 5px;
  font-size: 14px;
  height: 100%;
}

#btn-send {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
}

#btn-send img {
  width: 20px;
  height: 20px;
}

.chat-message.user {
  padding: 10px;
  background-color: #F0F8FF;
  border-radius: 5px;
  margin: 10px 0;
  display: inline-block;
  align-self: flex-end;
  max-width: 70%;
  margin-right: 10px;
  margin-top: 20px;
}

.status {
  display: flex;
  align-items: center;
  font-size: 16px;
}

.online-circle {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #32CD32;
  border-radius: 50%;
  margin-right: 5px;
}

.arabic-message {
  direction: rtl;
}

@media only screen and (max-height: 560px) {
  #chat-avatar img {
    width: 40px;
  }

  .chat-info .bot-name {
    font-size: 20px;
  }

  .chat-info .bot-status {
    font-size: 10px;
  }

  .chat-info .bot-name, .chat-info .bot-status {
    margin: 2px 0;
  }
}


@media only screen and (max-height: 560px) {

  .chat-info .bot-name {
    font-size: 16px;
  }

  .chat-info .bot-status {
    font-size: 10px;
  }

  .chat-info .bot-name, .chat-info .bot-status {
    margin: 1px 0;
  }
}

@media only screen and (max-width: 320px) {
  .timestamp {
    font-size: 11px;
  }

  .message-content p:first-child {
    font-size: 12px;
  }

  #chat-input textarea {
    font-size: 12px;
  }
}


@media only screen and (max-width: 200px) {
  .timestamp {
    font-size: 9px;
  }

  .message-content p:first-child {
    font-size: 10px;
  }

  #chat-input textarea {
    font-size: 10px;
  }
}

/* ===== Dark theme for chatbot ===== */

#chat-interface {
  background: #0b0f14 !important;
  border-radius: 0 !important;  
  overflow: hidden;                 
}

#chat-header {
  background: linear-gradient(180deg,#1f2937,#0b1220) !important;
  color: #e5e7eb !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

#chat-conversation {
  background: #0b0f14 !important;
}

.message-content {
  background: #202734 !important;        
  color: #e6edf3 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 1px 0 rgba(0,0,0,0.5) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
}

.chat-message.user {
  background: transparent !important;       
}
.chat-message.user .message-content {
  background: #2a3b57 !important;            
  color: #ecf3ff !important;
  border: 1px solid rgba(88,116,255,0.25) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 1px 0 rgba(0,0,0,0.55) !important;
}

.timestamp {
  background: rgba(59,130,246,0.15) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(59,130,246,0.15) !important;
}

#chat-input {
  background: #0b0f14 !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}
#chat-input textarea {
  background: #121823 !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.35) !important;
}

#btn-send img {
  filter: brightness(1.2) saturate(1.2) !important;
}
#btn-send:hover img {
  filter: brightness(1.35) saturate(1.35) !important;
}

.online-circle {
  background-color: #22c55e !important;
}

#chat-conversation::-webkit-scrollbar {
  width: 10px;
}
#chat-conversation::-webkit-scrollbar-thumb {
  background: #2a2f3a;
  border-radius: 6px;
  border: 2px solid #0b0f14;
}
#chat-conversation::-webkit-scrollbar-track {
  background: #0b0f14;
}

*:focus:not(:focus-visible) { outline: none !important; }


#chat-widget, #chat-interface {
  outline: none !important;
  -moz-outline-style: none !important;
}
#chat-widget:focus, #chat-widget:-moz-focusring,
#chat-interface:focus, #chat-interface:-moz-focusring {
  outline: none !important;
}


a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}


button::-moz-focus-inner { border: 0; }



