.adishai-widget {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 380px;
}

.adishai-floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  max-width: 380px;
}

.adishai-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.adishai-header {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 16px 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.adishai-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.adishai-header-text {
  display: flex;
  flex-direction: column;
}

.adishai-header-title {
  font-size: 16px;
  font-weight: 600;
}

.adishai-header-status {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}

.adishai-body {
  padding: 0;
}

.adishai-muted {
  color: #64748b;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
}

.adishai-lead-form {
  padding: 20px;
}

.adishai-lead-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin: 12px 0 6px;
  color: #374151;
}

.adishai-lead-form label:first-of-type {
  margin-top: 0;
}

.adishai-lead-form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f9fafb;
}

.adishai-lead-form input[type="text"]:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: #fff;
}

.adishai-lead-form input[type="text"]::placeholder {
  color: #9ca3af;
}

.adishai-turnstile {
  margin-top: 12px;
}

.adishai-widget button {
  margin-top: 16px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  width: 100%;
}

.adishai-widget button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.adishai-widget button:active {
  transform: translateY(0);
}

.adishai-widget button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.adishai-chat {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px;
}

.adishai-messages {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px;
  background: #f8fafc;
  border-radius: 12px;
}

.adishai-messages::-webkit-scrollbar {
  width: 6px;
}

.adishai-messages::-webkit-scrollbar-track {
  background: transparent;
}

.adishai-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.adishai-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.adishai-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  animation: adishai-fade-in 0.2s ease-out;
}

@keyframes adishai-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.adishai-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.adishai-assistant {
  align-self: flex-start;
  background: #fff;
  color: #1f2937;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.adishai-message.adishai-assistant::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #e2e8f0;
}

.adishai-message.adishai-user.adishai-assistant::before {
  display: none;
}

.adishai-debug-meta {
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.adishai-chat-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.adishai-chat-form input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.adishai-chat-form input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.adishai-chat-form input::placeholder {
  color: #94a3b8;
}

.adishai-chat-form button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.adishai-chat-form button svg {
  width: 20px;
  height: 20px;
}

.adishai-persistent-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.adishai-persistent-wa:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
  color: #fff !important;
}

.adishai-handoff-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.adishai-handoff-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  color: #fff !important;
}

.adishai-mode-floating .adishai-panel {
  width: 360px;
  margin-bottom: 16px;
  transform-origin: bottom right;
  animation: adishai-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.adishai-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 0;
  overflow: hidden;
  position: relative;
}

.adishai-launcher::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.adishai-launcher:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.adishai-launcher:hover::before {
  opacity: 1;
}

.adishai-open .adishai-launcher {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.adishai-open .adishai-launcher span {
  display: none;
}

.adishai-open .adishai-launcher::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transform: rotate(45deg);
}

.adishai-launcher-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.adishai-launcher-text {
  display: inline-block;
  position: relative;
  z-index: 1;
}

.adishai-launcher-fallback {
  display: none;
}

.adishai-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.adishai-typing span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: adishai-typing-bounce 1.4s infinite ease-in-out;
}

.adishai-typing span:nth-child(1) {
  animation-delay: 0s;
}

.adishai-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.adishai-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes adishai-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

@keyframes adishai-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .adishai-widget {
    max-width: 100%;
  }
  .adishai-floating {
    right: 12px;
    bottom: 12px;
  }
  .adishai-mode-floating .adishai-panel {
    width: min(92vw, 360px);
  }
  .adishai-launcher {
    width: 56px;
    height: 56px;
  }
}
