
#chatbot {
  position: fixed;
  bottom: 2vw;
  right: 2vw;
  width: 6vw;
  height: 6vw;
  background-color: white;
  opacity: 1;
  border-radius: 50%;
  z-index: 9999;


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

  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

  transition: all 0.4s ease;
}
#chatbot:not(.open){
  opacity: 0.7;
}

/* Expanded state */
#chatbot.open {
  width: 25vw;
  height: 30vw;
  border-radius: 1.5vw;
  padding: 1.5vw;
  box-sizing: border-box;
  overflow: hidden;
}

/* Icon */
#chatIcon {
  width: 70%;
  height: 70%;
  transition: opacity 0.3s ease;
}

/* Hide icon when open */
#chatbot.open #chatIcon {
  opacity: 0;
}

/* Chat window */
#chatWindow {
  display: none;
  background-color: white;
  transition: opacity 0.3s ease;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  transition: all 0.3s ease;
  border-radius: 1.5vw;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}
#chatControls{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4vw;
  position: absolute;
  top: 0.8vw;
  right: 0.8vw;
  z-index: 2;
}
#chatControls button,
#chatControls #closeIcon{
  width: 2.4vw;
  height: 2.4vw;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 0.14vw solid #2a2a2a;
  background: #fff;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}
#chatControls button span{
  pointer-events: none;
}
#chatControls button:hover,
#chatControls #closeIcon:hover{
  background-color: #f2f2f2;
  transform: scale(1.04);
}
#chatControls button:active,
#chatControls #closeIcon:active{
  transform: scale(0.98);
}
#infoToggle{
  color: #222;
  cursor: pointer;
}
#infoToggle span{
  font-size: clamp(15px, 1.15vw, 19px);
  font-weight: 700;
  line-height: 1;
}
#modeToggleButton{
  color: #222;
  cursor: pointer;
  width: auto;
  min-width: 64px;
  padding: 0 0.6vw;
  border-radius: 999px;
  font-size: clamp(9px, 0.72vw, 11px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
#modeToggleButton.is-voice-only{
  background: #eaf3ff;
  border-color: #2f5e9d;
  color: #1f3f69;
}
#voiceMicButton{
  color: #222;
  cursor: pointer;
  width: auto;
  min-width: 58px;
  padding: 0 0.5vw;
  border-radius: 999px;
  font-size: clamp(9px, 0.72vw, 11px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
#voiceMicButton:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}
#voiceMicButton.is-listening{
  background: #ffeaea;
  border-color: #c23b3b;
  color: #8b1f1f;
}
#closeIcon{
  cursor: pointer;
  object-fit: contain;
  padding: 0.42vw;
}
#chatTitle{
  margin: 0;
  padding: 0.95vw 9.2vw 0.1vw 0.2vw;
  font-size: clamp(18px, 1.3vw, 23px);
  line-height: 1.15;
  color: #121212;
}
#chatText{
  margin-top: 0;
  padding: 0.2vw 9.2vw 0.7vw 0.2vw;
  margin-bottom: 0.45vw;
  font-size: clamp(12px, 0.9vw, 15px);
  line-height: 1.3;
  color: #4b4b4b;
  border-bottom: 0.08vw solid #e8e8e8;
}
#chatMessages{
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0.17vw solid #cccccc;
  border-radius: 1vw;
  margin-top: 0.25vw;
  margin-left: auto;
  margin-right: auto;
  padding: 0.85vw;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.68vw;
  background: #f7f7f7;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
#voiceModeStatus{
  display: none;
  width: 100%;
  margin-top: 0.4vw;
  margin-bottom: 0.4vw;
  padding: 0.45vw 0.7vw;
  box-sizing: border-box;
  border-radius: 0.7vw;
  background: #eef5ff;
  border: 0.1vw solid #d5e5ff;
  color: #234a7d;
  font-size: 0.88vw;
  line-height: 1.2;
  position: relative;
  padding-left: 1.45vw;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.6vw;
}
#voiceModeStatusText{
  display: block;
  flex: 1;
  min-width: 0;
}
#voicePicker{
  width: 8.8vw;
  min-width: 92px;
  height: 1.45vw;
  min-height: 20px;
  border: 0.1vw solid #b9c9e6;
  border-radius: 0.45vw;
  background: #fff;
  color: #24466f;
  font-size: 0.64vw;
  padding: 0 0.25vw;
}
#voicePicker:disabled{
  opacity: 0.6;
}
#voiceModeStatus::before{
  content: '';
  position: absolute;
  left: 0.65vw;
  top: 50%;
  width: 0.5vw;
  height: 0.5vw;
  min-width: 7px;
  min-height: 7px;
  border-radius: 50%;
  background: #6a8fbf;
  transform: translateY(-50%);
  opacity: 0.85;
}
#voiceModeStatus.is-listening::before{
  background: #1b63c7;
  animation: voice-status-pulse 1.25s ease-out infinite;
}
#voiceModeStatus.is-speaking::before{
  background: #6a33c2;
  animation: voice-status-pulse 0.9s ease-out infinite;
}
#voiceModeStatus.is-paused::before{
  background: #8a8f97;
  animation: none;
}

@keyframes voice-status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(27, 99, 199, 0.42);
    transform: translateY(-50%) scale(1);
  }
  70% {
    box-shadow: 0 0 0 0.5vw rgba(27, 99, 199, 0);
    transform: translateY(-50%) scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(27, 99, 199, 0);
    transform: translateY(-50%) scale(1);
  }
}
#chatbot.voice-only-mode #voiceModeStatus{
  display: flex;
}
#chatbot.voice-only-mode #chatInputSection,
#chatInputSection.voice-only-hidden{
  display: none;
}
#infoWidget{
  display: none;
  background: #123c6a;
  color: #fff;
  border-radius: 1.5vw;
  box-shadow: 0 1.2vw 3vw rgba(0,0,0,0.22);
  padding: 1.2vw 1.2vw 1vw;
  margin: 0;
  font-size: 1.05vw;
  line-height: 1.45;
  position: fixed;
  z-index: 9998;
  width: 22vw;
  min-width: 240px;
  max-width: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 0.12vw solid rgba(255,255,255,0.12);
  bottom: 2vw;
  right: 28vw;
  max-height: 30vw;
}
#infoWidget h2{
  margin: 0 2.2vw 0.6vw 0;
  font-size: 1.3vw;
  font-weight: 700;
  letter-spacing: 0.03em;
}
#infoWidget ul{
  margin: 0.3vw 0 0 0;
  padding: 0;
  list-style: none;
}
#infoWidget li{
  margin-bottom: 0.7vw;
  padding: 0.6vw 0.7vw;
  background: #1a4e86;
  border-radius: 0.6vw;
  border-left: 0.25vw solid #3a78b8;
}
#infoWidget li b{
  display: block;
  margin-bottom: 0.1vw;
}
#infoClose{
  position: absolute;
  top: 0.6vw;
  right: 0.6vw;
  width: 1.9vw;
  height: 1.9vw;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 1vw;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
#infoClose:hover{
  background: rgba(255,255,255,0.28);
  transform: scale(1.05);
}
#chatInputSection{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.65vw;
  padding-top: 0.55vw;
  border-top: 0.1vw solid #ececec;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  width: 100%;
}
#chatInput{
  width: calc(100% - 5vw);
  height: 3.1vw;
  min-height: 44px;
  border-radius: 1vw;
  border: 0.16vw solid #c7c7c7;
  padding: 0 0.75vw;
  font-size: clamp(13px, 1vw, 18px);
  box-sizing: border-box;
}
#chatInput::placeholder{
  color: #8a8f95;
  opacity: 0.72;
}
#chatInput:focus,
#chatControls button:focus-visible,
#closeIcon:focus-visible,
#submitButton:focus-visible{
  outline: 2px solid #04567D;
  outline-offset: 2px;
}
#submitButton{
  height: 3.45vw;
  width: 3.45vw;
  min-width: 46px;
  min-height: 46px;
  border-radius: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background-color: #04567D;
  box-shadow: 0 2px 7px rgba(4, 86, 125, 0.3);
  transition: transform 0.16s ease, background-color 0.16s ease;
}
#submitButton:hover{
  background-color: #034a66;
  transform: translateY(-1px);
}
#submitImg{
  height: 66%;
  width: 66%;
}
.chat-message {
  max-width: 86%;
  padding: 0.67vw 0.86vw;
  border-radius: 1.1vw;
  font-size: 1vw;
  line-height: 1.45;
  white-space: pre-line;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.chat-message.user {
  align-self: flex-end;
  background: #4f4f4f;
  color: white;
  border: 0.08vw solid #474747;
  border-bottom-right-radius: 0.36vw;
}
.chat-message.bot {
  align-self: flex-start;
  background: white;
  color: #1f1f1f;
  border: 0.1vw solid #d8d8d8;
  border-bottom-left-radius: 0.36vw;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.chat-message.typing {
  font-style: italic;
  color: #555;
}
.message-method-label {
  font-size: 0.75vw;
  color: #888;
  margin-top: 0.3vw;
  font-style: italic;
  opacity: 0.8;
}
/* Show content when open */
#chatbot.open #chatWindow {
  display: flex;
  flex-direction: column;
}
#chatbot.open #chatIcon {
  display:none;
}
@media (max-width: 768px) {
    #chatbot{
      display: none;
    }
}
