/* UtilityDesk AI Assistant */
.ud-assistant-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9997;
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.ud-assistant-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.6);
}

.ud-assistant-trigger svg {
  width: 28px;
  height: 28px;
  fill: white;
}

.ud-assistant-trigger.active {
  animation: none;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(37, 99, 235, 0.6); }
}

.ud-assistant-widget {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 400px;
  height: 600px;
  max-height: calc(100vh - 140px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  z-index: 9996;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.ud-assistant-widget.active {
  display: flex;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ud-assistant-header {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ud-assistant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.ud-assistant-info {
  flex: 1;
}

.ud-assistant-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.ud-assistant-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ud-assistant-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ud-assistant-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.ud-assistant-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ud-assistant-close svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.ud-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8fafc;
}

.ud-assistant-message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ud-assistant-message.user {
  flex-direction: row-reverse;
}

.ud-assistant-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ud-assistant-message.user .ud-assistant-message-avatar {
  background: #2563eb;
  color: white;
  font-size: 14px;
}

.ud-assistant-message-content {
  max-width: 280px;
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ud-assistant-message.user .ud-assistant-message-content {
  background: #2563eb;
  color: white;
}

.ud-assistant-message-content p {
  margin: 0 0 8px 0;
}

.ud-assistant-message-content p:last-child {
  margin-bottom: 0;
}

.ud-assistant-calculator-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  color: #2563eb;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  transition: all 0.2s;
  border: 1px solid #dbeafe;
}

.ud-assistant-calculator-link:hover {
  background: #dbeafe;
  transform: translateX(4px);
}

.ud-assistant-quick-actions {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ud-assistant-quick-btn {
  padding: 8px 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.ud-assistant-quick-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  transform: translateY(-1px);
}

.ud-assistant-input-area {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
}

.ud-assistant-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.ud-assistant-input:focus {
  border-color: #2563eb;
}

.ud-assistant-send {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #2563eb;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ud-assistant-send:hover {
  background: #1e40af;
  transform: scale(1.05);
}

.ud-assistant-send:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

.ud-assistant-send svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.ud-assistant-typing {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.ud-assistant-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typing 1.4s infinite;
}

.ud-assistant-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ud-assistant-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }
  30% { transform: translateY(-10px); opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
  .ud-assistant-widget {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 84px;
    height: calc(100vh - 120px);
  }
  
  .ud-assistant-trigger {
    width: 56px;
    height: 56px;
    bottom: 20px;
    right: 16px;
  }
}
