/* Maverick AI Chat Widget */

#mav-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B6FDB 0%, #091224 100%);
  border: 2px solid rgba(125,249,255,0.35);
  box-shadow: 0 0 24px rgba(125,249,255,0.18), 0 4px 20px rgba(0,0,0,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#mav-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 36px rgba(125,249,255,0.3), 0 6px 24px rgba(0,0,0,0.55);
}

#mav-chat-btn svg {
  width: 28px;
  height: 28px;
}

#mav-chat-panel {
  position: fixed;
  bottom: 104px;
  right: 28px;
  z-index: 9998;
  width: 384px;
  display: flex;
  flex-direction: column;
  max-height: 560px;
  background: #0A1428;
  border: 1px solid rgba(125,249,255,0.18);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.65), 0 0 32px rgba(125,249,255,0.06);
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#mav-chat-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
}

/* Header */
.mav-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #0F1E3A, #091224);
  border-bottom: 1px solid rgba(125,249,255,0.12);
  flex-shrink: 0;
}

.mav-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1B6FDB, #0A1428);
  border: 1.5px solid rgba(125,249,255,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mav-header-text h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.mav-header-text p {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #7DF9FF;
  margin: 3px 0 0;
  line-height: 1;
}

.mav-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #7A8BA8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.mav-chat-close:hover { color: #7DF9FF; }

/* Messages */
.mav-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.mav-chat-messages::-webkit-scrollbar { width: 4px; }
.mav-chat-messages::-webkit-scrollbar-track { background: transparent; }
.mav-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(125,249,255,0.18);
  border-radius: 2px;
}

.mav-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.mav-msg.bot {
  background: #0F1E3A;
  border: 1px solid rgba(125,249,255,0.1);
  color: #C8D4E6;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.mav-msg.user {
  background: linear-gradient(135deg, #1B6FDB, #0D4FA8);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.mav-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  background: #0F1E3A;
  border: 1px solid rgba(125,249,255,0.1);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.mav-typing span {
  width: 7px;
  height: 7px;
  background: rgba(125,249,255,0.45);
  border-radius: 50%;
  animation: mav-dot 1.3s ease-in-out infinite;
}

.mav-typing span:nth-child(2) { animation-delay: 0.22s; }
.mav-typing span:nth-child(3) { animation-delay: 0.44s; }

@keyframes mav-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* CTA section (shown after summary) */
.mav-chat-cta {
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(125,249,255,0.1);
  background: linear-gradient(180deg, rgba(125,249,255,0.02), transparent);
  flex-shrink: 0;
}

.mav-chat-cta.hidden { display: none; }

.mav-book-btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: linear-gradient(135deg, #7DF9FF, #2E8AF5);
  color: #050B1A;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 10px;
  transition: opacity 0.15s;
}

.mav-book-btn:hover { opacity: 0.88; }

.mav-email-label {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  color: #7A8BA8;
  margin-bottom: 6px;
}

.mav-email-row {
  display: flex;
  gap: 8px;
}

.mav-email-row input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(125,249,255,0.18);
  border-radius: 7px;
  padding: 8px 10px;
  color: #E8F0F8;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s;
}

.mav-email-row input::placeholder { color: #7A8BA8; }
.mav-email-row input:focus { border-color: rgba(125,249,255,0.4); }

.mav-email-row button {
  background: rgba(125,249,255,0.1);
  border: 1px solid rgba(125,249,255,0.28);
  color: #7DF9FF;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.mav-email-row button:hover { background: rgba(125,249,255,0.18); }
.mav-email-row button:disabled { opacity: 0.5; cursor: not-allowed; }

.mav-email-sent {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #7DF9FF;
  text-align: center;
  padding: 6px 0 2px;
}

/* Input area */
.mav-chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(125,249,255,0.08);
  background: rgba(5,11,26,0.5);
  flex-shrink: 0;
}

.mav-chat-input-area textarea {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(125,249,255,0.14);
  border-radius: 8px;
  padding: 9px 12px;
  color: #E8F0F8;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  resize: none;
  outline: none;
  min-height: 38px;
  max-height: 90px;
  transition: border-color 0.15s;
}

.mav-chat-input-area textarea::placeholder { color: #7A8BA8; }
.mav-chat-input-area textarea:focus { border-color: rgba(125,249,255,0.32); }

.mav-send-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1B6FDB, #0D4FA8);
  border: 1px solid rgba(125,249,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
}

.mav-send-btn:hover { opacity: 0.82; }
.mav-send-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Tooltip bubble */
#mav-chat-tooltip {
  position: fixed;
  bottom: 104px;
  right: 24px;
  z-index: 9997;
  background: #0F1E3A;
  border: 1px solid rgba(125,249,255,0.3);
  border-radius: 12px;
  padding: 12px 36px 12px 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 16px rgba(125,249,255,0.08);
  max-width: 220px;
  animation: mav-tooltip-in 0.35s ease forwards;
  cursor: default;
}

#mav-chat-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 22px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #0F1E3A;
  filter: drop-shadow(0 2px 0 rgba(125,249,255,0.2));
}

#mav-chat-tooltip p {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #C8D4E6;
  margin: 0;
  line-height: 1.5;
}

#mav-chat-tooltip strong { color: #7DF9FF; }

#mav-chat-tooltip.mav-tooltip-out {
  animation: mav-tooltip-out 0.2s ease forwards;
}

.mav-tooltip-close {
  position: absolute;
  top: 7px;
  right: 8px;
  background: none;
  border: none;
  color: #7A8BA8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: color 0.15s;
}

.mav-tooltip-close:hover { color: #7DF9FF; }

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

@keyframes mav-tooltip-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(6px); }
}

/* Pulse ring on chat button */
#mav-chat-btn.mav-btn-pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(125,249,255,0.5);
  animation: mav-ring 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes mav-ring {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Mobile */
@media (max-width: 440px) {
  #mav-chat-btn { right: 16px; bottom: 20px; }
  #mav-chat-panel { right: 12px; left: 12px; width: auto; bottom: 92px; }
  #mav-chat-tooltip { right: 12px; }
}
