/* ======================================================
   ICC Afia Floating Assistant
   Works on admissions, student academics and teacher pages.
   ====================================================== */

:root {
  --afia-float-navy: #071a3d;
  --afia-float-blue: #1d5cff;
  --afia-float-gold: #f4c542;
  --afia-float-line: #dbe5f4;
  --afia-float-soft: #f7faff;
  --afia-float-muted: #5d6b86;
}

#afiaFloatingAssistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--afia-float-navy);
}

.afia-float-launcher {
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 22px 54px rgba(7, 26, 61, 0.25);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.afia-float-launcher::after {
  content: "Ask Afia";
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  background: rgba(7, 26, 61, 0.86);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

.afia-float-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.afia-float-launcher .pulse {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #19c37d;
  box-shadow: 0 0 0 8px rgba(25, 195, 125, 0.15);
}

.afia-float-panel {
  width: min(430px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 40px));
  position: fixed;
  right: 22px;
  bottom: 118px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(219, 229, 244, 0.96);
  box-shadow: 0 30px 80px rgba(7, 26, 61, 0.26);
  overflow: hidden;
  display: none;
  grid-template-rows: auto 1fr auto;
}

#afiaFloatingAssistant.open .afia-float-panel {
  display: grid;
}

.afia-float-header {
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, #071a3d, #0f4c81);
  color: #fff;
}

.afia-float-header img {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255, 255, 255, 0.58);
}

.afia-float-title {
  flex: 1;
  min-width: 0;
}

.afia-float-title strong {
  display: block;
  font-size: 18px;
  font-weight: 1000;
}

.afia-float-title span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 750;
}

.afia-float-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
}

.afia-float-messages {
  padding: 16px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.afia-float-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.afia-float-msg.user {
  flex-direction: row-reverse;
}

.afia-float-badge {
  min-width: 42px;
  height: 36px;
  border-radius: 13px;
  background: var(--afia-float-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 1000;
}

.afia-float-msg.user .afia-float-badge {
  background: #eef4ff;
  color: var(--afia-float-navy);
}

.afia-float-bubble {
  border: 1px solid var(--afia-float-line);
  background: #fff;
  border-radius: 18px;
  padding: 12px 13px;
  line-height: 1.48;
  font-size: 14px;
  font-weight: 650;
  white-space: pre-wrap;
  box-shadow: 0 10px 24px rgba(7, 26, 61, 0.07);
}

.afia-float-msg.user .afia-float-bubble {
  background: #eef4ff;
}

.afia-float-form {
  border-top: 1px solid var(--afia-float-line);
  padding: 12px;
  background: #fff;
}

.afia-float-input {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid #cbd8ee;
  border-radius: 18px;
  padding: 12px;
  outline: none;
  font: inherit;
  line-height: 1.45;
}

.afia-float-input:focus {
  border-color: var(--afia-float-blue);
  box-shadow: 0 0 0 4px rgba(29, 92, 255, 0.14);
}

.afia-float-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.afia-float-status {
  color: var(--afia-float-muted);
  font-size: 12px;
  font-weight: 800;
}

.afia-float-send,
.afia-float-voice {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 950;
  cursor: pointer;
}

.afia-float-send {
  background: linear-gradient(135deg, #1d5cff, #0f4c81);
  color: #fff;
}

.afia-float-voice {
  background: #eef4ff;
  color: var(--afia-float-navy);
}

.afia-float-send:disabled {
  opacity: .6;
  cursor: wait;
}

/* Remove the artificial lip overlay completely. Real photo remains clean. */
#afiaPhotoMouth,
.afia-photo-mouth,
.afia-mouth-sync,
.afia-mouth,
.afia-photo-lip,
.afia-lip-sync {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  animation: none !important;
}

@media (max-width: 680px) {
  #afiaFloatingAssistant {
    right: 14px;
    bottom: 14px;
  }
  .afia-float-panel {
    right: 14px;
    bottom: 108px;
    width: calc(100vw - 28px);
    height: min(640px, calc(100vh - 126px));
  }
}


/* ===== Remove artificial Afia mouth overlay ===== */
#afiaPhotoMouth,
.afia-photo-mouth,
.afia-mouth-sync,
.afia-mouth,
.afia-photo-lip,
.afia-lip-sync {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  animation: none !important;
}
