/* =========================================================
   For The Reel – Frontend Feed Styles
   Mobile-first TikTok-style vertical snap scroll
   ========================================================= */

/* Feed container */
.ftr-feed {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100svh;        /* dynamic viewport height on mobile */
  height: 100vh;         /* fallback */
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: #000;
}

/* Ensure body/html allow full height when feed is on page */
body.ftr-fullscreen-mode,
html.ftr-fullscreen-mode {
  overflow: hidden;
  height: 100%;
}

/* Individual reel card */
.ftr-card {
  position: relative;
  width: 100%;
  height: 100svh;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video element */
.ftr-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  cursor: pointer;
}

/* Fallback image when no video */
.ftr-video-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Invisible tap-to-pause layer above video but below overlay */
.ftr-tap-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}

/* ─── Bottom overlay gradient ─── */
.ftr-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 16px 72px 24px 16px; /* right padding leaves room for action buttons */
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  color: #fff;
}

/* Business info row */
.ftr-biz-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ftr-biz-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  flex-shrink: 0;
}

.ftr-biz-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ftr-biz-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ftr-biz-location {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ─── AI Edited badge ─── */
.ftr-ai-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  letter-spacing: 0.3px;
  text-shadow: none;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* ─── Hook line ─── */
.ftr-hook {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin: 0 0 6px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Caption */
.ftr-caption {
  font-size: 14px;
  color: #fff;
  line-height: 1.4;
  margin: 0 0 10px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CTA row */
.ftr-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ftr-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.ftr-btn:active {
  transform: scale(0.95);
  opacity: 0.85;
}

.ftr-btn--cta {
  background: #ff2d55;
  color: #fff;
}

.ftr-btn--call {
  background: rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.35);
}

.ftr-btn--web {
  background: rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.35);
}

/* ─── Right-side action buttons ─── */
.ftr-actions {
  position: absolute;
  right: 12px;
  bottom: 100px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.ftr-like-btn,
.ftr-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 11px;
  text-align: center;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ftr-like-btn:active,
.ftr-share-btn:active {
  transform: scale(1.25);
}

.ftr-like-icon,
.ftr-share-icon {
  font-size: 28px;
  line-height: 1;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.ftr-like-count {
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Liked state */
.ftr-like-btn.is-liked .ftr-like-icon {
  animation: ftr-heart-pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.ftr-like-btn:not(.is-liked) .ftr-like-icon {
  filter: grayscale(1) drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

@keyframes ftr-heart-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.45); }
  100% { transform: scale(1.1); }
}

/* ─── Pause indicator ─── */
.ftr-card.is-paused::after {
  content: "⏸";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 56px;
  color: rgba(255,255,255,0.75);
  z-index: 5;
  pointer-events: none;
  animation: ftr-fade-out 1.2s ease forwards;
}

@keyframes ftr-fade-out {
  0%   { opacity: 1; }
  70%  { opacity: 0.7; }
  100% { opacity: 0; }
}

/* ─── Empty state ─── */
.ftr-empty {
  text-align: center;
  color: #888;
  padding: 40px 20px;
  font-size: 15px;
}

/* ─── Responsive tweaks ─── */
@media (min-width: 481px) {
  .ftr-feed {
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    max-height: 860px;
  }
}

@media (max-width: 480px) {
  .ftr-overlay {
    padding-right: 68px;
  }
}

/* ─── Fullscreen feed variant ───────────────────────────────
   Used by [for_the_reel_fullscreen] shortcode.
   Fills the entire browser viewport with no max-width cap.
   ─────────────────────────────────────────────────────────── */

.ftr-fullscreen-feed {
  max-width: none !important;
  width: 100vw !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background: #000;
}

.ftr-fullscreen-feed .ftr-card {
  border-radius: 0;
  width: 100vw;
  height: 100svh;
  height: 100vh;
}

/* Helper: page body when fullscreen feed is active */
.ftr-page-fullscreen body {
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Close / exit fullscreen button (optional, added by JS if desired) */
.ftr-fullscreen-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  background: rgba(0,0,0,0.55);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

