/* ================= FEED ================= */
.feed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-snap-align: start;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: #000;
}

.feed::-webkit-scrollbar {
  display: none;
}

/* ================= VIDEO BOX ================= */
.video-box {
  position: relative;
  width: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #000;
}

/* ================= MEDIA ================= */
video,
iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  pointer-events: none;
  background: #000;
  transform: translate(-50%, -50%);
}

/* ================= MOBILE FIX ================= */
@media (max-width: 768px) {
  .feed,
  .video-box {
    height: calc(var(--vh, 1vh) * 100);
  }
}

/* ================= INFO ================= */
.info {
  position: absolute;
  left: 15px;
  right: 80px; 
  bottom: calc(45px + env(safe-area-inset-bottom));
  color: #fff;
  z-index: 10;
  pointer-events: none;
  max-width: calc(100% - 100px);
}

.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar,
.avatar-text {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.info-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.info-text p {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-text h3 {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ================= TAP OVERLAY ================= */
.tap-overlay {
  position: fixed;
  inset: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  cursor: pointer;
}

.tap-content {
  text-align: center;
}

.tap-icon {
  margin-bottom: 10px;
  animation: pulse 1.5s infinite;
}

.tap-text {
  font-size: 16px;
  opacity: 0.9;
}

/* ================= SEARCH ================= */
.search-btn {
  position: fixed;
  top: 0;
  right: 15px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  background: transparent;
  border: none;
}

.search-btn svg {
  transition: 0.2s;
}

.search-btn:hover svg {
  transform: scale(1.2);
}

.search-box {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: transparent;
  z-index: 1500;
  display: none;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap input {
  width: 100%;
  padding: 10px 45px 10px 15px;
  border: none;
  border-radius: 25px;
  background: #fff;
  color: #000;
  font-size: 14px;
  outline: none;
}

.search-input-wrap input::placeholder {
  color: #000;
}

#clearBtn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}

#clearBtn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ================= SEARCH RESULT ================= */
#searchResult {
  margin-top: 10px;
  background: rgba(20, 20, 20, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
  max-height: 70vh;
  overflow-y: auto;
}

#searchResult::-webkit-scrollbar {
  width: 5px;
}

#searchResult::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 20px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: 0.25s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.result-item img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  overflow: hidden;
}

.result-info .title {
  color: #fff;
  font-weight: 400;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-info .user {
  color: #aaa;
  font-size: 12px;
}

/* ================= ACTIONS ================= */
.actions {
  position: absolute;
  right: 10px;
  bottom: calc(100px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  gap: 10px;
  z-index: 20;
  opacity: 1;
  transition: opacity 0.105s ease;
}

.actions.hide {
  opacity: 0;
  pointer-events: none;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.action-btn:active {
  transform: scale(0.85);
}

.icon {
  font-size: 20px;
  color: #fff;
}

.count {
  font-size: 16px;
  margin-top: 0;
  opacity: 0.9;
}

/* ================= ICON STATES & STYLE ================= */
.liked .heart {
  fill: red;
  stroke: red;
  transform: scale(1.2);
}

.saved .save-icon {
  fill: yellow;
  stroke: yellow;
}

.heart,
.comment-icon,
.share-icon,
.save-icon {
  width: 30px;
  height: 30px;
  fill: transparent;
  stroke: #fff;
  color: #fff;
  stroke-width: 1;
  transition: 0.2s;
}

.comment:active .comment-icon,
.share:active .share-icon,
.save:active .save-icon {
  transform: scale(1.2);
}

/* ================= CENTER LIKE ================= */
.love-anim {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.love-icon {
  width: 120px;
  height: 120px;
  fill: #ff2d55;
  opacity: 0;
  transform: scale(0.2);
  filter: drop-shadow(0 0 10px rgba(255, 45, 85, 0.9))
          drop-shadow(0 0 25px rgba(255, 45, 85, 0.7));
}

.love-anim.show .love-icon {
  animation: heartLike 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes heartLike {
  0% { opacity: 0; transform: scale(0.2) rotate(-15deg); }
  20% { opacity: 1; transform: scale(1.35) rotate(10deg); }
  40% { transform: scale(0.95) rotate(-4deg); }
  60% { transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.9); }
}

/* ================= EXTRA ================= */
.tap-layer {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: transparent;
  pointer-events: auto;
}

#overlayClick {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}

/* ================= PROGRESS ================= */
.play-progress {
  position: fixed;
  bottom: 55px;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  overflow: hidden;
}

.play-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff0000, #ff4444, #ff0000);
  transition: width 0.05s linear;
}

/* ================= SHOP ================= */
.shop-icon {
  width: 40px;
  height: 40px;
  fill: transparent;
  stroke: #fff;
  stroke-width: 1;
  transition: 0.2s;
}

.shop:active .shop-icon {
  transform: scale(1.2);
}

.shop .count {
  font-size: 12px;
}



/* ================= CATEGORY ================= */
.category-wrap {
  position: fixed;
  top: 14px;
  left: 12px;
  right: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
  z-index: 1000;
  background: transparent;
  scrollbar-width: none;
}

.cat-btn {
  flex: none;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.cat-btn.active {
  color: red;
  font-weight: 700;
}


/* ================= INSTALL BUTTON ================= */
.install-btn {
  position: fixed;
  left: 90%;
  bottom: 60px;
  padding: 5px;
  border: none;
  border-radius: 0;
  background: #ff0000;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: none;
  z-index: 9999;
  transform: translateX(-50%);
}

/* ================= COMMENT ================= */
.comment-popup {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100%;
  height: 70%;
  background: #111;
  z-index: 99999;
  border-radius: 20px 20px 0 0;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
}

.reply-info {
  display: none;
  padding: 8px 15px;
  font-size: 12px;
  background: #1a1a1a;
  border-top: 1px solid #222;
  color: #aaa;
}

.comment-header {
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #222;
}

.comment-space {
  width: 40px;
}

.comment-title {
  color: #fff;
  font-weight: bold;
}

.comment-close {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  color: #fff;
}

.comment-input-wrap {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid #222;
}

.comment-input {
  flex: 1;
  background: #222;
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 30px;
  outline: none;
}

.comment-send {
  background: #fff;
  color: #000;
  border: none;
  padding: 0 18px;
  border-radius: 30px;
  font-weight: bold;
}

/* ================= NAVIGATION ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  transform: none;
  width: 100%;
  height: 55px;
  background: #111;
  border-top: 1px solid #222;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.bottom-nav a,
.nav-item {
  text-decoration: none !important;
}

.bottom-nav a:hover,
.bottom-nav a:focus,
.bottom-nav a:active,
.nav-item:hover,
.nav-item:focus {
  text-decoration: none !important;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
}

.nav-item small {
  font-size: 12px;
  margin-top: 2px;
}

.nav-item.active {
  color: #fff;
}

.add-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -8px;
  border: 1px solid #fff;
  text-decoration: none;
  color: #fff;
  font-size: 22px;
  font-weight: bold;
}

.svg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #555;
  transition: 0.2s;
}

.svg-avatar svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}

.nav-item:hover .svg-avatar {
  transform: scale(1.1);
  background: #444;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: #aaa;
  transition: 0.2s;
}

.nav-item.active svg {
  stroke: #fff;
}

.icon-wrap {
  position: relative;
  display: inline-block;
}

.badge-msg {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 0;
  background: red;
  color: #fff;
  font-size: 10px;
  font-weight: normal;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px #000;
}

.nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
}