/* Desktop button styles - MUST be defined */
.chat-submit-btn {
  background: #7E2FFF;
  border: none;
  border-radius: 0 12px 12px 0;
  padding: 0 22px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-submit-btn:hover {
  background: #6b1fdb;
}

.chat-submit-btn img,
.chat-submit-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

#main-chat-messages {
  /* By default, invisible and no space taken */
  background: transparent;
  padding: 0;
  margin-top: 0;
  height: 0;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  transition: all 0.2s;
  overflow: hidden;
}

#main-chat-messages.has-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 18px rgba(126,47,255,0.07);
  margin-top: 12px;
  min-height: 120px;
  height: 320px;
  padding: 24px 20px 12px 20px;
  overflow-y: auto;
}

.chat-msg-user {
  display: flex;
  flex-direction: row-reverse;
  margin-bottom: 10px;
}

.chat-msg-user span {
  background: #7E2FFF;
  color: #fff;
  padding: 10px 18px;
  border-radius: 16px 12px 2px 18px;
  display: inline-block;
  margin-left: 8px;
  font-size: 1.08rem;
  box-shadow: 0 1px 6px rgba(126,47,255,0.09);
}

.chat-msg-bot {
  display: flex;
  margin-bottom: 10px;
}

.chat-msg-bot span {
  background: #fff;
  color: #1a1a1a;
  padding: 10px 18px;
  border-radius: 12px 16px 18px 2px;
  display: inline-block;
  font-size: 1.08rem;
  margin-right: 8px;
  border: 1px solid #ebe4fb;
  box-shadow: 0 1px 6px rgba(126,47,255,0.04);
}

.chat-error {
  color: #d51c1c;
  font-weight: 500;
  margin-top:4px;
  margin-bottom:4px;
  padding-left: 10px;
}

/* Input wrapper always uses flex */
.chat-input-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}

/* Mobile responsive fixes */
@media (max-width: 767px) {
  /* Chat container adjustments */
  .chat-container {
    max-width: 100% !important;
    padding: 0 15px;
  }

  /* Input field - reduce font size and padding on mobile */
  #main-chat-input {
    font-size: 0.9rem !important;
    padding: 10px 12px !important;
    height: 44px !important;
    border-radius: 12px 0 0 12px !important;
  }

  /* Submit button adjustment - MATCH input height */
  .chat-submit-btn {
    padding: 0 14px !important;
    height: 44px !important;
    min-width: 50px !important;
    width: auto !important;
    border-radius: 0 12px 12px 0 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .chat-submit-btn img,
  .chat-submit-btn svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
  }

  /* Popular queries section */
  .popular-queries {
    margin-top: 16px;
    padding: 0 10px;
  }

  .popular-queries-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .popular-queries-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.6);
  }

  .popular-query-item {
    font-size: 0.85rem;
    line-height: 1.3;
    color: rgba(0, 0, 0, 0.75);
  }
}

@media (max-width: 575px) {
  /* Extra small screens - further adjustments */
  #main-chat-input {
    font-size: 0.85rem !important;
    padding: 8px 10px !important;
    height: 40px !important;
  }

  .chat-submit-btn {
    padding: 0 12px !important;
    height: 40px !important;
    min-width: 45px !important;
  }

  .chat-submit-btn img,
  .chat-submit-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .popular-queries-label {
    font-size: 0.7rem;
  }

  .popular-query-item {
    font-size: 0.8rem;
  }
}
