/* Floating Style */
.chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 0px;
  background-color: #4a2c7e;
  color: white;
  border: none;
  width: 52px;
  height: 56px;
  padding: 0;
  box-sizing: border-box;
  line-height: 0;
  appearance: none;
  cursor: grab;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  touch-action: none;
  user-select: none;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease-in-out,
    background-color 0.2s ease-in-out;
}

.chat-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.chat-toggle.edge-right {
  border-radius: 14px 0 0 14px;
  box-shadow: -10px 10px 24px rgba(0, 0, 0, 0.2);
}

.chat-toggle.edge-left {
  border-radius: 0 14px 14px 0;
  box-shadow: 10px 10px 24px rgba(0, 0, 0, 0.2);
}

.chat-toggle.edge-right svg {
  transform: translateX(1px);
}

.chat-toggle.edge-left svg {
  transform: translateX(-1px);
}

.chat-toggle.dragging {
  cursor: grabbing;
  transform: scale(1.02);
}

.chat-toggle.edge-right:hover:not(.dragging) {
  background-color: #3a1c5e;
  transform: translateX(-3px);
}

.chat-toggle.edge-left:hover:not(.dragging) {
  background-color: #3a1c5e;
  transform: translateX(3px);
}

.chatbot-open .chat-toggle {
  opacity: 0;
  pointer-events: none;
}

.chatbot-open .chat-toggle.edge-right {
  transform: translateX(120%);
}

.chatbot-open .chat-toggle.edge-left {
  transform: translateX(-120%);
}

.chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  display: block;
  z-index: 5;
  background-color: white;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 48px);
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.32s;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) translateX(12px) scale(0.97);
  transform-origin: bottom right;
}

.chat-window.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) translateX(0) scale(1);
}

/* Default Style */
.chat-window-default {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  z-index: 3;
  transition:
    opacity 0.3s ease-in-out,
    transform 0.3s ease-in-out;
  opacity: 0;
  transform: translateY(20px);
}

.chat-window-default.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Common Styles for Both Modes */
.chat-header {
  color: white;
  display: flex;
  height: 60px;
  padding-inline: 10px;
  align-items: center;
  justify-content: space-between;
  background-color: #4a2c7e;
}

.chat-header-content {
  display: flex;
  align-items: center;
}

.chat-icon {
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 50%;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chat-header-title {
  font-size: 16px;
  font-weight: 500;
  color: white;
}

.chat-close {
  cursor: pointer;
  font-size: 20px;
  opacity: 0.8;
  transition: opacity 0.2s ease-in-out;
}

.chat-close:hover {
  opacity: 1;
}

.chat-messages {
  overflow-y: auto;
  padding: 0px 15px;
  background-color: #f9f9f9;
}

.message-container {
  margin: 10px 0;
  display: flex;
}

.message-content {
  padding: 10px 15px;
  border-radius: 15px;
  max-width: 70%;
  word-wrap: break-word;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-message {
  justify-content: flex-end;
}

.user-message .message-content {
  color: white;
  border-radius: 15px 15px 0 15px;
}

.bot-message {
  justify-content: flex-start;
}

.bot-message .message-content {
  background-color: white;
  color: #333;
  border-radius: 15px 15px 15px 0;
}

.chat-input-area {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 55px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: white;
  box-sizing: border-box;
}

.chat-input {
  flex: 1;
  border: none;
  border-radius: 5px;
  outline: none;
  padding: 10px;
}

.chat-menu,
.chat-send {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  margin-inline: 5px;
  min-width: 40px;
  min-height: 40px;
  box-sizing: border-box;
}

.loading-container {
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.loading-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  background-color: #f1f1f1;
  border-radius: 15px 15px 15px 0;
  max-width: 70%;
}

.loading-text {
  color: #666;
  font-style: italic;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.chat-trigger-area {
  display: none;
}

.chat-trigger-area.visible {
  display: block;
}


/* --- Updated Dropdown CSS --- */

.model-dropdown-content {
    /* Positioning handled by JS, but ensure it sits on top */
    z-index: 9999 !important;
    
    /* Navbar Look */
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
    
    /* Scrollbar styling */
    overflow-y: auto;
}

.model-dropdown-content::-webkit-scrollbar {
    width: 6px;
}
.model-dropdown-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.model-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Trigger Button Styles */
.model-dropdown-trigger {
    background: #f8f9fa;
    color: #333;
}

.model-dropdown-trigger:hover {
    background: #f0f0ff; /* Slight tint on hover */
    border-color: #bbb;
}

/* Selected Item State */
.model-option.selected {
    /* background-color: rgba(254, 253, 255, 0.08); Light purple tint */
    color: #000000;
    font-weight: 600;
}

/* Item Hover State */
.model-option:hover {
    background-color: #f5f5f5;
}

/* Ensures the dropdown doesn't inherit weird text alignment from container */
.model-dropdown-content, 
.model-option {
    text-align: left;
}
/* .trigger-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  background-color: white;
  border-radius: 5px;
  margin-bottom: 10px;
} */

.trigger-button {
  padding: 8px 15px;
  border: none;
  border-radius: 20px;
  background-color: white;
  border: 1px solid #c7c3c3;
  cursor: pointer;
  transition: opacity 0.2s;
}

.trigger-button:hover {
  border-color: #4a2c7e;
}
