/* ============================================
   Fun on Farm - Live Chat Widget
   Brand: #7e1a1e (maroon), minimal, responsive
   ============================================ */

:root {
  --fof-chat-maroon: #7e1a1e;
  --fof-chat-maroon-dark: #651418;
  --fof-chat-maroon-glow: rgba(126, 26, 30, 0.5);
  --fof-chat-white: #fff;
  --fof-chat-bg: #fff;
  --fof-chat-border: rgba(126, 26, 30, 0.12);
  --fof-chat-text: #1D231F;
  --fof-chat-text-muted: #5c6369;
}

/* Wrapper - fixed bottom right, above back-to-top (z-index 337) */
.fof-livechat-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: "Prompt", sans-serif;
}

/* Floating button - white border & ring so visible on maroon (#7e1a1e) sections */
.fof-livechat-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--fof-chat-maroon);
  color: var(--fof-chat-white);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--fof-chat-maroon-glow), 0 0 0 1px rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: fof-chat-bounce 2.5s ease-in-out infinite, fof-chat-glow 2s ease-in-out infinite;
}

.fof-livechat-btn:hover {
  color: var(--fof-chat-white);
  transform: scale(1.04) translateY(-2px);
  box-shadow: 0 8px 28px rgba(126, 26, 30, 0.55);
}

.fof-livechat-btn:focus {
  outline: none;
  color: var(--fof-chat-white);
}

.fof-livechat-btn i {
  font-size: 20px;
  flex-shrink: 0;
}

/* Glow animation - keep white ring visible on maroon */
@keyframes fof-chat-glow {
  0%, 100% { box-shadow: 0 4px 20px var(--fof-chat-maroon-glow), 0 0 0 1px rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 4px 28px rgba(126, 26, 30, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.4); }
}

/* Bounce animation */
@keyframes fof-chat-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}


/* Panel - chat card */
.fof-livechat-panel {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: 75vh;
  background: var(--fof-chat-bg);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--fof-chat-border);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  overflow: hidden;
}

.fof-livechat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Panel header */
.fof-livechat-panel-header {
  padding: 16px 18px;
  background: var(--fof-chat-maroon);
  color: var(--fof-chat-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.fof-livechat-panel-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.fof-livechat-panel-subtitle {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 400;
  margin: 2px 0 0 0;
}

.fof-livechat-panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--fof-chat-white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
}

.fof-livechat-panel-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Panel body - scrollable FAQ */
.fof-livechat-panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.fof-livechat-intro {
  font-size: 13px;
  color: var(--fof-chat-text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* FAQ items */
.fof-livechat-faq {
  border: 1px solid var(--fof-chat-border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.fof-livechat-faq-q {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: var(--fof-chat-bg);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--fof-chat-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.2s;
}

.fof-livechat-faq-q:hover {
  background: rgba(126, 26, 30, 0.06);
}

.fof-livechat-faq-q i {
  color: var(--fof-chat-maroon);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.fof-livechat-faq.is-open .fof-livechat-faq-q i {
  transform: rotate(180deg);
}

.fof-livechat-faq-a {
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.fof-livechat-faq-a-inner {
  padding: 0 0 14px 0;
  font-size: 13px;
  color: var(--fof-chat-text-muted);
  line-height: 1.55;
}

/* Panel footer - WhatsApp CTA */
.fof-livechat-panel-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--fof-chat-border);
  flex-shrink: 0;
  background: #fafafa;
}

.fof-livechat-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #25D366;
  color: var(--fof-chat-white);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.fof-livechat-wa-btn:hover {
  background: #20bd5a;
  color: var(--fof-chat-white);
  transform: translateY(-1px);
}

.fof-livechat-wa-btn i {
  font-size: 22px;
}

/* Mobile: back-to-top is on the left, so live chat sits lower on the right */
@media (max-width: 767px) {
  .fof-livechat-wrap {
    bottom: 24px;
    right: 16px;
    z-index: 9999;
  }
}

@media (max-width: 480px) {
  .fof-livechat-wrap {
    bottom: 20px;
    right: 12px;
  }

  .fof-livechat-btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .fof-livechat-btn-text {
    display: inline;
  }

  .fof-livechat-btn i {
    font-size: 20px;
  }

  .fof-livechat-panel {
    width: calc(100vw - 32px);
    right: 0;
    max-height: 80vh;
  }
}
