/* Chatbot styles - matches CIIA site design */
/* Chatbot styles - matches CIIA site design */
.ciia-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2200;
  font-family: var(--font-body);
}

.ciia-chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--white);
  color: var(--primary-orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.ciia-chat-toggle:hover {
  transform: translateY(-4px);
}

.ciia-chat-toggle .ciia-chat-icon {
  font-size: 1.1rem;
  color: var(--primary-orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ciia-chat-window {
  position: absolute;
  right: 0;
  left: auto;
  bottom: 64px; /* sit just above the toggle */
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 480px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s;
  transform-origin: bottom right;
}

.ciia-chat.open .ciia-chat-window {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* When a quick action has been used, hide the quick buttons to reveal chat */
.ciia-chat.quick-used .ciia-quick-actions {
  display: none;
}

/* Shrink the floating toggle when the chat is open and show an X */
.ciia-chat.open .ciia-chat-toggle {
  width: 44px;
  height: 44px;
  border-width: 3px;
  background: var(--gradient-orange);
  color: white;
  transition:
    width 0.18s ease,
    height 0.18s ease,
    transform 0.18s ease;
}
.ciia-chat.open .ciia-chat-toggle .ciia-chat-icon {
  display: none;
}
.ciia-chat.open .ciia-chat-toggle::after {
  content: "\00d7"; /* multiplication sign as X */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.1rem;
  line-height: 1;
}

.ciia-chat-header {
  background: var(--gradient-pink);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ciia-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.ciia-chat-header .name {
  font-weight: 700;
  font-size: 0.9rem;
}
.ciia-chat-header .sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}
.ciia-chat-header .ciia-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 1.1rem;
}

.ciia-chat-messages {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #fafafa, #fff);
}

.ciia-msg {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.4;
}
.ciia-msg.bot {
  background: #f3f6f8;
  align-self: flex-start;
  color: #222;
  border-top-left-radius: 6px;
}
.ciia-msg.user {
  background: var(--primary-green);
  color: white;
  align-self: flex-end;
  border-top-right-radius: 6px;
}

.ciia-typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.ciia-typing .dot {
  width: 8px;
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  animation: blink 1s infinite;
}
.ciia-typing .dot:nth-child(2) {
  animation-delay: 0.12s;
}
.ciia-typing .dot:nth-child(3) {
  animation-delay: 0.24s;
}
@keyframes blink {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.ciia-quick-actions {
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff;
  border-top: 1px solid #f1f1f1;
}
.ciia-quick-actions button {
  flex: 1 1 45%;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--dark-text);
  font-size: 0.7rem;
}

.ciia-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eee;
  align-items: center;
}
.ciia-chat-input textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e6e6e6;
  font-size: 0.8rem;
}
.ciia-send {
  background: var(--primary-orange);
  color: white;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
}
.ciia-contact-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #f6f6f6;
}
.ciia-contact-row a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
}
.ciia-contact-wa {
  background: #25d366;
  color: white;
  border-color: #25d366;
}
.ciia-contact-mail {
  background: transparent;
  color: var(--accent-pink);
  border-color: rgba(217, 27, 92, 0.12);
}

@media (max-width: 700px) {
  .ciia-chat-window {
    left: auto;
    right: 0;
    bottom: 72px;
    width: min(400px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    min-width: 0;
    height: min(78vh, 560px);
    border-radius: 18px;
    z-index: 2300;
  }
  .ciia-chat {
    left: auto;
    right: 12px;
    bottom: 12px;
  }
  .ciia-chat-toggle {
    width: 52px;
    height: 52px;
  }
  .ciia-chat-toggle .ciia-chat-icon {
    font-size: 0.8rem;
  }
  .ciia-chat.open .ciia-chat-window {
    bottom: 92px;
  }
  .ciia-quick-actions {
    padding: 8px 10px;
  }
  .ciia-quick-actions button {
    font-size: 0.8rem;
    padding: 7px 8px;
  }
  .ciia-contact-row {
    flex-direction: column;
  }
  .ciia-contact-row a {
    font-size: 0.9rem;
    padding: 8px 10px;
  }
}
