/* ============================================================
   HWING REELS — Frontend CSS
   Version 1.3.0
   ============================================================ */

/* ── Floating Reels button (mobile only) ── */
#hwing-reels-float-btn {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 99999;
  align-items: center;
  gap: 8px;
  background: #ec1212;
  color: #ffffff;
  text-decoration: none;
  border-radius: 100px;
  padding: 12px 18px 12px 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 20px rgba(236, 18, 18, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
  opacity: 0;
  transform: translateY(16px);
}
#hwing-reels-float-btn.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s, transform 0.4s;
}
#hwing-reels-float-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(236, 18, 18, 0.55);
}
#hwing-reels-float-btn .hr-float-icon {
  font-size: 16px;
  line-height: 1;
}
#hwing-reels-float-pulse {
  position: absolute;
  inset: 0;
  border-radius: 100px;
  border: 2px solid rgba(236, 18, 18, 0.5);
  animation: hrPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes hrPulse {
  0%   { transform: scale(1); opacity: 0.7; }
  70%  { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1.2); opacity: 0; }
}
@media (min-width: 769px) {
  #hwing-reels-float-btn { display: none !important; }
}
@media (max-width: 768px) {
  #hwing-reels-float-btn { display: flex; }
}

/* ── Top banner ── */
#hwing-reels-banner {
  display: none;
  background: #ec1212;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 10px;
  z-index: 99998;
  position: relative;
}
#hwing-reels-banner.visible { display: flex; }
@media (min-width: 769px) {
  #hwing-reels-banner { display: none !important; }
}
.hr-banner-text {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.hr-banner-cta {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 100px;
  padding: 5px 12px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.hr-banner-close {
  color: rgba(255,255,255,0.7);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  background: none;
  border: none;
  flex-shrink: 0;
}

/* ── PWA install prompt (bottom sheet) ── */
#hwing-pwa-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99999;
  align-items: flex-end;
}
#hwing-pwa-backdrop.visible { display: flex; }
#hwing-pwa-sheet {
  background: #111;
  border-radius: 20px 20px 0 0;
  width: 100%;
  padding: 0 0 40px;
  border-top: 0.5px solid #2a2a2a;
  animation: hrSheetUp 0.35s cubic-bezier(0.4,0,0.2,1);
}
@keyframes hrSheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.hr-sheet-handle {
  width: 36px;
  height: 4px;
  background: #333;
  border-radius: 2px;
  margin: 12px auto 0;
}
.hr-sheet-body {
  padding: 20px 22px 0;
}
.hr-sheet-icon {
  width: 56px;
  height: 56px;
  background: #ec1212;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.hr-sheet-title {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}
.hr-sheet-sub {
  color: #666;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.hr-sheet-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.hr-sheet-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #1a1a1a;
  border-radius: 10px;
  padding: 11px 13px;
  border: 0.5px solid #222;
}
.hr-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ec1212;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.hr-step-text {
  color: #bbb;
  font-size: 13px;
  line-height: 1.4;
}
.hr-step-text strong { color: #fff; }
.hr-sheet-btn-primary {
  width: 100%;
  background: #ec1212;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-bottom: 8px;
}
.hr-sheet-btn-secondary {
  width: 100%;
  background: transparent;
  color: #555;
  border: none;
  padding: 10px;
  font-size: 13px;
  cursor: pointer;
}

/* ── Reels full-screen app ── */
body.hwing-reels-page {
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
  height: 100dvh;
}
#hwing-reels-app {
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  overflow: hidden;
  touch-action: none;
}

/* Loading screen */
#hr-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.hr-logo {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  color: #fff;
}
.hr-logo span { color: #ec1212; }
.hr-loading-dots {
  display: flex;
  gap: 6px;
}
.hr-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ec1212;
  animation: hrDot 1.2s ease-in-out infinite;
}
.hr-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.hr-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes hrDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* Feed container */
#hr-feed {
  position: absolute;
  inset: 0;
  /* Reels 2+ sit below this box and the whole feed is translated upward.
     Clipping here hides every item except the first. The outer app already
     clips the viewport, so this container must allow its children to show. */
  overflow: visible;
}
.hr-reel {
  position: absolute;
  left: 0;
  right: 0;
  height: 100dvh;
  overflow: hidden;
  will-change: transform;
}
.hr-reel-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.hr-reel-blur {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  filter: blur(24px) brightness(0.3) saturate(0.5);
  transform: scale(1.15);
  z-index: 0;
}
.hr-reel-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.93) 0%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0.1) 100%);
  z-index: 1;
}
.hr-reel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 64px;
  padding: 24px 16px env(safe-area-inset-bottom, 24px);
  z-index: 2;
}
.hr-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: env(safe-area-inset-top, 44px) 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}
.hr-top-logo {
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.4px;
  text-decoration: none;
}
.hr-top-logo span { color: #ec1212; }
.hr-filter-pills {
  display: flex;
  gap: 6px;
}
.hr-pill {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.15s;
}
.hr-pill.active {
  background: #ec1212;
  border-color: #ec1212;
}
.hr-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(236,18,18,0.9);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
}
.hr-type-badge.album  { background: rgba(100,60,200,0.9); }
.hr-type-badge.video  { background: rgba(20,80,200,0.9); }
.hr-type-badge.news   { background: rgba(20,120,60,0.9); }
.hr-type-badge.radar  { background: rgba(180,100,0,0.9); }
.hr-artist {
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.hr-title {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}
.hr-excerpt {
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hr-audio-label {
  color: rgba(255,255,255,0.45);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  min-height: 14px;
}
.hr-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  margin-bottom: 12px;
}
.hr-wave-bar {
  width: 2px;
  border-radius: 2px;
  background: rgba(236,18,18,0.7);
  transition: height 0.12s ease;
  flex-shrink: 0;
}
.hr-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.hr-btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ec1212;
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.hr-btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(8px);
}
.hr-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.1);
  z-index: 3;
}
.hr-progress-fill {
  height: 100%;
  background: #ec1212;
  width: 0%;
  transition: width 0.1s linear;
}
.hr-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 64px;
  height: 64px;
  background: rgba(236,18,18,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  cursor: pointer;
}
.hr-video-play-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1.5px solid rgba(236,18,18,0.35);
  animation: hrVideoRing 2s ease-out infinite;
  z-index: 2;
}
@keyframes hrVideoRing {
  0%,100% { transform: translate(-50%,-50%) scale(1); opacity: 0.6; }
  70%      { transform: translate(-50%,-50%) scale(1.3); opacity: 0; }
}

/* Side actions */
.hr-side-actions {
  position: absolute;
  right: 10px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  z-index: 5;
}
.hr-side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.hr-side-icon {
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  backdrop-filter: blur(8px);
  border: 0.5px solid rgba(255,255,255,0.12);
  transition: all 0.15s;
}
.hr-side-btn.liked .hr-side-icon { background: rgba(236,18,18,0.2); color: #ec1212; }
.hr-side-label {
  color: rgba(255,255,255,0.6);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Dot nav */
.hr-dot-nav {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 5;
}
.hr-dot {
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
  transition: all 0.2s;
  height: 3px;
}
.hr-dot.active {
  height: 16px;
  background: #ec1212;
}

/* Scroll hint */
.hr-scroll-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  z-index: 5;
}

/* End of feed */
.hr-end-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  padding: 24px;
}
.hr-end-logo {
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}
.hr-end-logo span { color: #ec1212; }
.hr-end-text {
  color: #666;
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}
.hr-end-btn {
  background: #ec1212;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
