/* =========================================================
   GAGAN GROWTH AI ASSISTANT – CLEAN PREMIUM UI
   Version: 0.1.0
   ========================================================= */

:root {
  --gg-cyan: #22cfee;
  --gg-blue: #2374ff;
  --gg-violet: #722df4;
  --gg-dark: #151515;
  --gg-panel: rgba(17, 18, 24, 0.96);
  --gg-panel-2: rgba(23, 25, 34, 0.96);
  --gg-white: #ffffff;
  --gg-muted: rgba(255, 255, 255, 0.64);
  --gg-soft: rgba(255, 255, 255, 0.08);
  --gg-border: rgba(255, 255, 255, 0.12);
  --gg-gradient: radial-gradient(circle at 18% 8%, rgba(34, 207, 238, 0.9) 0%, transparent 36%), linear-gradient(145deg, #22cfee 0%, #2374ff 48%, #722df4 100%);
}

.gg-assistant,
.gg-assistant *,
.gg-assistant-toggle,
.gg-assistant-toggle * {
  box-sizing: border-box;
}

/* =========================================================
   Backdrop
   ========================================================= */

.gg-assistant-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99996 !important;
  background-color: rgba(0, 0, 0, 0.35) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out !important;
}

.gg-assistant-backdrop.gg-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

body.gg-assistant-is-open .gg-assistant-toggle {
  opacity: 0.78;
}

/* =========================================================
   Floating toggle
   ========================================================= */

.gg-assistant-toggle {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 99998;
  min-width: 108px;
  height: 50px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  background: var(--gg-gradient) !important;
  color: var(--gg-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -0.02em;
  box-shadow: 0 14px 34px rgba(35, 116, 255, 0.26), 0 8px 18px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer;
  user-select: none;
  isolation: isolate;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.gg-assistant-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(35, 116, 255, 0.32), 0 10px 24px rgba(0, 0, 0, 0.24) !important;
}

.gg-assistant-toggle:focus-visible {
  outline: 3px solid rgba(34, 207, 238, 0.36);
  outline-offset: 4px;
}

.gg-assistant-toggle::before,
.gg-assistant-toggle::after,
.gg-assistant-toggle__glow {
  display: none !important;
  content: none !important;
}

.gg-assistant-toggle__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.gg-assistant-toggle__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gg-white);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.gg-assistant-toggle,
.gg-assistant-toggle * {
  text-shadow: none !important;
}

/* =========================================================
   Main window
   ========================================================= */

.gg-assistant {
  position: fixed;
  right: 24px;
  bottom: 82px;
  z-index: 99999;
  width: 410px;
  max-width: calc(100vw - 40px);
  height: 640px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  color: var(--gg-white);
  background: linear-gradient(180deg, var(--gg-panel), var(--gg-panel-2)), radial-gradient(circle at 14% 0%, rgba(34, 207, 238, 0.18), transparent 38%), radial-gradient(circle at 90% 10%, rgba(114, 45, 244, 0.22), transparent 40%);
  border: 1px solid var(--gg-border);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38), 0 12px 36px rgba(35, 116, 255, 0.16);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 220ms ease, visibility 220ms ease, transform 220ms ease;
  font-family: inherit;
}

.gg-assistant.gg-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.gg-assistant::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(34, 207, 238, 0.18) 0%, transparent 34%), radial-gradient(circle at 92% 12%, rgba(114, 45, 244, 0.2) 0%, transparent 34%);
  pointer-events: none;
}

/* =========================================================
   Header
   ========================================================= */

.gg-assistant__header {
  position: relative;
  z-index: 1;
  height: 74px;
  min-height: 74px;
  padding: 16px 58px 14px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gg-assistant-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0;
}

.gg-assistant-brand__mark {
  display: none !important;
}

.gg-assistant-brand__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.gg-assistant-brand__text strong {
  margin: 0;
  color: var(--gg-white);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.gg-assistant-brand__text span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.15;
}

.gg-assistant__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.gg-assistant__close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--gg-white);
}

.gg-assistant__close:focus-visible {
  outline: 3px solid rgba(34, 207, 238, 0.34);
  outline-offset: 3px;
}

/* =========================================================
   Steps
   ========================================================= */

.gg-assistant-steps {
  position: relative;
  z-index: 1;
  height: 30px;
  min-height: 30px;
  padding: 10px 18px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gg-step-bubble {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: width 160ms ease, background 160ms ease;
}

.gg-step-bubble.is-active {
  width: 18px;
  background: linear-gradient(90deg, var(--gg-cyan), var(--gg-blue), var(--gg-violet));
}

.gg-step-bubble.is-done {
  background: rgba(34, 207, 238, 0.6);
}

/* =========================================================
   Body / messages
   ========================================================= */

.gg-assistant__body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 18px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.gg-assistant__body::-webkit-scrollbar {
  width: 8px;
}

.gg-assistant__body::-webkit-scrollbar-track {
  background: transparent;
}

.gg-assistant__body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.gg-msg {
  display: flex;
  margin: 0 0 8px;
}

.gg-msg-bot { justify-content: flex-start; }
.gg-msg-user { justify-content: flex-end; }

.gg-bubble {
  max-width: 88%;
  padding: 9px 11px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 560;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.gg-bubble-bot {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-top-left-radius: 6px;
}

.gg-bubble-user {
  color: var(--gg-white);
  background: linear-gradient(145deg, rgba(34, 207, 238, 0.92), rgba(35, 116, 255, 0.96) 48%, rgba(114, 45, 244, 0.96));
  border-top-right-radius: 6px;
  box-shadow: 0 10px 22px rgba(35, 116, 255, 0.18);
}

.gg-typing-row .gg-bubble { padding: 10px 12px; }
.gg-typing { display: inline-flex; gap: 5px; align-items: center; }
.gg-typing span { width: 5px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.62); animation: ggTyping 1.15s infinite ease-in-out; }
.gg-typing span:nth-child(2) { animation-delay: 0.15s; }
.gg-typing span:nth-child(3) { animation-delay: 0.30s; }

@keyframes ggTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* =========================================================
   Start cards / hint / options
   ========================================================= */

.gg-start-shell {
  margin: 8px 0 6px;
  display: grid;
  gap: 7px;
}

.gg-start-head { margin-bottom: 1px; }

.gg-start-title {
  color: var(--gg-white);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.gg-start-subtitle {
  margin-top: 3px;
  color: var(--gg-muted);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.3;
}

.gg-action-card {
  width: 100%;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.045));
  color: var(--gg-white);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.gg-action-card:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 207, 238, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
}

.gg-action-card:disabled { opacity: 0.62; cursor: default; transform: none; }

.gg-action-card--featured {
  border-color: rgba(34, 207, 238, 0.34);
  background: radial-gradient(circle at 15% 0%, rgba(34, 207, 238, 0.18), transparent 35%), linear-gradient(145deg, rgba(35, 116, 255, 0.18), rgba(114, 45, 244, 0.2));
}

.gg-action-card__icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 800;
}

.gg-action-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gg-action-card__body strong {
  color: var(--gg-white);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
}

.gg-action-card__body small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10.5px;
  font-weight: 520;
  line-height: 1.25;
}

.gg-action-card__arrow {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.gg-natural-hint {
  margin: 7px 0 8px;
  padding: 10px;
  display: flex;
  gap: 8px;
  border-radius: 16px;
  background: radial-gradient(circle at 14% 0%, rgba(34, 207, 238, 0.16), transparent 38%), rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gg-natural-hint__badge {
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(34, 207, 238, 0.16);
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.gg-natural-hint__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gg-natural-hint__body strong { color: var(--gg-white); font-size: 13px; font-weight: 780; line-height: 1.2; }
.gg-natural-hint__body code { width: fit-content; max-width: 100%; padding: 6px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); color: rgba(255, 255, 255, 0.82); font-family: inherit; font-size: 12px; line-height: 1.28; white-space: normal; }
.gg-natural-hint__body small { color: rgba(255, 255, 255, 0.58); font-size: 11px; line-height: 1.3; }

.gg-options {
  margin: 10px 0 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.gg-option {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 12px;
  font-weight: 740;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.gg-option:hover { transform: translateY(-1px); border-color: rgba(34, 207, 238, 0.35); background: rgba(255, 255, 255, 0.12); }
.gg-option:disabled { opacity: 0.56; cursor: default; transform: none; }
.gg-option-full { grid-column: 1 / -1; }

/* =========================================================
   Summaries / recommendations
   ========================================================= */

.gg-diagnostic-summary,
.gg-intent-summary {
  margin: 10px 0;
  padding: 12px;
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.045));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gg-diagnostic-summary__title,
.gg-intent-summary__title {
  margin-bottom: 8px;
  color: var(--gg-white) !important;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.gg-diagnostic-summary__row,
.gg-intent-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  line-height: 1.3;
}

.gg-diagnostic-summary__row:first-of-type,
.gg-intent-summary__row:first-of-type { border-top: 0; }
.gg-diagnostic-summary__row span, .gg-intent-summary__row span { color: rgba(255, 255, 255, 0.55); }
.gg-diagnostic-summary__row strong, .gg-intent-summary__row strong { max-width: 58%; text-align: right; color: rgba(255, 255, 255, 0.9); }

.gg-recommendation-cards {
  margin: 12px 0 8px;
  display: grid;
  gap: 9px;
}

.gg-recommendation-card {
  position: relative;
  overflow: hidden;
  padding: 13px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: radial-gradient(circle at 15% 0%, rgba(34, 207, 238, 0.16), transparent 35%), linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.052));
  color: var(--gg-white);
}

.gg-recommendation-card * { color: inherit; }

.gg-recommendation-card__badge {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(34, 207, 238, 0.18) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 10px;
  font-weight: 850;
}

.gg-recommendation-card__title {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  color: var(--gg-white) !important;
  font-size: 14px;
  font-weight: 880;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-shadow: none !important;
}

.gg-recommendation-card__text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 12px;
  font-weight: 520;
  line-height: 1.36;
  text-shadow: none !important;
}

.gg-recommendation-card__actions {
  position: relative;
  z-index: 1;
  margin-top: 11px;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.gg-recommendation-card__button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0;
  border-radius: 999px !important;
  background: var(--gg-white) !important;
  color: var(--gg-dark) !important;
  font-family: inherit;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.gg-recommendation-card__button:hover { transform: translateY(-1px); opacity: 0.92; text-decoration: none !important; }

.gg-recommendation-card__button--ghost {
  color: var(--gg-white) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

/* =========================================================
   Footer
   ========================================================= */

.gg-assistant__footer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  height: 70px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.075));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gg-assistant__input {
  width: 100%;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  min-width: 0;
  padding: 0 15px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gg-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 560;
  line-height: 46px;
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.gg-assistant__input::placeholder { color: rgba(255, 255, 255, 0.44); }
.gg-assistant__input:focus { border-color: rgba(34, 207, 238, 0.42); background: rgba(255, 255, 255, 0.105); box-shadow: 0 0 0 4px rgba(34, 207, 238, 0.1); }
.gg-assistant__input:disabled { opacity: 0.55; cursor: not-allowed; }

.gg-assistant__send {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--gg-gradient);
  color: var(--gg-white);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(35, 116, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.gg-assistant__send:hover { transform: translateY(-1px); filter: saturate(1.08); }
.gg-assistant__send:disabled { opacity: 0.52; cursor: not-allowed; transform: none; }
.gg-hidden-assistant-form { display: block; }

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 640px) {
  .gg-assistant-backdrop { background-color: #0000007d !important; }

  .gg-assistant-toggle {
    right: 14px;
    bottom: 14px;
    min-width: 98px;
    height: 46px;
    padding: 0 14px;
    gap: 8px;
    font-size: 13px;
  }

  body.gg-assistant-is-open .gg-assistant-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .gg-assistant {
    top: 12px;
    right: 10px;
    bottom: 12px;
    left: 10px;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    border-radius: 24px;
    transform-origin: center center;
  }

  .gg-assistant__header {
    height: 68px;
    min-height: 68px;
    padding: 14px 56px 12px 16px;
  }

  .gg-assistant-brand__text strong { font-size: 16px; }
  .gg-assistant-brand__text span { font-size: 11.5px; }

  .gg-assistant__close {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 23px;
  }

  .gg-assistant-steps {
    height: 28px;
    min-height: 28px;
    padding: 9px 16px 5px;
  }

  .gg-assistant__body { padding: 12px 16px 14px; }
  .gg-bubble { max-width: 92%; font-size: 12.5px; }
  .gg-options { grid-template-columns: 1fr; }

  .gg-assistant__footer {
    height: 68px;
    padding: 11px 14px;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
  }

  .gg-assistant__input {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    font-size: 16px !important;
    line-height: 44px;
  }

  .gg-assistant__send {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .gg-recommendation-card__actions { gap: 8px !important; }
  .gg-recommendation-card__button { height: 40px !important; min-height: 40px !important; padding: 0 10px !important; font-size: 12px !important; letter-spacing: -0.02em !important; }
}

@media (max-width: 380px) {
  .gg-assistant {
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 8px;
    border-radius: 22px;
  }

  .gg-assistant__header { height: 64px; min-height: 64px; }
  .gg-assistant-brand__text strong { font-size: 15px; }
  .gg-assistant-brand__text span { font-size: 11px; }
  .gg-recommendation-card__actions { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  .gg-assistant,
  .gg-assistant-toggle,
  .gg-action-card,
  .gg-option,
  .gg-assistant__send,
  .gg-assistant__close,
  .gg-bubble-user,
  .gg-typing span {
    transition: none !important;
    animation: none !important;
  }
}
