/* ============================================================
   EMU WIRE INDUSTRIES — Triage Chatbot Styles
   Theme: Heritage Ink Green (#1c2b22), Wire Green (#466C4B), Brass (#b8923f) & Cream (#fbf9f3)
   ============================================================ */

.emu-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1c2b22;
  -webkit-font-smoothing: antialiased;
}

/* Floating Launcher Button */
.emu-chat-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1c2b22;
  color: #fbf9f3;
  border: 2px solid #b8923f;
  border-radius: 32px;
  padding: 10px 18px 10px 12px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(28, 43, 34, 0.35);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.emu-chat-launcher:hover {
  background: #25382d;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(28, 43, 34, 0.45);
  border-color: #d8af54;
}

.emu-chat-launcher:active {
  transform: translateY(0);
}

.emu-launcher-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #466C4B;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbf9f3;
  flex-shrink: 0;
  position: relative;
  border: 1px solid rgba(184, 146, 63, 0.4);
}

.emu-launcher-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.emu-launcher-pulse {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #00E676;
  border: 2px solid #1c2b22;
  border-radius: 50%;
}

.emu-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.emu-launcher-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: #fbf9f3;
}

.emu-launcher-sub {
  font-size: 0.74rem;
  color: #d8af54;
  line-height: 1.2;
  margin-top: 2px;
}

/* Chat Window Box */
.emu-chat-box {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(28, 43, 34, 0.28), 0 0 0 1px rgba(28, 43, 34, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.emu-chat-box.emu-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.emu-chat-header {
  background: #1c2b22;
  color: #fbf9f3;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #b8923f;
  flex-shrink: 0;
}

.emu-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.emu-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #466C4B;
  color: #fbf9f3;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #b8923f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  font-family: 'Space Mono', monospace;
}

.emu-header-titles h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #ffffff;
  line-height: 1.2;
}

.emu-header-status {
  font-size: 0.72rem;
  color: #d8af54;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.emu-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00E676;
}

.emu-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.emu-btn-icon {
  background: transparent;
  border: none;
  color: #d7d2c2;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.emu-btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Chat Body / Scroll Area */
.emu-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fbf9f3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Messages */
.emu-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: emuFadeIn 0.22s ease forwards;
}

.emu-msg.emu-bot {
  align-self: flex-start;
}

.emu-msg.emu-user {
  align-self: flex-end;
}

.emu-msg-bubble {
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.emu-bot .emu-msg-bubble {
  background: #f4efe0;
  color: #1c2b22;
  border: 1px solid #e1d7ba;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.emu-bot .emu-msg-bubble strong {
  color: #1c2b22;
}

.emu-user .emu-msg-bubble {
  background: #1c2b22;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(28, 43, 34, 0.18);
}

/* Options / Choice Buttons */
.emu-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  animation: emuFadeIn 0.25s ease forwards;
}

.emu-option-btn {
  background: #ffffff;
  color: #1c2b22;
  border: 1.5px solid #d5cbaf;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  font-family: inherit;
}

.emu-option-btn span {
  color: #b8923f;
  font-weight: 700;
  transition: transform 0.15s ease;
}

.emu-option-btn:hover {
  background: #466C4B;
  color: #ffffff;
  border-color: #466C4B;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(70, 108, 75, 0.25);
}

.emu-option-btn:hover span {
  color: #d8af54;
  transform: translateX(3px);
}

/* Form Card */
.emu-form-card {
  background: #ffffff;
  border: 1px solid #e1d7ba;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(28, 43, 34, 0.06);
  animation: emuFadeIn 0.25s ease forwards;
  margin-top: 4px;
}

.emu-input-field {
  margin-bottom: 12px;
}

.emu-input-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1c2b22;
  margin-bottom: 4px;
}

.emu-input-field .emu-field-hint {
  display: block;
  font-size: 0.7rem;
  color: #59685f;
  margin-top: 2px;
}

.emu-input-field input,
.emu-input-field select,
.emu-input-field textarea {
  width: 100%;
  border: 1.5px solid #d5cbaf;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.86rem;
  color: #1c2b22;
  background: #faf8f3;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.emu-input-field input:focus,
.emu-input-field select:focus,
.emu-input-field textarea:focus {
  outline: none;
  border-color: #466C4B;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(70, 108, 75, 0.15);
}

.emu-submit-btn {
  width: 100%;
  background: #1c2b22;
  color: #fbf9f3;
  border: 1.5px solid #b8923f;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-top: 4px;
  font-family: inherit;
  box-shadow: 0 3px 8px rgba(28, 43, 34, 0.2);
}

.emu-submit-btn:hover {
  background: #466C4B;
  border-color: #d8af54;
  box-shadow: 0 6px 14px rgba(70, 108, 75, 0.3);
}

.emu-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Success Card */
.emu-success-card {
  background: #ffffff;
  border: 1px solid #466C4B;
  border-left: 4px solid #466C4B;
  border-radius: 8px;
  padding: 14px;
  margin: 6px 0;
}

.emu-success-card h5 {
  margin: 0 0 6px;
  color: #1c2b22;
  font-size: 0.95rem;
  font-weight: 700;
}

.emu-success-card p {
  margin: 0;
  font-size: 0.84rem;
  color: #334139;
  line-height: 1.4;
}

.emu-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #466C4B;
  color: #ffffff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  margin-right: 6px;
}

/* Call Direct Card (Fallback) */
.emu-call-card {
  background: #ffffff;
  border: 1px solid #e1d7ba;
  border-radius: 10px;
  padding: 14px;
  margin-top: 10px;
}

.emu-call-card h5 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: #1c2b22;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emu-call-btn {
  display: block;
  text-align: center;
  background: #1c2b22;
  color: #fbf9f3;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #b8923f;
  transition: all 0.15s ease;
}

.emu-call-btn:hover {
  background: #466C4B;
  border-color: #d8af54;
}

/* Footer note */
.emu-chat-footer {
  padding: 10px 16px;
  background: #f4efe0;
  border-top: 1px solid #e1d7ba;
  font-size: 0.74rem;
  color: #59685f;
  text-align: center;
  flex-shrink: 0;
}

.emu-chat-footer a {
  color: #1c2b22;
  font-weight: 700;
  text-decoration: underline;
}

/* Keyframes */
@keyframes emuFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Optimizations */
@media (max-width: 480px) {
  .emu-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .emu-chat-box {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
  }

  .emu-launcher-text {
    display: none;
  }

  .emu-chat-launcher {
    padding: 10px;
    border-radius: 50%;
  }
}
