/* AI Chatbot Pro - public styles */

#uai-chat-toggle{
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  right: calc(18px + env(safe-area-inset-right));
  z-index: 999999;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--uai-icon-bg);
  color: var(--uai-icon-text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

#uai-chat-toggle:focus{
  outline: 2px solid rgba(0,0,0,0.25);
  outline-offset: 2px;
}

#uai-chat-toggle .uai-chat-icon{
  width: 26px;
  height: 26px;
}

#uai-chatbox{
  position: fixed;
  bottom: calc(86px + env(safe-area-inset-bottom));
  right: calc(18px + env(safe-area-inset-right));
  z-index: 999998;
  width: 360px;
  max-width: calc(100vw - 36px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--uai-bg);
  border: 1px solid var(--uai-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
}

#uai-chatbox.closed{
  display: none;
}

#uai-chat-header{
  background: var(--uai-header-bg);
  color: var(--uai-header-text);
  padding: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#uai-chat-header .chat-title{
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

#uai-chat-close{
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--uai-header-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
}

#uai-chat-close:hover{
  background: rgba(255,255,255,0.12);
}

#uai-chat-messages{
  padding: 12px;
  overflow: auto;
  flex: 1;
}

.uai-msg{
  padding: 10px 12px;
  border-radius: 14px;
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.35;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.uai-msg.uai-bot{
  background: var(--uai-bot-bubble);
  color: var(--uai-bot-text);
  border: 1px solid rgba(0,0,0,0.04);
  align-self: flex-start;
}

.uai-msg.uai-user{
  background: var(--uai-user-bubble);
  color: var(--uai-user-text);
  border: 1px solid rgba(0,0,0,0.06);
  align-self: flex-end;
}

#uai-chat-input-row{
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--uai-border);
  background: rgba(255,255,255,0.6);
}

#uai-chat-input{
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--uai-border);
  background: #fff;
  font-size: 14px;
  line-height: 1.25;
}

#uai-chat-send{
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  min-width: 92px;
  cursor: pointer;
  background: var(--uai-header-bg);
  color: var(--uai-header-text);
  font-size: 14px;
  font-weight: 600;
}

#uai-chat-send:hover{
  filter: brightness(1.08);
}

/* Mobile: fullscreen chat window */
@media (max-width: 480px){
  #uai-chatbox{
    left: 0 !important;
    right: 0 !important;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  #uai-chat-toggle{
    width: 54px;
    height: 54px;
  }
}
