/* ===============================
   PREMIUM CHATBOT CSS
=============================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
}

/* CHAT TOGGLE BUTTON */
.chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  border: none;
  padding: 14px 22px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  transition: 0.2s ease;
  z-index: 1000;
}

/* Hide toggle when chat opens */
.chat-widget.show + .chat-toggle {
  display: none;
}

/* CHAT WIDGET */
.chat-widget {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 330px;
  max-height: 450px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.3s ease-in-out;
  z-index: 999;
}

/* HEADER */
.chat-header {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  padding: 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.close-btn {
  cursor: pointer;
  font-size: 20px;
}

/* BODY */
.chat-body {
  padding: 14px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

/* MESSAGES */
.message {
  padding: 10px 16px;
  border-radius: 18px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.4;
  animation: slideUp 0.2s ease;
  word-wrap: break-word;
}

.bot {
  background: #f3f4f6;
  color: #111;
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.user {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  align-self: flex-end;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* FOOTER */
.chat-footer {
  display: flex;
  gap: 5px;
  border-top: 1px solid #e5e7eb;
  padding: 5px;
}

.chat-footer input {
  flex: 1;
  padding: 12px;
  border: none;
  outline: none;
  font-size: 14px;
  border-radius: 12px;
}

.chat-footer input:focus {
  border: 2px solid #2563eb;
}

.chat-footer button {
  padding: 0 18px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border: none;
  color: white;
  cursor: pointer;
  transition: 0.2s ease;
  border-radius: 12px;
}

/* QUICK BUTTONS */
.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
}

.quick-btn {
  flex: 1 1 48%;
  text-align: center;
  margin: 2px 0;
  padding: 6px 0;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  transition: 0.2s ease;
}

.chat-toggle:hover,
.chat-footer button:hover,
.quick-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* MOBILE FIXES */
@media (max-width: 768px) {

  /* Full screen chat */
  .chat-widget {
    width: 100vw;
    height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
    max-height: none;
    display: flex !important;
    flex-direction: column;
    z-index: 1000;
  }

  /* Hide toggle when chat open */
  .chat-widget.show ~ .chat-toggle {
    display: none !important;
  }

  /* Footer input + send button full width */
  .chat-footer {
    display: flex;
    gap: 5px;
  }

  .chat-footer input {
    flex: 1;
    font-size: 16px;
    padding: 12px;
    border-radius: 12px;
  }

  .chat-footer button {
    flex-shrink: 0;
    font-size: 16px;
    padding: 0 18px;
    border-radius: 12px;
  }

  /* Quick buttons wrap */
  .quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .quick-btn {
    flex: 1 1 48%;
    text-align: center;
    margin: 2px 0;
    padding: 6px 0;
    font-size: 12px;
  }
}
