/* Elastic Coach Widget Styles */
/* All classes prefixed with .ec- to avoid conflicts with Avada/other themes */

.ec-wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 0;
  font-family: 'Open Sans', sans-serif;
  color: var(--ec-text, #1a1a1a);
  box-sizing: border-box;
}

.ec-wrap *, .ec-wrap *::before, .ec-wrap *::after {
  box-sizing: border-box;
}

/* Header */
.ec-header {
  text-align: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ec-border, #e8e4de);
}
.ec-eyebrow {
  font-family: 'Raleway', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ec-primary, #b07d3e);
  margin-bottom: 6px;
}
.ec-title {
  font-family: 'Raleway', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ec-text, #1a1a1a);
  margin: 0 0 6px;
  line-height: 1.3;
}
.ec-subtitle {
  font-size: 13.5px;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* Disclaimer */
.ec-disclaimer {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-style: italic;
}

/* Chat window */
.ec-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1rem;
  min-height: 0;
}

.ec-bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.65;
}
.ec-bubble-user {
  align-self: flex-end;
  background: var(--ec-primary, #b07d3e);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.ec-bubble-assistant {
  align-self: flex-start;
  background: var(--ec-bg, #faf9f7);
  border: 1px solid var(--ec-border, #e8e4de);
  color: var(--ec-text, #1a1a1a);
  border-bottom-left-radius: 2px;
  white-space: pre-wrap;
}
.ec-bubble-error {
  align-self: flex-start;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
  border-radius: 6px;
  padding: 10px 14px;
}

/* Typing indicator */
.ec-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: var(--ec-bg, #faf9f7);
  border: 1px solid var(--ec-border, #e8e4de);
  border-radius: 8px;
  border-bottom-left-radius: 2px;
}
.ec-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ec-primary, #b07d3e);
  opacity: .4;
  animation: ec-bounce 1.2s infinite;
}
.ec-typing span:nth-child(2) { animation-delay: .2s; }
.ec-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes ec-bounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: .4; }
  40%            { transform: translateY(-5px); opacity: 1;  }
}

/* Round counter */
.ec-rounds {
  margin-bottom: .75rem;
}
.ec-rounds-text {
  font-size: 11.5px;
  color: #aaa;
  font-family: 'Raleway', sans-serif;
}
.ec-rounds-text strong {
  color: #888;
}

/* Input area */
.ec-input-area {
  background: var(--ec-bg, #faf9f7);
  border: 1px solid var(--ec-border, #e8e4de);
  border-radius: 8px;
  overflow: hidden;
}
.ec-textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 14px 16px;
  font-size: 14px;
  font-family: 'Open Sans', sans-serif;
  color: var(--ec-text, #1a1a1a);
  resize: none;
  outline: none;
  line-height: 1.6;
  display: block;
}
.ec-textarea::placeholder { color: #bbb; }
.ec-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--ec-border, #e8e4de);
  background: #fff;
}
.ec-char-count {
  font-size: 11px;
  color: #ccc;
  font-family: 'Raleway', sans-serif;
}
.ec-btn-send {
  background: var(--ec-primary, #b07d3e);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Raleway', sans-serif;
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .2s, opacity .2s;
}
.ec-btn-send:hover    { background: #9a6c2f; }
.ec-btn-send:disabled { opacity: .4; cursor: default; }

/* End state */
.ec-end {
  background: var(--ec-bg, #faf9f7);
  border: 1px solid var(--ec-border, #e8e4de);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}
.ec-end-message {
  font-size: 14px;
  color: #555;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.ec-btn-amazon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Raleway', sans-serif;
  text-decoration: none;
  transition: background .2s;
  margin-bottom: .75rem;
  width: 100%;
}
.ec-btn-amazon:hover { background: var(--ec-primary, #b07d3e); color: #fff; text-decoration: none; }
.ec-btn-restart {
  background: none;
  border: none;
  font-size: 12px;
  color: #aaa;
  cursor: pointer;
  text-decoration: underline;
  font-family: 'Open Sans', sans-serif;
  display: block;
  margin: .5rem auto 0;
}
.ec-btn-restart:hover { color: #777; }

@media (max-width: 520px) {
  .ec-bubble      { max-width: 96%; }
  .ec-input-footer { flex-direction: column; gap: 8px; align-items: stretch; }
  .ec-char-count  { text-align: right; }
}
