/* AI Chat Assistant — global styles for all pages */
/* Desktop: floating right of hero / content area, always visible */
/* Mobile: bottom-center floating bar */

/* Floating button — desktop: hero-adjacent right side */
.aicb {
  position: fixed;
  top: 120px;
  right: 24px;
  z-index: 999;
}

.aicb .aibt {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(124,58,237,0.5);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.aicb .aibt:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(124,58,237,0.5);
}

/* Pulsing green dot indicator */
.aicb .aibt::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34d399;
  border: 2px solid #05050a;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}

/* Chat dialog — desktop: right side, below button */
.aicd {
  position: fixed;
  top: 178px;
  right: 24px;
  width: 380px;
  height: 460px;
  background: rgba(13,13,20,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  z-index: 999;
}

.aich {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(124,58,237,0.06);
}

.aichl {
  font-size: 14px;
  font-weight: 600;
  color: #a78bfa;
  display: flex;
  align-items: center;
  gap: 8px;
}

.aichc {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
}

.aichc:hover { color: #fff; }

.aibox {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aibox::-webkit-scrollbar { width: 4px; }
.aibox::-webkit-scrollbar-track { background: transparent; }
.aibox::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.aiu { display: flex; max-width: 85%; }
.aiur { align-self: flex-end; }
.aias { align-self: flex-start; }
.aib { align-self: flex-start; }

.aic {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.aiur .aic {
  background: #7c3aed;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.aib .aic {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-left-radius: 4px;
}

.aias .aic { padding: 6px 14px; }

.aith {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
}

.aith span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  animation: ab 1.4s infinite;
}

.aith span:nth-child(2) { animation-delay: 0.2s; }
.aith span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ab {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

.aiinput {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.aiinput input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  outline: none;
  font-family: 'Inter', sans-serif;
}

.aiinput input:focus { border-color: #7c3aed; }

.aiinput button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #7c3aed;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  font-size: 16px;
}

.aiinput button:hover { background: #6d28d9; }

/* ============================== */
/* MOBILE: < 768px               */
/* ============================== */
@media (max-width: 768px) {
  /* Button: bottom-center, floating above everything */
  .aicb {
    bottom: 20px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .aicb .aibt {
    width: 56px;
    height: 56px;
    font-size: 24px;
    box-shadow: 0 4px 24px rgba(124,58,237,0.5);
  }

  /* Remove pulse dot on mobile (simpler) */
  .aicb .aibt::after { display: none; }

  /* Chat dialog: full-width bottom sheet */
  .aicd {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 70vh;
    max-height: 500px;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
}
