/* ============================================
   🤖 SMK CHATBOT - MODERN UI/UX
   Beautiful Green Theme Chatbot Widget
   ============================================ */

/* === CHATBOT WIDGET CONTAINER === */
.smk-chatbot-widget,
.smk-chatbot {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}

/* === FLOATING TOGGLE BUTTON === */
.smk-chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16a34a 0%, #10b981 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(22, 163, 74, 0.4), 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: chatbot-pulse 2s ease-in-out infinite;
}

.smk-chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(22, 163, 74, 0.5), 0 6px 16px rgba(0, 0, 0, 0.15);
}

.smk-chatbot-toggle:active {
  transform: scale(0.95);
}

.smk-chatbot-toggle i {
  font-size: 24px;
  color: white;
  transition: transform 0.3s ease;
}

.smk-chatbot-toggle.active i {
  transform: rotate(180deg);
}

@keyframes chatbot-pulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(22, 163, 74, 0.4), 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 8px 32px rgba(22, 163, 74, 0.6), 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(22, 163, 74, 0.15);
  }
}

/* === CHATBOT CONTAINER === */
.smk-chatbot-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: white;
  border-radius: 24px;
  box-shadow: 0 25px 80px -10px rgba(0, 0, 0, 0.25), 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.smk-chatbot-container.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* === CHATBOT HEADER === */
.smk-chatbot-header {
  background: linear-gradient(135deg, #16a34a 0%, #10b981 50%, #059669 100%);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.smk-chatbot-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.smk-chatbot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.smk-chatbot-avatar i {
  font-size: 22px;
  color: white;
}

.smk-chatbot-info {
  flex: 1;
  min-width: 0;
}

.smk-chatbot-title {
  font-weight: 700;
  font-size: 16px;
  color: white;
  margin: 0 0 2px 0;
}

.smk-chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.smk-chatbot-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86efac;
  box-shadow: 0 0 8px #86efac;
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.smk-chatbot-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.smk-chatbot-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.smk-chatbot-close i {
  font-size: 16px;
  color: white;
}

/* === MESSAGES CONTAINER === */
.smk-chatbot-messages {
  height: 340px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  scroll-behavior: smooth;
}

.smk-chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.smk-chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.smk-chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.smk-chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* === MESSAGE BUBBLES === */
.smk-chatbot-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: message-appear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes message-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.smk-chatbot-message.bot {
  align-self: flex-start;
}

.smk-chatbot-message.user {
  align-self: flex-end;
}

.smk-chatbot-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.smk-chatbot-message.bot .smk-chatbot-bubble {
  background: white;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.smk-chatbot-message.user .smk-chatbot-bubble {
  background: linear-gradient(135deg, #16a34a 0%, #10b981 100%);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.smk-chatbot-message .bot-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
  padding: 0 4px;
}

/* === LOADING INDICATOR === */
.smk-chatbot-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  font-size: 13px;
  color: #64748b;
  max-width: 85%;
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.smk-chatbot-loading-dots {
  display: flex;
  gap: 4px;
}

.smk-chatbot-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: loading-bounce 1.4s ease-in-out infinite;
}

.smk-chatbot-loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.smk-chatbot-loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loading-bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* === QUICK REPLIES === */
.smk-chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 16px;
  background: white;
}

.smk-chatbot-quick-reply {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.smk-chatbot-quick-reply:hover {
  background: #dcfce7;
  border-color: #86efac;
  transform: translateY(-1px);
}

/* === INPUT FORM === */
.smk-chatbot-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.smk-chatbot-input,
.smk-chatbot-form input[type="text"],
.smk-chatbot-form textarea {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  outline: none;
  transition: all 0.2s ease;
  resize: none;
}

.smk-chatbot-input:focus,
.smk-chatbot-form input[type="text"]:focus,
.smk-chatbot-form textarea:focus {
  background: white;
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.smk-chatbot-input::placeholder {
  color: #94a3b8;
}

.smk-chatbot-form button[type="submit"] {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #16a34a 0%, #10b981 100%);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.smk-chatbot-form button[type="submit"]:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.smk-chatbot-form button[type="submit"]:active {
  transform: scale(0.95);
}

.smk-chatbot-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* === LINKS IN MESSAGES === */
.smk-chatbot-messages a {
  color: #16a34a;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed #86efac;
  transition: all 0.2s ease;
}

.smk-chatbot-messages a:hover {
  color: #15803d;
  border-bottom-color: #16a34a;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 480px) {
  .smk-chatbot-toggle {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
  
  .smk-chatbot-toggle i {
    font-size: 22px;
  }
  
  .smk-chatbot-container {
    bottom: 80px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    border-radius: 20px;
  }
  
  .smk-chatbot-header {
    padding: 16px;
  }
  
  .smk-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  
  .smk-chatbot-avatar i {
    font-size: 18px;
  }
  
  .smk-chatbot-title {
    font-size: 15px;
  }
  
  .smk-chatbot-messages {
    height: 300px;
    max-height: 45vh;
    padding: 16px;
    gap: 12px;
  }
  
  .smk-chatbot-bubble {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .smk-chatbot-form {
    padding: 12px 16px;
  }
  
  .smk-chatbot-input,
  .smk-chatbot-form input[type="text"] {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 14px;
  }
  
  .smk-chatbot-form button[type="submit"] {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 14px;
  }
}

/* === QUICK QUESTIONS === */
.smk-chatbot-quick-questions {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
  border: 1px solid #bbf7d0;
}

.smk-quick-label {
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.smk-quick-label::before {
  content: '💡';
}

.smk-quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.smk-quick-btn {
  background: white;
  border: 1px solid #d1fae5;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #166534;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.smk-quick-btn:hover {
  background: linear-gradient(135deg, #16a34a 0%, #10b981 100%);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.smk-quick-btn:active {
  transform: translateY(0);
}

/* === TYPING ANIMATION === */
.smk-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

.smk-typing-dots span {
  width: 6px;
  height: 6px;
  background: #16a34a;
  border-radius: 50%;
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.smk-typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.smk-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.smk-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.smk-chatbot-loading {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 13px;
  color: #64748b;
  max-width: 85%;
}

/* === DARK MODE SUPPORT (OPTIONAL) === */
@media (prefers-color-scheme: dark) {
  .smk-chatbot-container {
    /* Can add dark mode styles if needed */
  }
}

/* === PRINT HIDE === */
@media print {
  .smk-chatbot-widget,
  .smk-chatbot-toggle,
  .smk-chatbot-container {
    display: none !important;
  }
}
