/* ============================================
   SHORTS - TikTok-style vertical video viewer
   ============================================ */

/* Reset & base */
.shorts-body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  height: 100vh;
  height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

#shorts-app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
  overflow: hidden;
}

/* Header bar */
.shorts-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
  box-sizing: border-box;
}

.shorts-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
  transition: background 0.2s;
}

.shorts-back-btn:hover {
  background: rgba(255,255,255,0.2);
}

.shorts-logo {
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Swiper container */
.shorts-swiper {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.shorts-swiper .swiper-wrapper {
  will-change: transform;
}

/* Each slide */
.shorts-slide {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

/* Video element */
.shorts-video-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.shorts-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}

.shorts-slide-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.shorts-video {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* Tap zone overlay (for mute/unmute) */
.shorts-tap-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 80px;
  bottom: 160px;
  z-index: 10;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Progress bar (seekable) */
.shorts-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.2);
  background-clip: content-box;
  z-index: 20;
  cursor: pointer;
  padding-top: 12px;
  margin-top: -12px;
}

.shorts-progress:active,
.shorts-progress.seeking {
  height: 6px;
}

.shorts-progress-bar {
  height: 100%;
  width: 0%;
  background: #fff;
  pointer-events: none;
}

.shorts-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  transition: width 0.15s, height 0.15s;
}

.shorts-progress:active .shorts-progress-handle,
.shorts-progress.seeking .shorts-progress-handle {
  width: 14px;
  height: 14px;
}

/* Mute indicator (centered) */
.shorts-mute-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  animation: shortsFadeOut 0.8s ease-out forwards;
}

/* Play/pause indicator (centered) */
.shorts-play-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  animation: shortsFadeOut 0.6s ease-out forwards;
}

@keyframes shortsFadeOut {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

/* Right sidebar actions (TikTok-style) */
.shorts-sidebar {
  position: absolute;
  right: 8px;
  bottom: 160px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.shorts-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.shorts-action svg {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
  transition: transform 0.15s ease;
}

.shorts-action:active svg {
  transform: scale(1.2);
}

.shorts-action-count {
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.shorts-action.liked svg {
  fill: #ff2d55;
  animation: shortsLikePop 0.4s ease;
}

.shorts-action.voting svg {
  opacity: 0.5;
}

@keyframes shortsLikePop {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Bottom info overlay (TikTok-style) */
.shorts-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 80px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shorts-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shorts-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}

.shorts-username {
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  text-decoration: none;
}

a.shorts-username:hover {
  text-decoration: underline;
}

.shorts-title {
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shorts-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 52px;
  overflow: hidden;
}

.shorts-tag {
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  text-decoration: none;
  background: rgba(255,255,255,0.15);
  padding: 2px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.shorts-tag:hover {
  background: rgba(255,255,255,0.3);
}

/* View full page link */
.shorts-view-full {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.7);
  font-family: 'Roboto', sans-serif;
  font-size: 12px;
  text-decoration: none;
  margin-top: 2px;
}

.shorts-view-full:hover {
  color: #fff;
}

/* Loading state */
.shorts-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
}

.shorts-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #fff;
  border-right-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: shortsSpin 0.7s linear infinite;
  box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

@keyframes shortsSpin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.shorts-empty {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-family: 'Roboto', sans-serif;
}

.shorts-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.shorts-empty-text {
  font-size: 16px;
}

/* Promo slide (live cam) */
.shorts-promo-slide {
  background: #000;
}

.shorts-promo-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.shorts-promo-swipe-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 15%;
  z-index: 12;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 100%);
}

.shorts-promo-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.shorts-promo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 50px 16px 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 70%, transparent 100%);
}

.shorts-promo-label {
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.shorts-promo-btn {
  display: block;
  width: 90%;
  max-width: 400px;
  padding: 14px 0;
  background: #c0392b;
  color: #fff;
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border-radius: 50px;
  transition: background 0.2s;
}

.shorts-promo-btn:hover {
  background: #e74c3c;
}

/* ── Social promo CTA (OnlyFans / X) — inside .shorts-info ── */
.shorts-social-promo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: shortsSocialIn 0.5s ease 1s both;
}

@keyframes shortsSocialIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.shorts-social-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  max-width: 340px;
}
.shorts-social-cta:active {
  transform: scale(0.97);
}

/* OnlyFans CTA */
.shorts-social-of {
  background: linear-gradient(135deg, rgba(0,175,240,0.25) 0%, rgba(0,144,208,0.2) 100%);
  border: 1.5px solid rgba(0,175,240,0.4);
  animation: shortsSocialGlow 4s ease-in-out 2.5s infinite;
}
.shorts-social-of:hover,
.shorts-social-of:focus {
  background: rgba(0,175,240,0.3);
  border-color: rgba(0,175,240,0.5);
}

/* X/Twitter CTA */
.shorts-social-x {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
}
.shorts-social-x:hover,
.shorts-social-x:focus {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.25);
}

.shorts-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.shorts-social-of .shorts-social-icon {
  background: linear-gradient(135deg, #00aff0 0%, #0090d0 100%);
  color: #fff;
}
.shorts-social-x .shorts-social-icon {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.shorts-social-text {
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  overflow: hidden;
  text-overflow: ellipsis;
}
.shorts-social-text strong {
  font-weight: 700;
}
.shorts-social-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  margin-top: 1px;
}

.shorts-social-arrow {
  font-size: 20px;
  font-weight: 300;
  opacity: 0.5;
  margin-left: auto;
  flex-shrink: 0;
}

@keyframes shortsSocialGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,175,240,0); }
  50%      { box-shadow: 0 0 14px 3px rgba(0,175,240,0.2); }
}

/* Desktop responsiveness */
@media (min-width: 768px) {
  #shorts-app {
    border-left: 1px solid #222;
    border-right: 1px solid #222;
  }

  .shorts-header {
    max-width: 500px;
  }
}

/* Safe area for iOS notch */
@supports (padding-top: env(safe-area-inset-top)) {
  .shorts-header {
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .shorts-info {
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .shorts-progress {
    bottom: env(safe-area-inset-bottom);
  }
}
