/* ============================================================
   Filmit Chatbot widget — clean light layout (Intercom-style)
   ------------------------------------------------------------
   On-brand gold gradient header + airy light body. Self-contained,
   namespaced "fc-". Uses the site's --gold where present.
   ============================================================ */

.fc-root {
  --fc-gold: var(--gold, #f5a623);
  --fc-gold-soft: #ffc24d;
  --fc-gold-deep: #d9741a;
  --fc-link: #b5670a;
  --fc-ink: #1d1d22;
  --fc-ink2: #6a6a76;
  --fc-panel: #ffffff;
  --fc-body: #f5f5f8;
  --fc-line: #ececf1;
  --fc-radius: 18px;
  --fc-shadow: 0 16px 48px rgba(24, 24, 48, 0.22);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

/* Neutralize inherited box model so the site's global rules can't
   distort the widget's fixed sizes. */
.fc-root,
.fc-root *,
.fc-root *::before,
.fc-root *::after { box-sizing: border-box; }

/* ---------- Launcher (25% smaller: 45px) ---------- */
.fc-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 45px;
  height: 45px;
  padding: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--fc-gold);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  z-index: 2147483000;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.fc-launcher:hover { transform: translateY(-2px) scale(1.05); }
.fc-launcher:focus-visible { outline: 3px solid var(--fc-gold); outline-offset: 3px; }
.fc-launcher svg { width: 23px; height: 23px; display: block; }
.fc-launcher .fc-ico-close { display: none; }
.fc-root.fc-open .fc-launcher .fc-ico-open { display: none; }
.fc-root.fc-open .fc-launcher .fc-ico-close { display: block; }

.fc-launcher.fc-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.5);
  animation: fc-pulse 2.2s ease-out 3;
}
@keyframes fc-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(245, 166, 35, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0); }
}

.fc-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
  display: none;
}
.fc-root.fc-has-unread .fc-badge { display: block; }
.fc-root.fc-open .fc-badge { display: none; }

/* ---------- Panel ---------- */
.fc-panel {
  position: fixed;
  right: 20px;
  bottom: 78px;
  right: max(20px, env(safe-area-inset-right));
  width: 384px;
  max-width: calc(100vw - 32px);
  height: 638px;
  max-height: calc(100vh - 110px);
  background: var(--fc-body);
  color: var(--fc-ink);
  border-radius: var(--fc-radius);
  box-shadow: var(--fc-shadow);
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.fc-root.fc-open .fc-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---------- Header (gold gradient) ---------- */
.fc-header {
  position: relative;
  padding: 22px 22px 26px;
  background: linear-gradient(150deg, var(--fc-gold-soft) 0%, var(--fc-gold) 46%, var(--fc-gold-deep) 100%);
  color: #fff;
  flex-shrink: 0;
}
.fc-avatars { display: flex; margin-bottom: 18px; }
.fc-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.fc-av:last-child { margin-right: 0; }
.fc-av-f {
  background: #1d1d22;
  color: var(--fc-gold);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 19px;
  line-height: 1;
}
.fc-av-bot { background: #fff; color: var(--fc-gold-deep); }
.fc-av-bot svg { width: 21px; height: 21px; }

.fc-greet { line-height: 1.22; text-shadow: 0 1px 2px rgba(120, 60, 0, 0.22); }
.fc-greet-hi {
  font-family: 'Barlow Condensed', 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  color: rgba(255, 255, 255, 0.82);
}
.fc-greet-q {
  font-family: 'Barlow Condensed', 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 1.55rem;
  color: #fff;
}
.fc-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.fc-close:hover { background: rgba(255, 255, 255, 0.32); }
.fc-close svg { width: 17px; height: 17px; }

/* Back button — sits left of the close (X); only visible in a thread */
.fc-back {
  position: absolute;
  top: 16px;
  right: 54px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.fc-back:hover { background: rgba(255, 255, 255, 0.32); }
.fc-back svg { width: 18px; height: 18px; }
.fc-root.fc-thread .fc-back { display: flex; }

/* ---------- Body (light, scrollable) ---------- */
.fc-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
.fc-body::-webkit-scrollbar { width: 8px; }
.fc-body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.14); border-radius: 8px; }

/* Home / popular questions */
.fc-home-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fc-ink2);
  margin: 4px 2px 10px;
}
.fc-cards { display: flex; flex-direction: column; gap: 9px; }
.fc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--fc-panel);
  border: 1px solid var(--fc-line);
  border-radius: 13px;
  padding: 14px 16px;
  color: var(--fc-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.fc-card:hover {
  border-color: var(--fc-gold);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.fc-card svg { width: 18px; height: 18px; color: var(--fc-gold-deep); flex-shrink: 0; }

/* Messages */
.fc-log { display: flex; flex-direction: column; gap: 11px; }
.fc-log:not(:empty) { margin-top: 2px; }
.fc-msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.fc-msg a { color: var(--fc-link); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.fc-msg-bot {
  align-self: flex-start;
  background: var(--fc-panel);
  border: 1px solid var(--fc-line);
  color: var(--fc-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border-bottom-left-radius: 5px;
}
.fc-msg-user {
  align-self: flex-end;
  background: var(--fc-gold);
  color: #211a0c;
  font-weight: 500;
  border-bottom-right-radius: 5px;
}

.fc-typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 2px; }
.fc-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fc-ink2);
  animation: fc-bounce 1.2s infinite ease-in-out;
}
.fc-typing span:nth-child(2) { animation-delay: 0.15s; }
.fc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes fc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Composer ---------- */
.fc-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--fc-line);
  background: var(--fc-panel);
  flex-shrink: 0;
}
.fc-input {
  flex: 1;
  background: #fff;
  border: 1px solid var(--fc-line);
  border-radius: 11px;
  color: var(--fc-ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 11px 13px;
  resize: none;
  outline: none;
  max-height: 96px;
}
.fc-input:focus { border-color: var(--fc-gold); box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.16); }
.fc-input::placeholder { color: var(--fc-ink2); }
.fc-send {
  flex-shrink: 0;
  width: 44px;
  border: none;
  border-radius: 11px;
  background: var(--fc-gold);
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}
.fc-send:hover { opacity: 0.9; }
.fc-send:disabled { opacity: 0.4; cursor: default; }
.fc-send svg { width: 20px; height: 20px; }

.fc-foot {
  text-align: center;
  font-size: 0.66rem;
  color: var(--fc-ink2);
  padding: 0 12px 10px;
  background: var(--fc-panel);
}

/* ---------- Bottom nav ---------- */
.fc-nav {
  display: flex;
  border-top: 1px solid var(--fc-line);
  background: var(--fc-panel);
  flex-shrink: 0;
}
.fc-nav__item {
  flex: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 9px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--fc-ink2);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.fc-nav__item:hover { color: var(--fc-ink); }
.fc-nav__item.fc-active { color: var(--fc-gold-deep); }
.fc-nav__item svg { width: 21px; height: 21px; display: block; }
.fc-nav__item--discord:hover { color: #5865F2; }

/* ---------- Contact actions + inline form ---------- */
.fc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 92%; }
.fc-action-btn {
  background: #fff;
  border: 1px solid var(--fc-line);
  color: var(--fc-ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}
.fc-action-btn:hover { border-color: var(--fc-gold); }
.fc-action-btn--primary { background: var(--fc-gold); color: #211a0c; border-color: var(--fc-gold); }
.fc-action-btn--primary:hover { opacity: 0.92; }

.fc-cform {
  align-self: stretch;
  background: #fff;
  border: 1px solid var(--fc-line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fc-cform__title { font-family: 'Barlow Condensed', 'DM Sans', sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--fc-ink); }
.fc-cform__sub { font-size: 0.8rem; color: var(--fc-ink2); margin-top: -4px; }
.fc-cform__in {
  width: 100%;
  background: var(--fc-body);
  border: 1px solid var(--fc-line);
  border-radius: 9px;
  color: var(--fc-ink);
  font: inherit;
  font-size: 0.875rem;
  padding: 9px 11px;
  outline: none;
}
.fc-cform__in:focus { border-color: var(--fc-gold); box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15); }
.fc-cform__ta { resize: vertical; min-height: 64px; }
.fc-cform__send {
  background: var(--fc-gold);
  color: #211a0c;
  border: none;
  border-radius: 9px;
  font: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 10px;
  cursor: pointer;
  margin-top: 2px;
}
.fc-cform__send:hover { opacity: 0.92; }
.fc-cform__send:disabled { opacity: 0.5; cursor: default; }
.fc-cform__msg { font-size: 0.8rem; padding-top: 4px; }
.fc-cform__msg--err { color: #c0392b; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .fc-panel {
    right: 12px;
    left: 12px;
    bottom: 74px;
    width: auto;
    max-width: none;
    height: 72vh;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .fc-launcher, .fc-panel, .fc-card { transition: none; }
  .fc-launcher.fc-pulse::after { animation: none; }
  .fc-typing span { animation: none; }
}
