/* ===== CHATBOT WIDGET ===== */
#chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

#chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d2444 0%, #1a3a6e 100%);
  border: 3px solid rgba(86,180,211,.6);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(13,36,68,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .2s;
  line-height: 1;
  overflow: visible;
  padding: 0;
  position: relative;
}

#chatbot-toggle::after {
  content: ':)';
  position: absolute;
  top: -10px;
  right: -8px;
  width: 28px;
  height: 19px;
  background: #fff;
  border-radius: 8px 8px 8px 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  pointer-events: none;
  z-index: 3;
  font-size: 9px;
  font-weight: 900;
  color: #0d2444;
  text-align: center;
  line-height: 19px;
  letter-spacing: .5px;
}

.toggle-avatar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  border-radius: 50%;
}

#chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(13,36,68,.55);
}

#chatbot-toggle:focus-visible {
  outline: 3px solid #56b4d3;
  outline-offset: 3px;
}

#chatbot-panel {
  display: none;
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 340px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(13,36,68,.2);
  border: 1px solid rgba(46,139,192,.15);
  flex-direction: column;
  overflow: hidden;
}

#chatbot-panel.open {
  display: flex;
}

#chatbot-header {
  background: linear-gradient(135deg, #0d2444 0%, #1a3a6e 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}


#chatbot-title {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .3px;
}

#chatbot-subtitle {
  color: rgba(86,180,211,.85);
  font-size: 11px;
  margin-top: 1px;
}

.chatbot-header-text {
  display: flex;
  flex-direction: column;
}

#chatbot-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s, background .15s;
}

#chatbot-close:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  min-height: 180px;
}

.chat-msg {
  max-width: 88%;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.chat-msg.bot {
  background: #f0f6ff;
  color: #1a2b3c;
  align-self: flex-start;
  border-radius: 12px 12px 12px 3px;
}

.chat-msg.user {
  background: #0d2444;
  color: #fff;
  align-self: flex-end;
  border-radius: 12px 12px 3px 12px;
}

.chat-msg.typing {
  background: #f0f6ff;
  color: #607080;
  align-self: flex-start;
  border-radius: 12px 12px 12px 3px;
  font-style: italic;
}

#chatbot-input-row {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
  border-top: 1px solid #e8f0f8;
  flex-shrink: 0;
}

#chatbot-input {
  flex: 1;
  border: 1px solid rgba(46,139,192,.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #1a2b3c;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}

#chatbot-input:focus {
  border-color: #2e8bc0;
}

#chatbot-input:focus-visible {
  outline: 2px solid #56b4d3;
  outline-offset: 1px;
}

#chatbot-send {
  background: #2e8bc0;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
  transition: background .15s;
  line-height: 1;
  flex-shrink: 0;
}

#chatbot-send:hover:not(:disabled) {
  background: #1a3a6e;
}

#chatbot-send:disabled {
  opacity: .45;
  cursor: default;
}

@media (max-width: 480px) {
  #chatbot-widget {
    bottom: 16px;
    right: 16px;
  }
  #chatbot-panel {
    width: calc(100vw - 32px);
    right: -8px;
  }
}

/* ===== DARK MODE (dark for all screen visitors) ===== */
@media screen {
  #chatbot-panel {
    background: #14253c;
    border-color: rgba(86,180,211,.2);
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
  }
  .chat-msg.bot {
    background: #0e1c30;
    color: #c9d7e6;
  }
  .chat-msg.user {
    background: #1a3a6e;
  }
  .chat-msg.typing {
    background: #0e1c30;
    color: #8da3ba;
  }
  #chatbot-input-row {
    border-top-color: #22395a;
  }
  #chatbot-input {
    background: #0e1c30;
    color: #c9d7e6;
  }
  #chatbot-send:hover:not(:disabled) {
    background: #3a9bd5;
  }
}
