/* ZacBot Chat Styles - matches FEC site dark theme */

.zacbot-chat-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 70vh;
  min-height: 400px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.zacbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.zacbot-messages::-webkit-scrollbar {
  width: 6px;
}

.zacbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.zacbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.zacbot-message {
  display: flex;
  gap: 0.75rem;
  max-width: 85%;
  animation: zacbot-fadeIn 0.2s ease-in;
}

.zacbot-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.zacbot-message--assistant {
  align-self: flex-start;
}

.zacbot-message__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.zacbot-message--user .zacbot-message__avatar {
  background: var(--royal-blue, #455afb);
  color: white;
}

.zacbot-message--assistant .zacbot-message__avatar {
  background: rgba(111, 128, 255, 0.15);
  color: var(--cornflower-blue, #6f80ff);
}

.zacbot-message__content {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.zacbot-message--user .zacbot-message__content {
  background: var(--royal-blue, #455afb);
  color: white;
  border-bottom-right-radius: 4px;
}

.zacbot-message--assistant .zacbot-message__content {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  border-bottom-left-radius: 4px;
}

.zacbot-message__content p {
  margin: 0 0 0.5em 0;
}

.zacbot-message__content p:last-child {
  margin-bottom: 0;
}

.zacbot-message__content strong {
  color: white;
  font-weight: 600;
}

.zacbot-message__content ul,
.zacbot-message__content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.zacbot-message__content li {
  margin-bottom: 0.3em;
}

/* Input area */
.zacbot-input-area {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.zacbot-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.zacbot-counter {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  padding-top: 0.5rem;
}

.zacbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: white;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.95rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s;
}

.zacbot-input:focus {
  border-color: var(--cornflower-blue, #6f80ff);
}

.zacbot-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.zacbot-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zacbot-send-btn {
  background: var(--royal-blue, #455afb);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.zacbot-send-btn:hover {
  background: var(--dark-slate-blue, #3141bc);
}

.zacbot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Typing indicator */
.zacbot-typing {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
  align-items: center;
}

.zacbot-typing__dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: zacbot-bounce 1.4s ease-in-out infinite;
}

.zacbot-typing__dot:nth-child(2) {
  animation-delay: 0.2s;
}

.zacbot-typing__dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Trial gate */
.zacbot-trial-gate {
  padding: 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.zacbot-trial-gate h3 {
  color: white;
  font-size: 1.2rem;
  margin: 0 0 0.75rem 0;
}

.zacbot-trial-gate p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 1.25rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.zacbot-trial-gate__cta {
  display: inline-block;
  background: var(--royal-blue, #455afb);
  color: white;
  text-decoration: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}

.zacbot-trial-gate__cta:hover {
  background: var(--dark-slate-blue, #3141bc);
  color: white;
  text-decoration: none;
}

/* Email capture form */
.zacbot-email-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.zacbot-skip-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: 'Instrument Sans', sans-serif;
  padding: 0;
  margin-top: 0.5rem;
}

.zacbot-skip-link:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* Feedback buttons */
.zacbot-feedback {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
  margin-left: 2.75rem;
}

.zacbot-feedback__btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.15rem 0.35rem;
  opacity: 0.3;
  transition: opacity 0.2s, border-color 0.2s;
}

.zacbot-feedback__btn:hover {
  opacity: 0.7;
}

.zacbot-feedback__btn.is-active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Header bar */
.zacbot-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.zacbot-header__title {
  font-weight: 600;
  font-size: 1rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.zacbot-header__status {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
}

.zacbot-header__actions {
  display: flex;
  gap: 0.5rem;
}

.zacbot-header__btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-family: 'Instrument Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.zacbot-header__btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Welcome message */
.zacbot-welcome {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.6);
}

.zacbot-welcome h3 {
  color: white;
  font-size: 1.3rem;
  margin: 0 0 0.5rem 0;
}

.zacbot-welcome p {
  margin: 0 0 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.zacbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.zacbot-suggestion {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Instrument Sans', sans-serif;
}

.zacbot-suggestion:hover {
  background: rgba(111, 128, 255, 0.15);
  border-color: var(--cornflower-blue, #6f80ff);
  color: white;
}

/* Floating bubble widget */
.zacbot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--royal-blue, #455afb);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(69, 90, 251, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 9999;
  border: none;
}

.zacbot-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(69, 90, 251, 0.5);
}

.zacbot-bubble svg {
  width: 28px;
  height: 28px;
  fill: white;
}

.zacbot-bubble--close svg {
  width: 20px;
  height: 20px;
}

/* Bubble panel */
.zacbot-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.zacbot-panel.is-open {
  display: flex;
}

.zacbot-panel .zacbot-chat-container {
  height: 100%;
  border: none;
  border-radius: 0;
}

/* Animations */
@keyframes zacbot-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes zacbot-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .zacbot-chat-container {
    height: 60vh;
    border-radius: 8px;
  }

  .zacbot-messages {
    padding: 1rem;
  }

  .zacbot-message {
    max-width: 92%;
  }

  .zacbot-input-area {
    padding: 0.75rem 1rem;
  }

  .zacbot-suggestions {
    flex-direction: column;
    align-items: center;
  }

  .zacbot-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    border-radius: 12px 12px 0 0;
  }

  .zacbot-bubble {
    bottom: 16px;
    right: 16px;
  }
}
