/* ═══════════════════════════════════════════════════════════════════
   gambol-ai.css — Gambol_AI UI styling (v2)
   Forum integration + Tools-page chat
   ═══════════════════════════════════════════════════════════════════ */

/* ─── ASK BUTTON (next to Like button in action row) ───────────── */
.gambol-ai-ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #2e7d32 0%, #1a2e1a 100%);
  color: #faedcd;
  border: 1px solid rgba(240, 201, 106, 0.4);
  padding: 7px 14px;
  border-radius: 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.gambol-ai-ask-btn:hover {
  background: linear-gradient(135deg, #43a047 0%, #2a4a2a 100%);
  border-color: #f0c96a;
  transform: translateY(-1px);
}

/* ─── AI REPLY DECORATION (the gold border + badge) ────────────── */
.fb-reply.gambol-ai-reply {
  background: linear-gradient(180deg, rgba(67, 160, 71, 0.06) 0%, rgba(240, 201, 106, 0.03) 100%) !important;
  border: 1px solid rgba(240, 201, 106, 0.4) !important;
  border-left: 3px solid #f0c96a !important;
  position: relative;
}
.fb-reply.gambol-ai-reply .fb-reply-username {
  color: #f0c96a !important;
  font-weight: 700;
}
.fb-reply.gambol-ai-reply .fb-reply-content strong { color: #f0c96a; }
.fb-reply.gambol-ai-reply .fb-reply-content em { color: #c5e3c5; }
.fb-reply.gambol-ai-reply .fb-reply-content code {
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  color: #f0c96a;
}

.gambol-ai-reply-disclaimer {
  font-size: 10px;
  color: #9acc9a;
  font-style: italic;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(240, 201, 106, 0.2);
}

/* ─── REPLY TO GAMBOL_AI BUTTON ────────────────────────────────── */
.gambol-ai-followup-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(240, 201, 106, 0.15);
  color: #f0c96a;
  border: 1px solid rgba(240, 201, 106, 0.4);
  padding: 5px 12px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s;
}
.gambol-ai-followup-btn:hover {
  background: rgba(240, 201, 106, 0.25);
  border-color: #f0c96a;
}

/* ─── INLINE FOLLOWUP COMPOSER ─────────────────────────────────── */
.gambol-followup-composer {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(240, 201, 106, 0.3);
  border-radius: 10px;
  padding: 12px;
}
.gambol-followup-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(67, 160, 71, 0.3);
  color: #faedcd;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
  line-height: 1.5;
}
.gambol-followup-input:focus { outline: none; border-color: #f0c96a; }
.gambol-followup-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.gambol-followup-cancel,
.gambol-followup-submit {
  background: transparent;
  border: 1px solid rgba(67, 160, 71, 0.4);
  color: #9acc9a;
  padding: 5px 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.gambol-followup-submit {
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
  color: #fff;
  border-color: rgba(240, 201, 106, 0.4);
  font-weight: 600;
}
.gambol-followup-submit:hover { background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%); }

/* ─── INITIAL SUMMON DIALOG ────────────────────────────────────── */
.gambol-summon-dialog {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gambol-summon-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.gambol-summon-box {
  position: relative;
  width: 92vw;
  max-width: 540px;
  background: linear-gradient(180deg, #1a2e1a 0%, #0f1a0f 100%);
  border: 1px solid rgba(240, 201, 106, 0.4);
  border-radius: 14px;
  padding: 22px 24px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: gambolSlideUp 0.2s ease-out;
}
@keyframes gambolSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.gambol-summon-close {
  position: absolute;
  top: 10px; right: 14px;
  background: transparent;
  border: none;
  color: #9acc9a;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.gambol-summon-close:hover { color: #faedcd; }
.gambol-summon-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  color: #faedcd;
  margin-bottom: 6px;
}
.gambol-summon-sub {
  font-size: 13px;
  color: #c5e3c5;
  margin-bottom: 14px;
  line-height: 1.5;
}
.gambol-summon-sub strong { color: #f0c96a; }
.gambol-summon-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(67, 160, 71, 0.3);
  color: #faedcd;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 90px;
  box-sizing: border-box;
  line-height: 1.5;
  transition: border-color 0.15s;
}
.gambol-summon-input:focus { outline: none; border-color: #f0c96a; }
.gambol-summon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.gambol-summon-note {
  font-size: 11px;
  color: #9acc9a;
  font-style: italic;
}
.gambol-summon-submit {
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.gambol-summon-submit:hover { background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%); }
.gambol-summon-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── UPSELL MODAL ─────────────────────────────────────────────── */
.gambol-upsell-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gambol-upsell-box {
  position: relative;
  width: 92vw;
  max-width: 460px;
  background: linear-gradient(180deg, #1a2e1a 0%, #0f1a0f 100%);
  border: 1px solid rgba(240, 201, 106, 0.5);
  border-radius: 14px;
  padding: 28px 24px 20px;
  text-align: center;
}
.gambol-upsell-close {
  position: absolute;
  top: 10px; right: 14px;
  background: transparent;
  border: none;
  color: #9acc9a;
  font-size: 24px;
  cursor: pointer;
}
.gambol-upsell-icon { font-size: 48px; margin-bottom: 8px; }
.gambol-upsell-box h2 {
  font-family: 'Playfair Display', Georgia, serif;
  color: #faedcd;
  margin: 0 0 12px;
  font-size: 22px;
}
.gambol-upsell-box p {
  color: #c5e3c5;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 14px;
}
.gambol-upsell-tier {
  background: rgba(240, 201, 106, 0.1);
  border: 1px solid rgba(240, 201, 106, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0;
  color: #faedcd;
  font-size: 13px;
}
.gambol-upsell-tier strong { color: #f0c96a; }

/* ═══════════════════════════════════════════════════════════════════
   TOOLS-PAGE CHAT
   ═══════════════════════════════════════════════════════════════════ */
.gambol-tools-card {
  background: linear-gradient(180deg, rgba(67, 160, 71, 0.06) 0%, rgba(0, 0, 0, 0.25) 100%);
  border: 1px solid rgba(240, 201, 106, 0.35);
  border-radius: 16px;
  overflow: hidden;
  margin: 24px 0;
  position: relative;
}
.gambol-tools-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f0c96a, #d4a849, #f0c96a);
}

.gambol-tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(67, 160, 71, 0.2);
  gap: 12px;
  flex-wrap: wrap;
}
.gambol-tools-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.gambol-tools-icon { font-size: 32px; }
.gambol-tools-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  color: #faedcd;
  font-weight: 600;
  line-height: 1.2;
}
.gambol-tools-sub {
  font-size: 12px;
  color: #9acc9a;
  margin-top: 2px;
}
.gambol-tools-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gambol-tools-usage {
  background: rgba(240, 201, 106, 0.15);
  color: #f0c96a;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.gambol-tools-usage-empty {
  background: rgba(229, 57, 53, 0.15);
  color: #fad9d9;
}

.gambol-tools-chat {
  max-height: 500px;
  overflow-y: auto;
  padding: 16px 22px;
  background: rgba(0, 0, 0, 0.15);
  min-height: 240px;
}

.gambol-tools-empty {
  padding: 40px 20px;
  text-align: center;
}
.gambol-tools-empty-icon {
  font-size: 48px;
  margin-bottom: 14px;
  opacity: 0.7;
}
.gambol-tools-empty-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  color: #faedcd;
  margin-bottom: 8px;
}
.gambol-tools-empty-sub {
  font-size: 13px;
  color: #c5e3c5;
  line-height: 1.6;
}

.gambol-tools-msg {
  display: flex;
  margin-bottom: 14px;
}
.gambol-tools-msg-user { justify-content: flex-end; }
.gambol-tools-msg-ai   { justify-content: flex-start; align-items: flex-start; gap: 10px; }
.gambol-tools-msg-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #f0c96a 0%, #d4a849 100%);
  color: #1a2e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  flex-shrink: 0;
}
.gambol-tools-msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.gambol-tools-msg-user .gambol-tools-msg-bubble {
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.gambol-tools-msg-ai .gambol-tools-msg-bubble {
  background: rgba(0, 0, 0, 0.35);
  color: #faedcd;
  border: 1px solid rgba(67, 160, 71, 0.15);
  border-bottom-left-radius: 5px;
}
.gambol-tools-msg-ai .gambol-tools-msg-bubble p { margin: 0 0 10px 0; }
.gambol-tools-msg-ai .gambol-tools-msg-bubble p:last-child { margin-bottom: 0; }
.gambol-tools-msg-ai .gambol-tools-msg-bubble strong { color: #f0c96a; }
.gambol-tools-msg-ai .gambol-tools-msg-bubble em { color: #c5e3c5; }
.gambol-tools-msg-ai .gambol-tools-msg-bubble code {
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  color: #f0c96a;
}
.gambol-tools-msg-ai .gambol-tools-msg-bubble ul,
.gambol-tools-msg-ai .gambol-tools-msg-bubble ol {
  margin: 0 0 10px 0;
  padding-left: 22px;
}
.gambol-tools-msg-ai .gambol-tools-msg-bubble li { margin-bottom: 5px; }

/* Loading spinner */
.gambol-tools-spinner {
  display: flex;
  gap: 5px;
  padding: 4px 0;
}
.gambol-tools-spinner span {
  width: 7px;
  height: 7px;
  background: #43a047;
  border-radius: 50%;
  animation: gambolToolsPulse 1.2s infinite;
}
.gambol-tools-spinner span:nth-child(2) { animation-delay: 0.2s; }
.gambol-tools-spinner span:nth-child(3) { animation-delay: 0.4s; }
@keyframes gambolToolsPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.15); }
}

.gambol-tools-composer {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid rgba(67, 160, 71, 0.2);
  background: rgba(0, 0, 0, 0.25);
}
#gambolToolsInput {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(67, 160, 71, 0.3);
  color: #faedcd;
  padding: 10px 14px;
  border-radius: 18px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  line-height: 1.45;
  max-height: 120px;
  transition: border-color 0.15s;
}
#gambolToolsInput:focus { outline: none; border-color: #f0c96a; }
.gambol-tools-send {
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
  color: #fff;
  border: none;
  padding: 0 22px;
  border-radius: 22px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.gambol-tools-send:hover { background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%); }
.gambol-tools-send:disabled { opacity: 0.5; cursor: not-allowed; }

.gambol-tools-foot {
  padding: 10px 22px;
  font-size: 11px;
  color: #9acc9a;
  font-style: italic;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}

.gambol-tools-signin-btn {
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.gambol-tools-signin-btn:hover { background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%); }

@media (max-width: 600px) {
  .gambol-tools-head { padding: 14px 16px; }
  .gambol-tools-chat { padding: 12px 14px; }
  .gambol-tools-composer { padding: 12px 14px; }
  .gambol-tools-msg-bubble { max-width: 85%; }
}

/* ─── CLARIFICATION NOTE (in summon dialog) ───────────────────── */
.gambol-clarify-note {
  background: linear-gradient(180deg, rgba(240, 201, 106, 0.12) 0%, rgba(240, 201, 106, 0.05) 100%);
  border: 1px solid rgba(240, 201, 106, 0.45);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
  animation: gambolSlideUp 0.2s ease-out;
}
.gambol-clarify-title {
  font-weight: 600;
  color: #f0c96a;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.4;
}
.gambol-clarify-body {
  color: #faedcd;
  font-size: 13px;
  line-height: 1.5;
}
.gambol-clarify-body p { margin: 0 0 6px 0; }
.gambol-clarify-body ul {
  margin: 4px 0 8px 0;
  padding-left: 22px;
}
.gambol-clarify-body li { margin-bottom: 4px; }
.gambol-clarify-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.gambol-clarify-anyway {
  background: rgba(0, 0, 0, 0.3);
  color: #faedcd;
  border: 1px solid rgba(240, 201, 106, 0.45);
  padding: 6px 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.gambol-clarify-anyway:hover {
  background: rgba(240, 201, 106, 0.2);
  border-color: #f0c96a;
}
.gambol-clarify-hint {
  font-size: 11px;
  color: #9acc9a;
  font-style: italic;
}
.gambol-clarify-foot {
  font-size: 11px;
  color: #9acc9a;
  font-style: italic;
  margin-top: 8px;
  text-align: right;
}

/* ─── POSTED CONFIRMATION FLASH ────────────────────────────────── */
.gambol-posted-flash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  animation: gambolFlashIn 0.3s ease-out;
}
.gambol-posted-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
  color: #faedcd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(67, 160, 71, 0.4);
  animation: gambolCheckPop 0.4s ease-out;
}
.gambol-posted-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  color: #f0c96a;
  font-weight: 600;
}
@keyframes gambolFlashIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes gambolCheckPop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ─── CONCEPT GUIDE BADGE (on AI replies) ──────────────────────── */
.gambol-ai-concept-badge {
  display: inline-block;
  background: rgba(240, 201, 106, 0.15);
  color: #f0c96a;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 10px;
  margin: 0 0 10px 0;
  border: 1px solid rgba(240, 201, 106, 0.3);
  text-transform: uppercase;
}
