/* ===================================================
   ASK AI CHAT WIDGET
   =================================================== */
.ask-ai-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F5A623 0%, #15243A 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 8px 24px rgba(21, 36, 58, 0.4);
  cursor: pointer;
  z-index: 998;
  transition: transform .3s ease, box-shadow .3s ease;
  border: none;
}
.ask-ai-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(21, 36, 58, 0.55);
}
.ask-ai-btn:hover .ask-ai-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
.ask-ai-btn .pulse {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: rgba(245, 166, 35, 0.6);
  animation: ai-pulse 2s infinite;
  z-index: -1;
}
@keyframes ai-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}
.ask-ai-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #F5A623;
  color: #15243A;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Tooltip popup on button hover */
.ask-ai-tooltip {
  position: absolute;
  right: 76px;
  top: 0%;
  transform: translateY(-50%) translateX(8px);
  background: #fff;
  color: #15243A;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all .25s ease;
  pointer-events: none;
  z-index: 1000;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ask-ai-tooltip strong {
  font-size: 13px;
  color: #15243A;
  font-weight: 700;
}
.ask-ai-tooltip span {
  font-size: 11px;
  color: #6c7a5f;
  font-weight: 400;
}
.ask-ai-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 6px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
@media (max-width: 768px) {
  /* On mobile, show tooltip ABOVE the button so it doesn't go off-screen */
  .ask-ai-tooltip {
    right: 50%;
    top: auto;
    bottom: 76px;
    transform: translateX(50%) translateY(8px);
  }
  .ask-ai-tooltip::after {
    right: 50%;
    top: auto;
    bottom: -6px;
    transform: translateX(50%) rotate(90deg);
    border-left: 6px solid #fff;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
  }
  .ask-ai-btn:hover .ask-ai-tooltip {
    transform: translateX(50%) translateY(0);
  }
}

/* Header action buttons container */
.ask-ai-header .header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ask-ai-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  font-family: var(--font);
  animation: slideUp .3s ease;
}
.ask-ai-panel.open { display: flex; }
.ask-ai-panel.maximized {
  bottom: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  z-index: 10000;
}

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

.ask-ai-header {
  background: linear-gradient(135deg, #F5A623 0%, #15243A 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ask-ai-header .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: 20px;
}
.ask-ai-header .info { flex: 1; }
.ask-ai-header h4 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; }
.ask-ai-header .status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.95;
}
.ask-ai-header .status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #A8D8A8;
  box-shadow: 0 0 6px #A8D8A8;
}
.ask-ai-header button {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.ask-ai-header button:hover { background: rgba(255,255,255,0.25); }

.ask-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f7f9f5;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ask-ai-messages::-webkit-scrollbar { width: 5px; }
.ask-ai-messages::-webkit-scrollbar-thumb { background: #c8d6b8; border-radius: 5px; }

.ask-ai-panel.maximized .ai-msg,
.ask-ai-panel.maximized .user-msg {
  max-width: 70%;
  font-size: 15px;
  padding: 14px 18px;
  line-height: 1.65;
}
.ask-ai-panel.maximized .ask-ai-input input {
  font-size: 16px;
  padding: 14px 18px;
}
.ask-ai-panel.maximized .ask-ai-input button {
  width: 48px; height: 48px;
  font-size: 16px;
}

.ai-msg, .user-msg {
  max-width: 85%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.ai-msg {
  background: #fff;
  color: #15243A;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  align-self: flex-start;
}
.user-msg {
  background: linear-gradient(135deg, #F5A623 0%, #15243A 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.ai-msg strong { color: #15243A; }
.ai-msg ul, .ai-msg ol { margin: 6px 0 6px 18px; }
.ai-msg li { margin: 3px 0; }

.typing {
  display: flex;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  align-self: flex-start;
}
.typing span {
  width: 7px; height: 7px;
  background: #F5A623;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing 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; }
}

.ask-ai-suggestions {
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid #e8eedc;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ask-ai-suggestions .chip {
  background: #f0f5e8;
  color: #15243A;
  border: 1px solid #c8d6b8;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
}
.ask-ai-suggestions .chip:hover {
  background: #F5A623;
  color: #fff;
  border-color: #F5A623;
  transform: translateY(-1px);
}

.ask-ai-quick {
  padding: 8px 18px;
  background: #f7f9f5;
  border-top: 1px solid #e8eedc;
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.ask-ai-quick.show { display: flex; }
.ask-ai-quick button {
  background: #fff;
  border: 1px solid #c8d6b8;
  color: #15243A;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
}
.ask-ai-quick button:hover {
  background: #F5A623;
  color: #fff;
  border-color: #F5A623;
}

.ask-ai-input {
  padding: 14px 18px;
  background: #fff;
  border-top: 1px solid #e8eedc;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ask-ai-input input {
  flex: 1;
  border: 1px solid #d8e0c8;
  background: #f7f9f5;
  padding: 10px 14px;
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  color: #15243A;
  outline: none;
  transition: border-color .2s ease;
}
.ask-ai-input input:focus { border-color: #F5A623; background: #fff; }
.ask-ai-input button {
  background: linear-gradient(135deg, #F5A623 0%, #15243A 100%);
  color: #fff;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform .2s ease;
}
.ask-ai-input button:hover { transform: scale(1.08); }
.ask-ai-input button:disabled { opacity: 0.5; cursor: not-allowed; }

.ask-ai-disclaimer {
  padding: 6px 18px;
  text-align: center;
  font-size: 10px;
  color: #95a085;
  background: #f7f9f5;
}

@media (max-width: 480px) {
  .ask-ai-panel {
    right: 12px;
    bottom: 90px;
    width: calc(100vw - 24px);
    height: calc(100vh - 110px);
  }
  .ask-ai-btn { right: 16px; bottom: 16px; }
}
