/* VibraFeed — TikTok geo-local vertical feed */

#vibrafeed-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  flex-direction: column;
}

#vibrafeed-panel.active {
  display: flex;
}

/* Header */
.vf-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 52px 16px 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,.8) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vf-header-tabs {
  display: flex;
  gap: 20px;
}

.vf-tab {
  color: rgba(255,255,255,.6);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}

.vf-tab.active {
  color: #fff;
  border-bottom-color: #fff;
}

.vf-header-actions {
  display: flex;
  gap: 12px;
}

.vf-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

/* Close */
.vf-close {
  position: absolute;
  top: 52px;
  right: 16px;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

/* Feed scroll container */
.vf-scroll {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.vf-scroll::-webkit-scrollbar { display: none; }

/* Individual post card */
.vf-post {
  width: 100%;
  height: 100dvh;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
}

/* Background gradient / media */
.vf-post-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.vf-post-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.85) 0%,
    rgba(0,0,0,.2) 50%,
    rgba(0,0,0,.1) 100%
  );
}

/* Bottom info */
.vf-post-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 72px;
  padding: 0 16px 80px;
}

.vf-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.vf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #7B2FBE, #E91E8C);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.vf-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vf-author-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.vf-author-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.vf-distance-badge {
  font-size: 11px;
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.15);
  padding: 2px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vf-time {
  font-size: 11px;
  color: rgba(255,255,255,.6);
}

.vf-post-caption {
  font-size: 14px;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 8px;
}

.vf-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.vf-tag {
  font-size: 12px;
  color: #7B2FBE;
  font-weight: 600;
}

/* Location chip */
.vf-location-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(8px);
}

/* Right side actions */
.vf-post-actions {
  position: absolute;
  right: 12px;
  bottom: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.vf-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.vf-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  backdrop-filter: blur(8px);
  transition: transform .15s, background .15s;
}

.vf-action-btn:active .vf-action-icon {
  transform: scale(.9);
}

.vf-action-btn.liked .vf-action-icon {
  background: rgba(233,30,140,.3);
}

.vf-action-count {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

/* VBC pulse when like */
@keyframes vfLikePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  70% { transform: scale(.9); }
  100% { transform: scale(1); }
}

.vf-action-btn.pop .vf-action-icon {
  animation: vfLikePop .4s ease;
}

/* Energy bar */
.vf-energy-bar {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 80px;
  background: rgba(255,255,255,.15);
  border-radius: 4px;
  overflow: hidden;
}

.vf-energy-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 4px;
  background: linear-gradient(to top, #E91E8C, #7B2FBE);
  transition: height .5s ease;
}

/* Compose button */
.vf-compose-btn {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 210;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2FBE, #E91E8C);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(123,47,190,.5);
}

#vibrafeed-panel.active ~ .vf-compose-btn,
#vibrafeed-panel.active .vf-compose-btn {
  display: flex;
}

/* Progress bar on post */
.vf-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, #E91E8C, #7B2FBE);
  border-radius: 0 2px 2px 0;
  transition: width .1s linear;
}

/* Loading skeleton */
.vf-skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: vfSkeleton 1.4s infinite;
  border-radius: 8px;
}

@keyframes vfSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.vf-empty {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.6);
  gap: 12px;
}

.vf-empty-icon {
  font-size: 64px;
  opacity: .4;
}

.vf-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.vf-empty-sub {
  font-size: 14px;
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

/* Double tap heart */
.vf-heart-pop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 80px;
  pointer-events: none;
  z-index: 50;
  animation: vfHeartPop .6s ease forwards;
}

@keyframes vfHeartPop {
  0%   { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  40%  { transform: translate(-50%,-50%) scale(1.2); opacity: 1; }
  70%  { transform: translate(-50%,-50%) scale(1); opacity: .8; }
  100% { transform: translate(-50%,-50%) scale(1.4); opacity: 0; }
}

/* Comment drawer */
.vf-comments-drawer {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  z-index: 300;
  background: #1a1a1a;
  border-radius: 20px 20px 0 0;
  transition: bottom .35s cubic-bezier(.4,0,.2,1);
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
}

.vf-comments-drawer.open {
  bottom: 0;
}

.vf-drawer-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  margin: 12px auto 8px;
  flex-shrink: 0;
}

.vf-drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.vf-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.vf-comment-item {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.vf-comment-bubble {
  background: rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 8px 12px;
  flex: 1;
}

.vf-comment-author {
  font-size: 12px;
  font-weight: 700;
  color: #7B2FBE;
  margin-bottom: 3px;
}

.vf-comment-text {
  font-size: 13px;
  color: rgba(255,255,255,.9);
  line-height: 1.4;
}

.vf-comment-input-row {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #1a1a1a;
  flex-shrink: 0;
}

.vf-comment-input {
  flex: 1;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.vf-comment-input::placeholder { color: rgba(255,255,255,.4); }

.vf-comment-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B2FBE, #E91E8C);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 290;
  background: rgba(0,0,0,.5);
  display: none;
}
.vf-backdrop.open { display: block; }

/* VBC earn notification */
.vf-vbc-toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, #7B2FBE, #E91E8C);
  color: #fff;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  z-index: 500;
  opacity: 0;
  transition: all .3s ease;
  white-space: nowrap;
  pointer-events: none;
}

.vf-vbc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
