/* PREMIUM CHATBOT WIDGET */
#chatbot-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#chatbot-toggle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5), 0 4px 12px rgba(118, 75, 162, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5), 0 4px 12px rgba(118, 75, 162, 0.4); }
  50% { box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6), 0 6px 16px rgba(118, 75, 162, 0.5); }
}

#chatbot-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#chatbot-toggle:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 16px 40px rgba(102, 126, 234, 0.6), 0 8px 20px rgba(118, 75, 162, 0.5);
  animation: none;
}

#chatbot-toggle:hover::before {
  opacity: 1;
}

#chatbot-toggle:active {
  transform: scale(1.05);
}

#chatbot-toggle svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#chatbot-window {
  position: absolute;
  bottom: 96px;
  right: 0;
  width: 420px;
  max-width: calc(100vw - 56px);
  height: 600px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(30px) saturate(180%);
  border-radius: 24px;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.2), 0 12px 32px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.8);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

#chatbot-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

#chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

#chatbot-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

#chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 10px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}

.bot-message, 
.user-message {
  padding: 16px 20px;
  border-radius: 18px;
  max-width: 85%;
  line-height: 1.6;
  font-size: 15px;
  animation: messageSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@keyframes messageSlide {
  from { 
    opacity: 0; 
    transform: translateY(15px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.bot-message {
  background: white;
  color: #0f172a;
  align-self: flex-start;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.user-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  align-self: flex-end;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.typing-indicator {
  display: flex;
  gap: 6px;
  padding: 16px 20px;
  background: white;
  border-radius: 18px;
  width: fit-content;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.typing-indicator span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { 
    transform: translateY(0); 
    opacity: 0.7;
  }
  30% { 
    transform: translateY(-14px); 
    opacity: 1;
  }
}

#chatbot-form {
  display: flex;
  gap: 12px;
  padding: 24px;
  background: white;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

#chatbot-input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 24px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
  background: #f8fafc;
}

#chatbot-input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#chatbot-send {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

#chatbot-send::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#chatbot-send:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

#chatbot-send:hover::before {
  opacity: 1;
}

#chatbot-send:active {
  transform: scale(1.05);
}

#chatbot-send:disabled {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 480px) {
  #chatbot-widget {
    bottom: 20px;
    right: 20px;
  }
  
  #chatbot-toggle {
    width: 64px;
    height: 64px;
  }
  
  #chatbot-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 140px);
    bottom: 88px;
    border-radius: 20px;
  }
}
