/* ============================================================
   ZAAK SAP B1 ADVISOR — FLOATING LEAD ASSISTANT
   ============================================================ */

/* Chat Floating Trigger Button */
.zaak-advisor-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--blue, #1A1AE0);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 8px 28px rgba(26, 26, 224, 0.35), 0 2px 10px rgba(0,0,0,0.1);
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
}
.zaak-advisor-trigger:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 36px rgba(26, 26, 224, 0.45);
  background: #1212B8;
}
.zaak-advisor-trigger-icon {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.zaak-advisor-online-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #FFFFFF;
  margin-left: -4px;
  margin-top: -12px;
}

/* Chat Widget Container */
.zaak-advisor-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(10, 15, 45, 0.22), 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #E2E8F0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, sans-serif;
  animation: zaakAdvisorSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.zaak-advisor-window.active {
  display: flex;
}

@keyframes zaakAdvisorSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Chat Header */
.zaak-advisor-header {
  background: linear-gradient(135deg, #0B132B 0%, #1A1AE0 100%);
  color: #FFFFFF;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.zaak-advisor-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.zaak-advisor-avatar {
  width: 40px;
  height: 40px;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.zaak-advisor-avatar img {
  width: 24px;
  height: auto;
}
.zaak-advisor-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10B981;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
}
.zaak-advisor-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: #FFFFFF;
}
.zaak-advisor-subtitle {
  font-size: 0.76rem;
  color: #94A3B8;
  margin: 0;
}
.zaak-advisor-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.zaak-advisor-btn-ctrl {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}
.zaak-advisor-btn-ctrl:hover {
  color: #FFFFFF;
  background: rgba(255,255,255,0.15);
}

/* Chat Body (Message Feed) */
.zaak-advisor-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F8FAFC;
}

/* Chat Messages */
.zaak-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: zaakMsgFadeIn 0.25s ease-out;
}
@keyframes zaakMsgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.zaak-msg-bot {
  align-self: flex-start;
}
.zaak-msg-bot .zaak-msg-bubble {
  background: #FFFFFF;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  border-radius: 16px 16px 16px 4px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.zaak-msg-user {
  align-self: flex-end;
}
.zaak-msg-user .zaak-msg-bubble {
  background: #1A1AE0;
  color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 500;
}

.zaak-msg-time {
  font-size: 0.68rem;
  color: #94A3B8;
  margin-top: 4px;
  align-self: flex-start;
}
.zaak-msg-user .zaak-msg-time {
  align-self: flex-end;
}

/* Choice Buttons (Interactive Quick Actions) */
.zaak-advisor-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.zaak-opt-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #1E293B;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.zaak-opt-btn:hover {
  background: #F1F5F9;
  border-color: #1A1AE0;
  color: #1A1AE0;
  transform: translateX(2px);
}
.zaak-opt-btn i {
  color: #C8860A;
  font-size: 0.88rem;
}

/* Quick Form Inputs inside Chat */
.zaak-chat-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FFFFFF;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  margin-top: 6px;
}
.zaak-chat-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  font-size: 0.84rem;
  font-family: inherit;
  box-sizing: border-box;
}
.zaak-chat-input:focus {
  outline: none;
  border-color: #1A1AE0;
  box-shadow: 0 0 0 2px rgba(26,26,224,0.12);
}
.zaak-chat-submit {
  background: #1A1AE0;
  color: #FFFFFF;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.zaak-chat-submit:hover {
  background: #1212B8;
}

/* Action Card / Next Steps Card in Chat */
.zaak-action-card {
  background: #FDF8EE;
  border: 1px solid rgba(200,134,10,0.3);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}
.zaak-action-card h4 {
  font-size: 0.86rem;
  font-weight: 700;
  color: #92400E;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.zaak-action-card p {
  font-size: 0.78rem;
  color: #78350F;
  margin: 0 0 10px 0;
  line-height: 1.4;
}
.zaak-action-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zaak-action-btn-primary {
  background: #1A1AE0;
  color: #FFFFFF;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}
.zaak-action-btn-email {
  background: var(--gold, #C8860A);
  color: #FFFFFF;
  text-align: center;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s ease;
}
.zaak-action-btn-email:hover {
  background: #A66E08;
  color: #FFFFFF;
}

/* Chat Footer / Quick Input */
.zaak-advisor-footer {
  padding: 10px 14px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.zaak-advisor-footer input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  font-size: 0.84rem;
  font-family: inherit;
}
.zaak-advisor-footer input:focus {
  outline: none;
  border-color: #1A1AE0;
}
.zaak-advisor-send-btn {
  background: #1A1AE0;
  color: #FFFFFF;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.zaak-advisor-send-btn:hover {
  background: #1212B8;
}

@media (max-width: 480px) {
  .zaak-advisor-window {
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    height: 80vh;
  }
  .zaak-advisor-trigger span {
    display: none;
  }
  .zaak-advisor-trigger {
    padding: 12px;
    border-radius: 50%;
  }
}

/* Attention Pulse Glow on Trigger Button */
@keyframes zaakPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 26, 224, 0.6), 0 8px 28px rgba(26, 26, 224, 0.35);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(26, 26, 224, 0), 0 12px 36px rgba(26, 26, 224, 0.45);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 26, 224, 0), 0 8px 28px rgba(26, 26, 224, 0.35);
  }
}

.zaak-advisor-trigger {
  animation: zaakPulseGlow 3s infinite;
}

/* Attention-Grabbing Speech Bubble (Peek Popup) */
.zaak-advisor-peek {
  position: fixed;
  bottom: 86px;
  right: 24px;
  z-index: 9998;
  background: #FFFFFF;
  border: 1.5px solid rgba(26, 26, 224, 0.25);
  border-radius: 16px;
  padding: 12px 34px 12px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 16px 36px rgba(11, 19, 43, 0.16), 0 4px 12px rgba(0,0,0,0.06);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 330px;
  font-family: 'Inter', -apple-system, sans-serif;
}

.zaak-advisor-peek::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 48px;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-right: 1.5px solid rgba(26, 26, 224, 0.25);
  border-bottom: 1.5px solid rgba(26, 26, 224, 0.25);
  transform: rotate(45deg);
}

.zaak-advisor-peek.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: peekGentleHover 3.5s ease-in-out infinite 0.5s;
}

@keyframes peekGentleHover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.zaak-peek-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #F1F5F9;
  border: 1.5px solid rgba(26,26,224,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
}

.zaak-peek-avatar img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.zaak-peek-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zaak-peek-text strong {
  font-size: 0.85rem;
  color: #111111;
  font-weight: 700;
  line-height: 1.3;
}

.zaak-peek-text span {
  font-size: 0.78rem;
  color: var(--blue, #1A1AE0);
  font-weight: 600;
}

.zaak-peek-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: #94A3B8;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
  transition: var(--transition);
}

.zaak-peek-close:hover {
  color: #111111;
  background: #F1F5F9;
}
