/* ─── 360 Growth Solutions Chatbot Widget (PPTX Theme) ─── */
:root {
  --g360-charcoal: #12243A;
  --g360-yellow: #E5D73D;
  --g360-yellow-dark: #C9BC2A;
  --g360-sage: #E3E3D2;
  --g360-pale: #F3F5DF;
  --g360-logo-blue: #4F81BD;
  --g360-logo-green: #9BBB59;
  --g360-white: #ffffff;
  --g360-gray: #6b6b6b;
  --g360-gray-light: #F3F5DF;
  --g360-panel-shadow: 0 8px 32px rgba(41,46,50,0.15);
  --g360-radius: 0px;
}

/* ─── Launcher Button ─── */
#g360-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: var(--g360-yellow);
  border: 2px solid var(--g360-charcoal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(41,46,50,0.2);
  transition: transform 0.25s ease;
  animation: g360-pulse 2s infinite;
}
#g360-chat-launcher:hover {
  transform: scale(1.06);
}
#g360-chat-launcher[aria-expanded="true"] {
  animation: none;
  background: var(--g360-charcoal);
  border-color: rgba(255,255,255,0.2);
}
#g360-chat-launcher svg {
  width: 24px;
  height: 24px;
  stroke: var(--g360-charcoal);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#g360-chat-launcher[aria-expanded="true"] svg {
  stroke: #fff;
}

@keyframes g360-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ─── Chat Panel ─── */
#g360-chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9998;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--g360-white);
  border: 1px solid var(--g360-sage);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#g360-chat-panel[data-open="true"] {
  display: flex;
}

/* ─── Header ─── */
#g360-chat-header {
  padding: 16px 20px;
  background: var(--g360-charcoal);
  display: flex;
  align-items: center;
  gap: 12px;
}
.g360-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.g360-header-avatar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.g360-header-info {
  flex: 1;
}
.g360-header-info h4 {
  font-family: 'Bricolage Grotesque', 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.g360-header-info p {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin: 2px 0 0;
}
.g360-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  transition: background 0.2s;
}
.g360-close-btn:hover {
  background: rgba(255,255,255,0.15);
}
.g360-close-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ─── Messages ─── */
#g360-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--g360-pale);
  scroll-behavior: smooth;
}
.g360-msg {
  max-width: 85%;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}
.g360-msg.user {
  background: var(--g360-charcoal);
  color: #fff;
  margin-left: auto;
}
.g360-msg.bot {
  background: #fff;
  color: var(--g360-charcoal);
  border: 1px solid var(--g360-sage);
}
.g360-msg.system {
  text-align: center;
  font-size: 12px;
  font-style: italic;
  color: var(--g360-gray);
  background: transparent;
  max-width: 100%;
  padding: 8px 0;
}
.g360-msg a {
  color: var(--g360-logo-blue);
  text-decoration: underline;
}
.g360-msg.user a {
  color: var(--g360-yellow);
}
.g360-msg strong {
  font-weight: 700;
}

/* ─── Typing Indicator ─── */
.g360-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.g360-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g360-charcoal);
  opacity: 0.3;
  animation: g360-bounce 1.4s infinite;
}
.g360-typing span:nth-child(2) { animation-delay: 0.2s; }
.g360-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes g360-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
  40% { transform: translateY(-8px); opacity: 0.8; }
}

/* ─── Input Area ─── */
#g360-chat-input {
  padding: 12px 16px;
  border-top: 1px solid var(--g360-sage);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: #fff;
}
#g360-chat-input textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--g360-sage);
  border-radius: 0;
  font-size: 14px;
  font-family: 'Open Sans', sans-serif;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 110px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
#g360-chat-input textarea:focus {
  border-color: var(--g360-charcoal);
}
.g360-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: var(--g360-yellow);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.g360-send-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.g360-send-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--g360-charcoal);
  fill: none;
  stroke-width: 2;
}

/* ─── Footer ─── */
#g360-chat-footer {
  padding: 8px 16px;
  background: var(--g360-sage);
  text-align: center;
  font-size: 11px;
  color: var(--g360-gray);
  border-top: 1px solid var(--g360-sage);
}
#g360-chat-footer a {
  color: var(--g360-logo-blue);
  text-decoration: none;
}

/* ─── Mobile ─── */
@media (max-width: 480px) {
  #g360-chat-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  #g360-chat-launcher {
    bottom: 16px;
    right: 16px;
  }
}
