/* Sun Global AI Chat Assistant */
.sg-ai-root {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  font-family: "Nunito Sans", system-ui, sans-serif;
}

.sg-ai-toggle {
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff6600 0%, #cc3300 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(255, 102, 0, 0.35);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sg-ai-toggle:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 32px rgba(204, 51, 0, 0.4);
}

.sg-ai-toggle[aria-expanded="true"] {
  background: #1a1a2e;
  box-shadow: 0 12px 28px rgba(26, 26, 46, 0.35);
}

.sg-ai-panel {
  position: absolute;
  right: 0;
  bottom: 4.5rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 7rem));
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(26, 26, 46, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.sg-ai-panel.is-open {
  display: flex;
  animation: sg-ai-rise 0.25s ease;
}

.sg-ai-header {
  padding: 0.9rem 1rem;
  background: linear-gradient(120deg, #003399 0%, #0047ab 55%, #ff6600 140%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sg-ai-header strong {
  font-family: "Poppins", system-ui, sans-serif;
  display: block;
  font-size: 0.95rem;
}

.sg-ai-header small {
  opacity: 0.9;
  font-size: 0.75rem;
}

.sg-ai-close {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.sg-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f5f7fb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sg-ai-bubble {
  max-width: 88%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.sg-ai-bubble.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1a1a2e;
}

.sg-ai-bubble.user {
  align-self: flex-end;
  background: #003399;
  color: #fff;
}

.sg-ai-bubble a {
  color: #ff6600;
  font-weight: 600;
}

.sg-ai-bubble.user a {
  color: #ffcc00;
}

.sg-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
  background: #f5f7fb;
}

.sg-ai-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #1a1a2e;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.sg-ai-chip:hover {
  border-color: rgba(255, 102, 0, 0.45);
  color: #cc3300;
}

.sg-ai-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.sg-ai-input-row input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
}

.sg-ai-input-row input:focus {
  outline: none;
  border-color: #003399;
  box-shadow: 0 0 0 0.15rem rgba(0, 51, 153, 0.15);
}

.sg-ai-input-row button {
  border: none;
  border-radius: 0.5rem;
  background: linear-gradient(180deg, #ff6600, #cc3300);
  color: #fff;
  font-weight: 600;
  padding: 0 0.9rem;
  cursor: pointer;
}

@keyframes sg-ai-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 575.98px) {
  .sg-ai-root {
    right: 0.85rem;
    bottom: 0.85rem;
  }

  .sg-ai-panel {
    bottom: 4.25rem;
  }
}
