/* ============================================
   CHATBOT WIDGET - FULLY RESPONSIVE
   ============================================ */

/* Base Chatbot Widget */
.chatbot-widget {
  position: fixed;
  bottom: 200px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 385px;
  max-height: calc(100vh - 150px);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  z-index: 10000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.chatbot-widget.show {
  display: flex;
  animation: slideUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
  from {
    transform: translateY(30px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ============================================
   HEADER
   ============================================ */
.chatbot-header {
  background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
  padding: 16px 20px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.chatbot-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.chatbot-controls {
  display: flex;
  gap: 8px;
}

.chatbot-btn {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.chatbot-btn:active {
  transform: scale(0.95);
}

/* ============================================
   BODY (Chat Messages Area)
   ============================================ */
.chatbot-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chatbot-body.hide {
  display: none;
}

/* Messages */
.chatbot-message {
  display: flex;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bot-message {
  justify-content: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bot-message .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.user-message .message-content {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* ============================================
   FOOTER (Input Area)
   ============================================ */
.chatbot-footer {
  display: flex;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 10px;
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.chatbot-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.chatbot-input:focus {
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.chatbot-send-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 70px;
}

.chatbot-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chatbot-send-btn:active {
  transform: scale(0.95);
}

/* ============================================
   LAUNCHER BUTTON
   ============================================ */
.chatbot-launcher {
  position: fixed;
  bottom: 127px;
  right: 30px;
  /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
  background: linear-gradient(135deg, var(--hv-danger), var(--hv-accent));
  color: #fff;
  padding: 16px 24px;
  border: none;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 9999;
  cursor: pointer;
  opacity: 0;
  transform: translateY(100px);
  animation: slideUpLauncher 0.6s ease 1s forwards;
  min-width: 60px;
  min-height: 60px;
}

@keyframes slideUpLauncher {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-launcher:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
  background: linear-gradient(135deg, var(--hv-accent), var(--hv-danger));
}

.chatbot-launcher:active {
  transform: scale(0.95);
}

.chatbot-launcher span {
  display: inline;
  white-space: nowrap;
}

/* ============================================
   SCROLLBAR
   ============================================ */
.chatbot-body::-webkit-scrollbar {
  width: 6px;
}

.chatbot-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.chatbot-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  transition: background 0.2s;
}

.chatbot-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   TABLET RESPONSIVE (768px - 1024px)
   ============================================ */
@media screen and (max-width: 1024px) {
  .chatbot-widget {
    width: 360px;
    height: 385px;
    bottom: 200px;
    right: 20px;
  }

  .chatbot-launcher {
    bottom: 127px;
    right: 20px;
    padding: 14px 20px;
  }
}

/* ============================================
   MOBILE RESPONSIVE (481px - 767px)
   ============================================ */
@media screen and (max-width: 767px) {
  .chatbot-widget {

    width: 360px;
    height: 480px;
    bottom: 200px;
    right: 20px;
  }

  .chatbot-header {
    padding: 14px 16px;
  }

  .chatbot-title {
    font-size: 15px;
  }

  .chatbot-body {
    padding: 16px 12px;
  }

  .message-content {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 13.5px;
  }

  .chatbot-footer {
    padding: 12px;
    gap: 8px;
  }

  .chatbot-input {
    padding: 11px 14px;
    font-size: 14px;
  }

  .chatbot-send-btn {
    padding: 11px 18px;
    font-size: 13px;
    min-width: 60px;
  }

  .chatbot-launcher {
    bottom: 127px;
    right: 20px;
    padding: 14px 18px;
    font-size: 14px;
  }

  .chatbot-launcher span {
    display: inline;
  }
}

/* ============================================
   SMALL MOBILE RESPONSIVE (320px - 480px)
   ============================================ */
@media screen and (max-width: 480px) {
  .chatbot-widget {
    width: 320px;
    height: 400px;
    bottom: 200px;
    right: 20px;
  }

  .chatbot-header {
    padding: 12px 14px;
  }

  .chatbot-title {
    font-size: 14px;
  }

  .chatbot-btn {
    font-size: 18px;
    padding: 4px 8px;
    min-width: 28px;
    min-height: 28px;
  }

  .chatbot-body {
    padding: 12px 10px;
    gap: 10px;
  }

  .message-content {
    max-width: 90%;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 16px;
  }

  .chatbot-footer {
    padding: 10px;
    gap: 6px;
  }

  .chatbot-input {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 20px;
  }

  .chatbot-send-btn {
    padding: 10px 16px;
    font-size: 12px;
    min-width: 55px;
    border-radius: 20px;
  }

  .chatbot-launcher {
    bottom: 130px;
    right: 23px;
    padding: 12px 16px;
    font-size: 13px;
    min-width: 55px;
    min-height: 55px;
  }

  .chatbot-launcher span {
    font-size: 12px;
  }
}

/* ============================================
   EXTRA SMALL DEVICES (< 360px)
   ============================================ */
@media screen and (max-width: 360px) {
  .chatbot-widget {
    width: calc(100vw - 20px);
    height: calc(100vh - 160px);
    max-height: 400px;
    bottom: 200px;
    right: 10px;
    left: 10px;
  }

  .chatbot-launcher {
    bottom: 130px;
    right: 23px;
    padding: 10px 14px;
    min-width: 50px;
    min-height: 50px;
  }

  .chatbot-launcher span {
    display: none;
  }

  .message-content {
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* ============================================
   LANDSCAPE MODE (Mobile)
   ============================================ */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .chatbot-widget {
    height: calc(100vh - 100px);
    max-height: 350px;
    bottom: 60px;
  }

  .chatbot-launcher {
    bottom: 10px;
    padding: 10px 16px;
    min-width: 50px;
    min-height: 50px;
  }

  .chatbot-body {
    padding: 10px;
  }

  .chatbot-header {
    padding: 10px 14px;
  }

  .chatbot-footer {
    padding: 8px;
  }
}

/* ============================================
   TOUCH DEVICE IMPROVEMENTS
   ============================================ */
@media (hover: none) and (pointer: coarse) {

  .chatbot-btn,
  .chatbot-send-btn,
  .chatbot-launcher {
    /* Larger touch targets for mobile */
    min-height: 44px;
  }

  .chatbot-input {
    font-size: 16px;
    /* Prevents zoom on iOS */
  }
}

/* ============================================
   HIGH DPI SCREENS
   ============================================ */
@media screen and (-webkit-min-device-pixel-ratio: 2),
screen and (min-resolution: 192dpi) {
  .chatbot-widget {
    border-width: 0.5px;
  }
}