/* ═══════════════════════════════════════════════════
   VibraFlow — TikTok-style vertical immersive feed
   PR #10 · VibraWorld
   ═══════════════════════════════════════════════════ */

/* ── Panel ── */
#panelFlow {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #06040f;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#panelFlow.vf-active {
  display: flex;
}

/* ── Cards container ── */
.vf-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

/* ── Individual card ── */
.vf-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.3s ease;
  will-change: transform;
  overflow: hidden;
  border-radius: 0;
}
.vf-card.vf-entering-from-bottom { transform: translateY(100%); opacity: 0; }
.vf-card.vf-entering-from-top    { transform: translateY(-100%); opacity: 0; }
.vf-card.vf-current              { transform: translateY(0); opacity: 1; }
.vf-card.vf-leaving-to-top       { transform: translateY(-100%); opacity: 0; }
.vf-card.vf-leaving-to-bottom    { transform: translateY(100%); opacity: 0; }

/* ── Card background ── */
.vf-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.vf-card-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.vf-card-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6,4,15,0.2) 0%,
    rgba(6,4,15,0) 30%,
    rgba(6,4,15,0) 45%,
    rgba(6,4,15,0.7) 75%,
    rgba(6,4,15,0.92) 100%
  );
}

/* ── Top HUD ── */
.vf-top-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 52px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(6,4,15,0.6) 0%, transparent 100%);
}
.vf-top-logo {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
}
.vf-top-logo span {
  background: linear-gradient(90deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.vf-top-filter {
  display: flex;
  gap: 6px;
}
.vf-filter-pill {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.vf-filter-pill.active {
  background: rgba(167,139,250,0.3);
  border-color: #a78bfa;
  color: #fff;
}

/* ── Progress bar ── */
.vf-progress {
  position: absolute;
  top: 46px;
  left: 16px;
  right: 72px;
  z-index: 11;
  display: flex;
  gap: 3px;
}
.vf-prog-seg {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
}
.vf-prog-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}
.vf-prog-fill.done { width: 100%; }
.vf-prog-fill.active-anim {
  animation: vfProgAnim var(--vf-duration, 6s) linear forwards;
}
@keyframes vfProgAnim {
  from { width: 0% }
  to   { width: 100% }
}

/* ── Card content ── */
.vf-card-content {
  position: relative;
  z-index: 5;
  padding: 16px 80px 100px 16px;
}
.vf-dept-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
}
.vf-dept-badge.mobility  { background: rgba(0,212,255,0.2); border: 1px solid rgba(0,212,255,0.4); color: #00d4ff; }
.vf-dept-badge.culture   { background: rgba(176,136,255,0.2); border: 1px solid rgba(176,136,255,0.4); color: #b088ff; }
.vf-dept-badge.economy   { background: rgba(255,196,0,0.2); border: 1px solid rgba(255,196,0,0.4); color: #ffc400; }
.vf-dept-badge.energy    { background: rgba(0,230,118,0.2); border: 1px solid rgba(0,230,118,0.4); color: #00e676; }
.vf-dept-badge.vitality  { background: rgba(240,98,146,0.2); border: 1px solid rgba(240,98,146,0.4); color: #f06292; }
.vf-dept-badge.nerhia    { background: rgba(139,92,246,0.2); border: 1px solid rgba(139,92,246,0.4); color: #a78bfa; }

.vf-card-headline {
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.vf-card-body {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
  margin: 0 0 12px;
}
.vf-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vf-agent-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.vf-agent-name {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.6);
}
.vf-time-ago {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: rgba(255,255,255,0.35);
  margin-left: auto;
}

/* ── Metrics mini strip ── */
.vf-metrics-strip {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.vf-metric-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: rgba(255,255,255,0.5);
}
.vf-metric-chip strong {
  color: #fff;
  font-weight: 600;
}

/* ── Side action bar ── */
.vf-actions {
  position: absolute;
  right: 12px;
  bottom: 108px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.vf-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.vf-action-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: visible;
}
.vf-action-btn:active .vf-action-icon {
  transform: scale(0.88);
}
.vf-action-btn.reacted .vf-action-icon {
  background: rgba(167,139,250,0.25);
  border-color: rgba(167,139,250,0.5);
  animation: vfBtnPop 0.35s ease;
}
@keyframes vfBtnPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.vf-action-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

/* ── Reaction particle burst ── */
.vf-burst {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  top: 0; left: 0;
}

/* ── VBC Reward toast inside flow ── */
.vf-vbc-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, rgba(167,139,250,0.95), rgba(56,189,248,0.95));
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 16px 28px;
  z-index: 10000;
  text-align: center;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  opacity: 0;
}
.vf-vbc-toast.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.vf-vbc-toast.hide {
  transform: translate(-50%, -60%) scale(0.8);
  opacity: 0;
}
.vf-vbc-toast-amount {
  font-family: var(--sans);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.vf-vbc-toast-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
}

/* ── Share sheet ── */
.vf-share-sheet {
  position: fixed;
  bottom: -100%;
  left: 0; right: 0;
  z-index: 5000;
  background: rgba(16,10,32,0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(167,139,250,0.2);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 40px;
  transition: bottom 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.vf-share-sheet.open { bottom: 0; }
.vf-share-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.vf-share-title {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  text-align: center;
}
.vf-share-options {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.vf-share-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.vf-share-opt-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  transition: all 0.2s;
}
.vf-share-opt:active .vf-share-opt-icon { transform: scale(0.92); }
.vf-share-opt-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: rgba(255,255,255,0.4);
}
.vf-share-close {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: rgba(255,255,255,0.6);
  font-family: var(--mono);
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
}

/* ── Comment overlay ── */
.vf-comment-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
}
.vf-comment-overlay.open { display: flex; }
.vf-comment-sheet {
  background: rgba(16,10,32,0.98);
  border-top: 1px solid rgba(167,139,250,0.2);
  border-radius: 20px 20px 0 0;
  padding: 16px 0 0;
  width: 100%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.vf-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.vf-comment-title {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}
.vf-comment-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
}
.vf-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vf-comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: fadeInUp 0.25s ease;
}
.vf-comment-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.vf-comment-bubble {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 8px 12px;
  flex: 1;
}
.vf-comment-name {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: #a78bfa;
  margin-bottom: 2px;
  font-weight: 500;
}
.vf-comment-text {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
}
.vf-comment-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(16,10,32,0.98);
}
.vf-comment-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #fff;
  outline: none;
}
.vf-comment-input:focus {
  border-color: rgba(167,139,250,0.4);
  background: rgba(167,139,250,0.06);
}
.vf-comment-send {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.vf-comment-send:active { transform: scale(0.9); }

/* ── Swipe hint ── */
.vf-swipe-hint {
  position: absolute;
  bottom: 108px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 15;
  pointer-events: none;
  animation: vfSwipeHintAnim 2.5s ease-in-out 1.5s forwards;
  opacity: 0;
}
@keyframes vfSwipeHintAnim {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  20%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(-8px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
.vf-swipe-hint-icon { font-size: 1.4rem; }
.vf-swipe-hint-text {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
}

/* ── Pause indicator ── */
.vf-pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  z-index: 20;
  pointer-events: none;
  transition: transform 0.15s ease, opacity 0.3s ease;
  opacity: 0;
}
.vf-pause-indicator.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* ── Double-tap heart ── */
.vf-dbl-heart {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  font-size: 4rem;
  animation: vfDblHeart 0.8s ease-out forwards;
  transform-origin: center;
}
@keyframes vfDblHeart {
  0%   { opacity: 0; transform: scale(0) rotate(-15deg); }
  30%  { opacity: 1; transform: scale(1.3) rotate(-5deg); }
  60%  { opacity: 1; transform: scale(1) rotate(0deg); }
  100% { opacity: 0; transform: scale(0.8) translateY(-40px); }
}

/* ── Dept-themed card backgrounds ── */
.vf-card[data-dept="mobility"] .vf-card-bg  { background: radial-gradient(ellipse at 30% 20%, #003d52 0%, #001a26 40%, #06040f 100%); }
.vf-card[data-dept="culture"]  .vf-card-bg  { background: radial-gradient(ellipse at 70% 30%, #2a1a4a 0%, #1a0a2e 40%, #06040f 100%); }
.vf-card[data-dept="economy"]  .vf-card-bg  { background: radial-gradient(ellipse at 50% 20%, #3d2a00 0%, #1a1200 40%, #06040f 100%); }
.vf-card[data-dept="energy"]   .vf-card-bg  { background: radial-gradient(ellipse at 30% 70%, #003d20 0%, #001a0e 40%, #06040f 100%); }
.vf-card[data-dept="vitality"] .vf-card-bg  { background: radial-gradient(ellipse at 70% 70%, #3d1a26 0%, #1a0a12 40%, #06040f 100%); }
.vf-card[data-dept="nerhia"]   .vf-card-bg  { background: radial-gradient(ellipse at 50% 30%, #1a0a3d 0%, #0a0520 40%, #06040f 100%); }

/* ── Floating emoji reactions ── */
.vf-float-emoji {
  position: fixed;
  pointer-events: none;
  z-index: 9990;
  font-size: 1.6rem;
  animation: vfFloatUp 1.4s ease-out forwards;
}
@keyframes vfFloatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.6) rotate(20deg); }
}

/* ── Back button ── */
.vf-back-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 16px;
  z-index: 300;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
}
.vf-back-btn.visible { display: flex; }

/* ── Loading skeleton ── */
.vf-skeleton-card {
  position: absolute;
  inset: 0;
  background: #06040f;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 80px 100px 20px;
  gap: 10px;
}
.vf-skel {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: vfSkelShimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes vfSkelShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Haptic ripple ── */
.vf-haptic-ring {
  position: fixed;
  pointer-events: none;
  z-index: 9989;
  border-radius: 50%;
  border: 2px solid rgba(167,139,250,0.6);
  animation: vfHapticRing 0.5s ease-out forwards;
}
@keyframes vfHapticRing {
  0%   { transform: scale(0); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}
