/* SmAutomateAI AI sales chat widget — matches the site's navy/blue/orange HVAC brand theme. */

.smai-chat-root {
  --smai-navy: #07162e;
  --smai-navy-2: #0b2140;
  --smai-blue: #0062e2;
  --smai-blue-2: #004fc0;
  --smai-sky: #0a93f0;
  --smai-orange: #ea3f12;
  --smai-ink: #0a1b33;
  --smai-muted: #5a6b82;
  --smai-line: #d8e4f0;
  --smai-soft: #f4f8fc;
  --smai-white: #ffffff;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.smai-chat-root * {
  box-sizing: border-box;
}

.smai-chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 22px 0 18px;
  border: none;
  border-radius: 999px;
  background: var(--smai-blue);
  color: #fff;
  box-shadow:
    0 0 0 0 rgba(0, 98, 226, 0.4),
    0 18px 40px rgba(0, 98, 226, 0.42),
    0 4px 14px rgba(7, 20, 35, 0.22);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              opacity 0.2s ease,
              visibility 0.2s ease;
  animation: smai-float 6s ease-in-out infinite,
             smai-pulse 8s ease-in-out infinite,
             smai-glow-ring 12s ease-in-out infinite;
  opacity: 0;
  visibility: hidden;
}

.smai-chat-bubble-label {
  font-size: 14.5px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.smai-chat-bubble.smai-chat-bubble-entered {
  opacity: 1;
  visibility: visible;
  animation: smai-slide-up 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
             smai-float 6s ease-in-out 0.6s infinite,
             smai-pulse 8s ease-in-out 0.6s infinite,
             smai-glow-ring 12s ease-in-out 0.6s infinite;
}

.smai-chat-bubble:hover {
  transform: translateY(-8px) scale(1.08);
  background: var(--smai-blue-2);
  box-shadow:
    0 0 0 8px rgba(0, 98, 226, 0.15),
    0 28px 60px rgba(0, 98, 226, 0.48),
    0 8px 24px rgba(7, 20, 35, 0.28);
}

.smai-chat-bubble:active {
  transform: translateY(-6px) scale(1.06);
}

.smai-chat-bubble:focus-visible {
  outline: 3px solid rgba(10, 147, 240, 0.55);
  outline-offset: 3px;
}

.smai-chat-bubble.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.85);
}

.smai-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  width: min(392px, calc(100vw - 32px));
  height: min(660px, calc(100vh - 48px));
  border-radius: 20px;
  overflow: hidden;
  background: var(--smai-white);
  box-shadow: 0 30px 90px rgba(7, 20, 35, 0.32), 0 2px 10px rgba(7, 20, 35, 0.12);
  border: 1px solid rgba(216, 228, 240, 0.9);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.smai-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.smai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--smai-navy-2), var(--smai-navy));
  color: #fff;
  flex-shrink: 0;
}

.smai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.smai-chat-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--smai-sky), var(--smai-blue));
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-weight: 700;
  font-size: 16px;
}

.smai-chat-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
}

.smai-chat-subtitle {
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.smai-chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
  flex-shrink: 0;
}

.smai-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.smai-chat-icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.smai-chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.smai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--smai-soft);
  scroll-behavior: smooth;
}

.smai-chat-msg {
  display: flex;
  max-width: 88%;
}

.smai-chat-msg-user {
  align-self: flex-end;
  justify-content: flex-end;
}

.smai-chat-msg-assistant {
  align-self: flex-start;
}

.smai-chat-bubble-content {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
  word-wrap: break-word;
}

.smai-chat-msg-user .smai-chat-bubble-content {
  background: linear-gradient(135deg, var(--smai-blue), var(--smai-blue-2));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.smai-chat-msg-assistant .smai-chat-bubble-content {
  background: #fff;
  color: var(--smai-ink);
  border: 1px solid var(--smai-line);
  border-bottom-left-radius: 4px;
}

.smai-chat-bubble-content p {
  margin: 0 0 8px;
}

.smai-chat-bubble-content p:last-child {
  margin-bottom: 0;
}

.smai-chat-bubble-content ul {
  margin: 4px 0 8px;
  padding-left: 18px;
}

.smai-chat-bubble-content li {
  margin-bottom: 4px;
}

.smai-chat-bubble-content a {
  color: var(--smai-blue);
  font-weight: 700;
  text-decoration: underline;
}

.smai-chat-msg-user .smai-chat-bubble-content a {
  color: #fff;
}

.smai-chat-bubble-content code {
  background: rgba(0, 98, 226, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
}

.smai-chat-typing .smai-chat-bubble-content {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 13px 16px;
}

.smai-chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--smai-muted);
  opacity: 0.5;
  animation: smai-typing-bounce 1.1s ease-in-out infinite;
}

.smai-chat-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.smai-chat-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes smai-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.smai-chat-starters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 8px;
}

.smai-chat-starters.is-hidden {
  display: none;
}

.smai-chat-starters-label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--smai-muted);
}

.smai-chat-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.smai-chat-chip {
  border: 1px solid var(--smai-line);
  background: #fff;
  color: var(--smai-ink);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.smai-chat-chip:hover {
  border-color: rgba(0, 98, 226, 0.4);
  background: #eef4ff;
  transform: translateY(-1px);
}

.smai-chat-error {
  align-self: flex-start;
  max-width: 88%;
  border: 1px solid rgba(234, 63, 18, 0.3);
  background: #fdeee8;
  color: #7a2c12;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.smai-chat-error p {
  margin: 0 0 8px;
}

.smai-chat-retry {
  border: none;
  background: var(--smai-orange);
  color: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.smai-chat-cta {
  align-self: stretch;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--smai-navy-2), var(--smai-navy));
  color: #fff;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(7, 20, 35, 0.24);
}

.smai-chat-cta-heading {
  margin: 0 0 6px;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
}

.smai-chat-cta-body {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.smai-chat-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--smai-sky), var(--smai-blue));
  box-shadow: 0 14px 34px rgba(0, 98, 226, 0.4);
  transition: transform 0.15s ease;
}

.smai-chat-cta-button:hover {
  transform: translateY(-2px);
}

.smai-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--smai-line);
  background: #fff;
  flex-shrink: 0;
}

.smai-chat-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  min-height: 42px;
  border: 1px solid var(--smai-line);
  border-radius: 12px;
  background: var(--smai-soft);
  padding: 11px 13px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--smai-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.smai-chat-input:focus {
  border-color: var(--smai-blue);
  box-shadow: 0 0 0 4px rgba(0, 98, 226, 0.12);
}

.smai-chat-input:disabled {
  opacity: 0.6;
}

.smai-chat-send {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--smai-sky), var(--smai-blue));
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.smai-chat-send:hover {
  transform: translateY(-1px);
}

.smai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.smai-chat-disclaimer {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--smai-muted);
  text-align: center;
  flex-shrink: 0;
}

/* Keyframe animations for the launcher bubble */

@keyframes smai-slide-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes smai-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes smai-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.92;
  }
}

@keyframes smai-glow-ring {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(0, 98, 226, 0.4),
      0 18px 40px rgba(0, 98, 226, 0.38),
      0 4px 14px rgba(7, 20, 35, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 12px rgba(0, 98, 226, 0),
      0 18px 40px rgba(0, 98, 226, 0.38),
      0 4px 14px rgba(7, 20, 35, 0.2);
  }
}

.smai-chat-bubble-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: smai-icon-rotate 4s ease-in-out infinite;
}

@keyframes smai-icon-rotate {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

/* Attention bubble styles */

.smai-attention-bubble {
  position: fixed;
  bottom: 104px;
  right: 24px;
  z-index: 2147482999;
  background: #fff;
  border: 1px solid var(--smai-line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--smai-ink);
  box-shadow: 0 12px 32px rgba(7, 20, 35, 0.16);
  max-width: 200px;
  word-wrap: break-word;
  animation: smai-bubble-appear 0.4s ease-out, smai-bubble-disappear 0.3s ease-in 5.7s forwards;
  white-space: normal;
}

@keyframes smai-bubble-appear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes smai-bubble-disappear {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(12px);
  }
}

.smai-attention-bubble-hidden {
  animation: smai-bubble-disappear 0.3s ease-in forwards !important;
}

/* Expansion card styles */

.smai-expansion-card {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 2147482998;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(7, 20, 35, 0.2);
  border: 1px solid var(--smai-line);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 280px;
  animation: smai-card-expand 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes smai-card-expand {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.smai-expansion-card-collapsed {
  animation: smai-card-collapse 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes smai-card-collapse {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(16px) scale(0.92);
  }
}

.smai-expansion-card-icon {
  font-size: 32px;
  line-height: 1;
}

.smai-expansion-card-content {
  width: 100%;
}

.smai-expansion-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--smai-ink);
  font-family: "Space Grotesk", "Manrope", sans-serif;
}

.smai-expansion-card-text {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--smai-muted);
  line-height: 1.4;
}

.smai-expansion-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--smai-sky), var(--smai-blue));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 20px rgba(0, 98, 226, 0.32);
}

.smai-expansion-card-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 98, 226, 0.4);
}

.smai-expansion-card-button:active {
  transform: translateY(0);
}

/* Mobile styles */

@media (max-width: 640px) {
  .smai-chat-bubble {
    right: 16px;
    bottom: 88px;
    height: 58px;
    padding: 0 16px 0 14px;
  }

  .smai-chat-bubble-label {
    font-size: 13px;
  }

  .smai-attention-bubble {
    right: 16px;
    bottom: 104px;
    max-width: 160px;
    font-size: 12px;
    padding: 10px 12px;
  }

  .smai-expansion-card {
    right: 16px;
    bottom: 96px;
    width: 240px;
    padding: 14px;
    gap: 10px;
  }

  .smai-expansion-card-icon {
    font-size: 28px;
  }

  .smai-expansion-card-title {
    font-size: 14px;
  }

  .smai-expansion-card-text {
    font-size: 12px;
  }

  .smai-expansion-card-button {
    font-size: 11px;
    padding: 9px 10px;
  }

  .smai-chat-panel {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .smai-chat-bubble,
  .smai-chat-panel,
  .smai-chat-chip,
  .smai-chat-cta-button,
  .smai-chat-send,
  .smai-attention-bubble,
  .smai-expansion-card,
  .smai-expansion-card-button {
    transition: none;
    animation: none !important;
  }

  .smai-chat-typing-dot {
    animation: none;
  }

  .smai-chat-bubble {
    opacity: 1;
    visibility: visible;
  }
}
