/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* EGP Balance Header (like mobile app) */
.egp-balance-header {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 8px 16px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.balance-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-icon {
  font-size: 16px;
}

.balance-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.balance-amount {
  font-size: 14px;
  font-weight: 700;
  color: #4CAF50;
}

.balance-type {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* Shorts Container */
.shorts-container {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: none; /* Firefox */
}

.shorts-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* Video Item */
.video-item {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  touch-action: pan-y;
  margin: 0 auto;
}

/* Ad Item (full-screen slot between videos) */
.ad-item {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0b0b;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.ad-box {
  width: 320px;
  max-width: 90%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  padding: 8px;
}

.ad-label {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Video Player */
.video-player {
  width: 100%;
  height: 100%;
  background: #000;
  position: relative;
  overflow: hidden;
}

/* Video Thumbnail (shown while loading) */
.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #000;
  z-index: 9;
}

.video-thumbnail.loading .loading-spinner {
  display: flex;
}

.video-thumbnail .loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
}

.video-thumbnail .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.video-player video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 8;
}


/* Video Overlay */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Top Gradient */
.top-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
  pointer-events: none;
}

/* Bottom Gradient */
.bottom-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
  pointer-events: none;
}

/* Video Info */
.video-info {
  position: absolute;
  bottom: 100px;
  left: 16px;
  right: 90px;
  z-index: 20;
  pointer-events: none;
}

.creator-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  pointer-events: all;
}

.creator-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.creator-avatar:hover {
  transform: scale(1.1);
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

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

.creator-avatar.default-avatar {
  background: radial-gradient(circle at 25% 25%, #2563eb, transparent 65%),
    radial-gradient(circle at 75% 75%, #a855f7, transparent 60%),
    #111827;
}

.creator-avatar.default-avatar img {
  object-fit: contain;
  padding: 6px;
}

.creator-details {
  flex: 1;
  min-width: 0;
}

.creator-details:hover .creator-name {
  color: #3b82f6;
}

.creator-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.creator-name:hover {
  text-decoration: underline;
  color: #3b82f6;
  transform: translateX(2px);
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: #3b82f6;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
}

.creator-stats {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.follow-btn {
  padding: 6px 20px;
  border-radius: 4px;
  background: #fff;
  border: none;
  color: #000;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: all;
  text-transform: capitalize;
  letter-spacing: 0;
  flex-shrink: 0;
}

.follow-btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

.follow-btn.following {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.follow-btn.following:hover {
  background: rgba(255, 255, 255, 0.3);
}

.follow-btn:active {
  transform: scale(0.95);
}

.video-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  line-height: 1.3;
}

.video-description {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-stats {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}


/* Action Buttons (Right Side) */
.action-buttons {
  position: absolute;
  right: 12px;
  bottom: 120px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.action-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(42, 42, 42, 0.7);
  backdrop-filter: blur(10px);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  pointer-events: all;
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.action-btn:active:not(:disabled) {
  transform: scale(0.85);
}

.action-btn.active {
  color: #ff0000;
}

.action-btn.liked {
  animation: likeAnimation 0.4s ease;
}

.action-btn:hover:not(:disabled) {
  background: rgba(42, 42, 42, 0.9);
  transform: scale(1.05);
}

@keyframes likeAnimation {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.action-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
  margin-top: 2px;
}

/* Navigation Buttons */
/* Small prev/next helpers for desktop */
.nav-btn {
  position: fixed;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(42,42,42,0.7);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover { background: rgba(42,42,42,0.9); transform: scale(1.05); }
.nav-prev { top: 40%; }
.nav-next { top: 55%; }

@media (max-width: 768px) {
  .nav-btn { display: none; }
}

/* Play/Pause Overlay */
.play-pause-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 15;
}

/* Show briefly when toggling play/pause, then hide */
.play-pause-overlay.flash {
  opacity: 1;
}

.play-pause-overlay:hover {
  background: rgba(0,0,0,0.8);
}

/* Custom Controls */
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.video-item.show-controls .custom-controls {
  opacity: 1;
  pointer-events: all;
}

.video-item.always-show-controls .custom-controls {
  opacity: 1;
  pointer-events: all;
}

.video-item.always-show-controls .video-info {
  bottom: 150px;
}

.shorts-container.has-banner-ad .video-item.always-show-controls .video-info {
  bottom: 205px;
}

.shorts-container.has-banner-ad .video-item.always-show-controls .custom-controls {
  bottom: 58px;
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
  cursor: pointer;
  pointer-events: all;
}

.progress-bar {
  height: 100%;
  background: #3b82f6;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Control Bar */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-row.primary {
  justify-content: center;
}

.control-row.secondary {
  justify-content: center;
}

.control-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  pointer-events: all;
}

.control-btn:active {
  transform: scale(0.9);
}

.skip-btn {
  font-size: 1.2rem;
  opacity: 0.9;
}

.skip-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.control-label-icon,
.control-label-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shorts-detail-page .play-pause-btn .play-icon,
.shorts-detail-page .volume-btn .volume-icon,
.shorts-detail-page .control-label-icon {
  font-size: 0;
  line-height: 0;
}

.shorts-detail-page .play-pause-btn .play-icon::before,
.shorts-detail-page .volume-btn .volume-icon::before,
.shorts-detail-page .control-label-icon::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.shorts-detail-page .skip-btn[data-control="backward"] .control-label-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M11 12l8-6v12z'/%3E%3Crect x='5' y='6' width='2' height='12' rx='1'/%3E%3C/svg%3E");
}

.shorts-detail-page .skip-btn[data-control="forward"] .control-label-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M13 12L5 6v12z'/%3E%3Crect x='17' y='6' width='2' height='12' rx='1'/%3E%3C/svg%3E");
}

.shorts-detail-page .play-pause-btn[data-state='play'] .play-icon::before,
.shorts-detail-page .play-pause-btn:not([data-state]) .play-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5.5v13l10-6.5z'/%3E%3C/svg%3E");
}

.shorts-detail-page .play-pause-btn[data-state='pause'] .play-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='6' y='5' width='4' height='14' rx='1.2'/%3E%3Crect x='14' y='5' width='4' height='14' rx='1.2'/%3E%3C/svg%3E");
}

.shorts-detail-page .volume-btn[data-state='unmuted'] .volume-icon::before,
.shorts-detail-page .volume-btn:not([data-state]) .volume-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z' fill='white'/%3E%3Cpath d='M16 9.5a4.5 4.5 0 010 5' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M18.5 7a8 8 0 010 10' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.shorts-detail-page .volume-btn[data-state='muted'] .volume-icon::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z' fill='white'/%3E%3Cpath d='M16 9l5 6M21 9l-5 6' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.control-label-text {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.time-display {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 100px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 2;
  flex-basis: 100%;
  justify-content: center;
  width: min(220px, 72vw);
}

.volume-slider {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  pointer-events: all;
}

.volume-slider-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 100%;
  transition: width 0.1s linear;
}

/* Earned Badge */
.earned-badge {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.earned-badge.show {
  opacity: 1;
  animation: earnedBadge 0.5s ease;
}

@keyframes earnedBadge {
  0% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Skip Indicator */
.skip-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.skip-indicator.show {
  opacity: 1;
  animation: skipPulse 0.8s ease;
}

@keyframes skipPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
  color: #fff;
  font-size: 1rem;
}

/* Reward Popup */
.reward-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  z-index: 2000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.4);
}

.reward-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.reward-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.reward-amount {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.reward-text {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0.9;
}

/* Close Button */
.close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 100;
  text-decoration: none;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(0,0,0,0.7);
  transform: scale(1.1);
}

/* Global Sound Toggle */
.global-sound-toggle {
  display: none !important;
}

/* Unmute Prompt */
.unmute-prompt {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 16px 32px;
  z-index: 150;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: all;
}

.unmute-prompt.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: unmutePulse 2s ease-in-out infinite;
}

@keyframes unmutePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
}

.unmute-prompt:hover {
  background: rgba(59, 130, 246, 0.9);
  border-color: #3b82f6;
  transform: translateX(-50%) translateY(-5px);
}

.unmute-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.unmute-icon {
  font-size: 1.5rem;
  animation: unmuteShake 0.5s ease infinite;
}

@keyframes unmuteShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.unmute-text {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Category Filter (Optional) */
.category-filter {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: calc(100% - 100px);
}

.category-btn {
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: none;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-btn.active {
  background: #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
  .video-info {
    bottom: 90px;
    right: 80px;
    left: 12px;
  }

  .video-item.always-show-controls .video-info {
    bottom: 140px;
  }

  .shorts-container.has-banner-ad .video-item.always-show-controls .video-info {
    bottom: 195px;
  }

  .creator-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .creator-name {
    font-size: 0.85rem;
  }

  .creator-stats {
    font-size: 0.7rem;
  }

  .follow-btn {
    padding: 5px 16px;
    font-size: 0.8rem;
  }

  .video-title {
    font-size: 0.9rem;
  }

  .video-description {
    font-size: 0.8rem;
  }

  .action-buttons {
    right: 10px;
    bottom: 100px;
    gap: 20px;
  }

  .action-btn {
    width: 46px;
    height: 46px;
    font-size: 1.5rem;
  }

  .action-count {
    font-size: 0.65rem;
  }

  .global-sound-toggle {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
    top: 15px;
    left: 15px;
  }

  .volume-control {
    display: none;
  }

  .category-filter {
    max-width: calc(100% - 80px);
    margin-left: 70px; /* Make room for sound toggle */
  }

  .unmute-prompt {
    bottom: 100px;
    padding: 12px 24px;
  }

  .unmute-icon {
    font-size: 1.3rem;
  }

  .unmute-text {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .video-info {
    bottom: 80px;
    right: 75px;
    left: 10px;
  }

  .video-item.always-show-controls .video-info {
    bottom: 132px;
  }

  .shorts-container.has-banner-ad .video-item.always-show-controls .video-info {
    bottom: 186px;
  }

  .creator-info {
    gap: 8px;
  }

  .creator-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .creator-name {
    font-size: 0.8rem;
  }

  .creator-stats {
    font-size: 0.65rem;
  }

  .follow-btn {
    padding: 4px 14px;
    font-size: 0.75rem;
  }

  .video-title {
    font-size: 0.85rem;
  }

  .video-description {
    font-size: 0.75rem;
  }

  .action-buttons {
    right: 8px;
    bottom: 90px;
    gap: 18px;
  }

  .action-btn {
    width: 42px;
    height: 42px;
    font-size: 1.4rem;
  }

  .action-count {
    font-size: 0.6rem;
  }

  .global-sound-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    top: 12px;
    left: 12px;
  }

  .time-display {
    font-size: 0.75rem;
    min-width: 80px;
  }

  .unmute-prompt {
    bottom: 90px;
    padding: 10px 20px;
  }

  .unmute-icon {
    font-size: 1.2rem;
  }

  .unmute-text {
    font-size: 0.85rem;
  }
}

/* Banner ad bottom clearance */
.shorts-container.has-banner-ad {
  padding-bottom: 58px;
}

.shorts-detail-page .banner-ad-container {
  width: 100%;
}

/* Desktop/Tablet - Center shorts player for better UX */
@media (min-width: 768px) {
  body.shorts-detail-page {
    --detail-video-width: min(360px, calc(100vw - 520px));
    --detail-video-height: min(calc(100vh - 92px), 780px);
    --detail-video-top-offset: 22px;
    --detail-banner-gap: 0px;
  }

  body.shorts-detail-page.no-banner-ad {
    --detail-video-height: min(calc(100vh - 34px), 840px);
  }

  body.shorts-detail-page.has-banner-ad:not(.banner-slot-active) {
    --detail-video-height: min(calc(100vh - 34px), 840px);
  }

  .shorts-container {
    max-width: 500px;
    margin: 0 auto;
  }
  
  .video-item {
    max-width: 500px;
  }

  .search-interface {
    width: min(312px, calc(100vw - 220px));
    max-width: none;
    top: 18px;
  }

  .search-container {
    justify-content: flex-start;
  }

  html:has(body.shorts-detail-page),
  body.shorts-detail-page {
    background: #f5f5f5;
  }

  .shorts-detail-page .shorts-container {
    max-width: none;
    margin: 0;
    background: #f5f5f5;
  }

  .shorts-detail-page .video-item {
    max-width: none;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #f5f5f5;
    padding: var(--detail-video-top-offset) 0 0;
  }

  .shorts-detail-page .video-player {
    width: var(--detail-video-width);
    max-width: 360px;
    height: var(--detail-video-height);
    margin: 0 auto;
    overflow: visible;
    background: #000;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  }

  .shorts-detail-page .video-thumbnail,
  .shorts-detail-page .video-player video {
    border-radius: 0;
  }

  .shorts-detail-page .video-thumbnail {
    background-size: cover !important;
    background-position: top center !important;
  }

  .shorts-detail-page .video-player video {
    object-fit: cover !important;
    object-position: top center !important;
  }

  .shorts-detail-page .video-item.always-show-controls .video-info {
    left: 50% !important;
    right: auto !important;
    bottom: 28px !important;
    width: var(--detail-video-width) !important;
    max-width: 360px !important;
    padding: 0 78px 0 12px !important;
    transform: translateX(-50%) !important;
  }

  .shorts-detail-page .video-item.always-show-controls .action-buttons {
    right: calc(50% - 180px - 92px) !important;
    top: calc(var(--detail-video-top-offset) + 12px) !important;
    bottom: auto !important;
    gap: 18px !important;
    justify-content: flex-start !important;
  }

  .shorts-detail-page .nav-btn {
    display: flex !important;
    right: 24px !important;
    background: rgba(42,42,42,0.7) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18) !important;
  }

  .shorts-detail-page .action-btn {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #111827;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: none;
  }

  .shorts-detail-page .action-btn:hover:not(:disabled) {
    background: #ffffff;
    transform: scale(1.04);
  }

  .shorts-detail-page .action-count {
    color: #111827;
    text-shadow: none;
  }

  .shorts-detail-page .video-item.always-show-controls .progress-bar-container {
    left: 50% !important;
    right: auto !important;
    width: var(--detail-video-width) !important;
    transform: translateX(-50%) !important;
    bottom: 12px !important;
  }

  .shorts-detail-page .video-item.always-show-controls .time-display {
    display: none !important;
  }

  .shorts-detail-page .video-item.always-show-controls .custom-controls {
    inset: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: all !important;
    overflow: hidden !important;
  }

  .shorts-detail-page .video-item.always-show-controls .control-bar {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    padding: 0 !important;
    pointer-events: none !important;
    z-index: 28 !important;
    opacity: 0 !important;
    transition: opacity 0.18s ease !important;
    width: auto !important;
  }

  .shorts-detail-page .video-item.always-show-controls .play-pause-btn,
  .shorts-detail-page .video-item.always-show-controls .skip-btn,
  .shorts-detail-page .video-item.always-show-controls .volume-btn {
    background: transparent !important;
    color: #111827 !important;
    box-shadow: none !important;
    border: none !important;
    backdrop-filter: none !important;
  }

  .shorts-detail-page .video-item.always-show-controls .play-pause-btn {
    width: 64px !important;
    height: 64px !important;
  }

  .shorts-detail-page .video-item.always-show-controls .skip-btn {
    width: 52px !important;
    height: 52px !important;
    gap: 0 !important;
    flex-direction: row !important;
    font-size: 1rem !important;
    opacity: 1 !important;
  }

  .shorts-detail-page .video-item.always-show-controls .volume-control {
    position: absolute !important;
    left: 50% !important;
    top: calc(50% + 38px) !important;
    transform: translate(-50%, 0) !important;
    width: auto !important;
    gap: 0 !important;
    order: 0 !important;
    flex-basis: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .shorts-detail-page .video-item.always-show-controls .volume-btn {
    width: 52px !important;
    height: 52px !important;
    font-size: 0.95rem !important;
    gap: 0 !important;
  }

  .shorts-detail-page .video-item.always-show-controls .control-label-text,
  .shorts-detail-page .video-item.always-show-controls .volume-btn::after {
    display: none !important;
  }

  .shorts-detail-page .video-item.always-show-controls:hover .control-bar,
  .shorts-detail-page .video-item.always-show-controls.show-controls .control-bar {
    opacity: 1 !important;
    pointer-events: all !important;
  }

  .shorts-detail-page .banner-ad-container {
    top: calc(var(--detail-video-top-offset) + var(--detail-video-height) + var(--detail-banner-gap)) !important;
    bottom: auto !important;
    width: var(--detail-video-width) !important;
    max-width: 360px !important;
    min-height: 50px !important;
    background: #000 !important;
    border-top: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .shorts-detail-page #gam-banner-slot {
    width: 100% !important;
    min-width: 300px !important;
    min-height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .shorts-detail-page .close-btn {
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  }

  .shorts-detail-page .search-toggle {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.08);
    color: #111827;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  }
}


/* Search Interface */
.search-interface {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: 90%;
  max-width: 400px;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: none; /* Hidden by default */
  align-items: center;
  padding: 0 16px;
  transition: all 0.3s ease;
}

.search-input-wrapper.active {
  display: flex;
}

.search-icon {
  color: rgba(255, 255, 255, 0.6);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1rem;
  padding: 12px 0;
  font-family: inherit;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.clear-search {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.clear-search:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.search-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(42, 42, 42, 0.8);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.search-toggle:hover {
  background: rgba(59, 130, 246, 0.9);
  border-color: #3b82f6;
  transform: scale(1.05);
}

.search-toggle.active {
  background: rgba(59, 130, 246, 0.9);
  border-color: #3b82f6;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
  flex-shrink: 0;
}

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

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-creator {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.search-result-title {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.6);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .search-interface {
    width: 95%;
    top: 15px;
  }
  
  .search-toggle {
    width: 45px;
    height: 45px;
  }
  
  .search-input {
    font-size: 0.9rem;
    padding: 10px 0;
  }
  
  .search-results {
    max-height: 250px;
  }
  
  .search-result-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
}

/* Gift Modal Styles */
.gift-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.gift-overlay.show {
  opacity: 1;
  visibility: visible;
}

.gift-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  max-height: 85vh;
  min-height: 400px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 2001;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gift-modal.show {
  transform: translateY(0);
}

.gift-modal-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* Important for flex child with overflow */
}

.gift-modal-footer {
  flex-shrink: 0;
  padding: 20px;
  background: #fff;
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.gift-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.gift-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}

.gift-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.gift-close:hover {
  background: #f0f0f0;
}

.gift-balance-container {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  margin: 15px 20px;
  border-radius: 10px;
}

.gift-balance-icon {
  font-size: 20px;
  margin-right: 12px;
}

.gift-balance-info {
  flex: 1;
}

.gift-balance-text {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.gift-wallet-type {
  font-size: 12px;
  color: #666;
}

.gift-catalog {
  padding: 20px;
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scrollbar-width: none;
}

.gift-catalog::-webkit-scrollbar {
  display: none;
}

.gift-loading {
  text-align: center;
  color: #666;
  padding: 20px;
  width: 100%;
}

.gift-item {
  min-width: 100px;
  padding: 15px;
  border: 2px solid #eee;
  border-radius: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
}

.gift-item:hover {
  border-color: #FF6B6B;
  background: #fff5f5;
}

.gift-item.selected {
  border-color: #FF6B6B;
  background: #fff5f5;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.gift-emoji {
  font-size: 40px;
  margin-bottom: 8px;
}

.gift-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.gift-price {
  font-size: 12px;
  color: #666;
}

.gift-quantity-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  margin-bottom: 15px;
}

.gift-quantity-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.gift-quantity-selector {
  display: flex;
  align-items: center;
  gap: 15px;
}

.gift-quantity-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #FF6B6B;
  background: #fff;
  color: #FF6B6B;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gift-quantity-btn:hover {
  background: #FF6B6B;
  color: #fff;
}

.gift-quantity-value {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  min-width: 40px;
  text-align: center;
}

.gift-total-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  margin: 0 20px 20px;
  border-radius: 10px;
}

.gift-total-label {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.gift-total-value {
  font-size: 22px;
  font-weight: 700;
  color: #4CAF50;
}

.gift-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FF6B6B;
  color: #fff;
  border: none;
  padding: 15px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  width: 100%;
  min-height: 50px;
}

.gift-send-btn:hover:not(:disabled) {
  background: #ff5252;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.gift-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.gift-send-icon {
  margin-right: 8px;
  font-size: 18px;
}

/* Gift Animation */
.gift-animation {
  position: fixed;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 50%);
  z-index: 3000;
  text-align: center;
  opacity: 0;
  transition: all 1s ease;
}

.gift-animation.animate {
  opacity: 1;
  transform: translate(-50%, -200px);
}

.gift-animation-emoji {
  font-size: 60px;
  margin-bottom: 8px;
  animation: giftBounce 0.6s ease infinite;
}

.gift-animation-amount {
  font-size: 24px;
  font-weight: 700;
  color: #FF6B6B;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes giftBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Mobile responsive for gift modal */
@media (max-width: 768px) {
  .gift-modal {
    max-height: 85vh;
  }
  
  .gift-catalog {
    padding: 15px;
    gap: 12px;
  }
  
  .gift-item {
    min-width: 90px;
    padding: 12px;
  }
  
  .gift-emoji {
    font-size: 36px;
  }
  
  .gift-quantity-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .gift-quantity-value {
    font-size: 20px;
  }
}

/* Single video detail layout */
.video-item.always-show-controls .video-info {
  left: 16px;
  right: 84px;
  bottom: 92px;
  max-width: calc(100% - 100px);
  padding: 0;
}

.video-item.always-show-controls .creator-info {
  margin-bottom: 8px;
}

.video-item.always-show-controls .video-title,
.video-item.always-show-controls .video-description,
.video-item.always-show-controls .creator-stats,
.video-item.always-show-controls .creator-name {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.video-item.always-show-controls .video-title {
  font-size: 1rem;
  margin-bottom: 6px;
}

.video-item.always-show-controls .video-description {
  color: rgba(255, 255, 255, 0.82);
  max-width: 100%;
  line-height: 1.35;
}

.video-item.always-show-controls .action-buttons {
  right: 14px;
  bottom: 92px;
  gap: 14px;
}

.video-item.always-show-controls .custom-controls {
  inset: 0;
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  border: none;
  opacity: 1;
  pointer-events: none;
}

.video-item.always-show-controls .progress-bar-container {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 8px;
  height: 4px;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 28;
  pointer-events: all;
}

.video-item.always-show-controls .progress-bar {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.video-item.always-show-controls .control-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  gap: 14px;
  z-index: 28;
  pointer-events: all;
}

.video-item.always-show-controls .play-pause-btn {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.video-item.always-show-controls .skip-btn {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.video-item.always-show-controls .time-display {
  position: absolute;
  right: 16px;
  bottom: 68px;
  min-width: 88px;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-align: right;
  z-index: 28;
  display: none;
}

.video-item.always-show-controls .volume-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: auto;
}

.video-item.always-show-controls .volume-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.video-item.always-show-controls .volume-slider {
  display: none;
}

.video-item.always-show-controls .volume-slider-fill {
  background: rgba(255, 255, 255, 0.95);
}

.shorts-container.has-banner-ad .video-item.always-show-controls .video-info {
  bottom: 118px;
}

.shorts-container.has-banner-ad .video-item.always-show-controls .action-buttons {
  bottom: 118px;
}

.shorts-container.has-banner-ad .video-item.always-show-controls .progress-bar-container {
  bottom: 8px;
}

.shorts-container.has-banner-ad .video-item.always-show-controls .time-display {
  bottom: 70px;
}

@media (hover: hover) and (pointer: fine) {
  .video-item.always-show-controls .custom-controls {
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .video-item.always-show-controls.show-controls .custom-controls {
    opacity: 1;
    pointer-events: none;
  }

  .video-item.always-show-controls.show-controls .control-bar,
  .video-item.always-show-controls.show-controls .progress-bar-container,
  .video-item.always-show-controls.show-controls .time-display {
    pointer-events: all;
  }
}

@media (min-width: 768px) {
  .video-item.always-show-controls .video-info {
    left: 50%;
    right: auto;
    bottom: 98px;
    width: min(312px, calc(100% - 188px));
    max-width: none;
    padding: 0 58px 0 10px;
    transform: translateX(-50%);
  }

  .video-item.always-show-controls .creator-info,
  .video-item.always-show-controls .video-title,
  .video-item.always-show-controls .video-description {
    max-width: 100%;
  }

  .video-item.always-show-controls .action-buttons {
    right: calc(50% - 156px + 10px);
    bottom: 98px;
    gap: 12px;
  }

  .video-item.always-show-controls .progress-bar-container {
    left: 50%;
    right: auto;
    width: min(312px, calc(100% - 188px));
    transform: translateX(-50%);
  }

  .shorts-container.has-banner-ad .video-item.always-show-controls .video-info {
    bottom: 122px;
  }

  .shorts-container.has-banner-ad .video-item.always-show-controls .action-buttons {
    bottom: 122px;
  }
}

@media (max-width: 767px) {
  .video-item.always-show-controls .video-info {
    left: 14px;
    right: 74px;
    bottom: 96px;
    max-width: calc(100% - 88px);
  }

  .video-item.always-show-controls .action-buttons {
    right: 12px;
    bottom: 96px;
    gap: 12px;
  }

  .video-item.always-show-controls .custom-controls {
    opacity: 1;
    pointer-events: none;
  }

  .video-item.always-show-controls .control-bar {
    gap: 10px;
  }

  .video-item.always-show-controls .play-pause-btn {
    width: 62px;
    height: 62px;
  }

  .video-item.always-show-controls .skip-btn {
    width: 44px;
    height: 44px;
  }

  .video-item.always-show-controls .time-display {
    font-size: 0.76rem;
    min-width: 76px;
    right: 14px;
    bottom: 66px;
  }

  .video-item.always-show-controls .volume-control {
    gap: 0;
  }

  .shorts-container.has-banner-ad .video-item.always-show-controls .video-info {
    bottom: 124px;
  }

  .shorts-container.has-banner-ad .video-item.always-show-controls .action-buttons {
    bottom: 116px;
  }

  .shorts-container.has-banner-ad .video-item.always-show-controls .progress-bar-container {
    bottom: 8px;
  }
}

body.shorts-detail-page .video-item.always-show-controls .custom-controls {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

body.shorts-detail-page .video-item.always-show-controls .control-bar,
body.shorts-detail-page .video-item.always-show-controls .volume-control,
body.shorts-detail-page .video-item.always-show-controls .progress-bar-container {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

body.shorts-detail-page .video-item.always-show-controls.show-controls .custom-controls {
  opacity: 1;
  pointer-events: none;
}

body.shorts-detail-page .video-item.always-show-controls.show-controls .control-bar,
body.shorts-detail-page .video-item.always-show-controls.show-controls .volume-control,
body.shorts-detail-page .video-item.always-show-controls.show-controls .progress-bar-container {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 767px) {
  body.shorts-detail-page .video-item.always-show-controls .progress-bar-container {
    opacity: 1;
    pointer-events: all;
  }
}

@media (hover: hover) and (pointer: fine) {
  body.shorts-detail-page .video-item.always-show-controls:hover .custom-controls,
  body.shorts-detail-page .video-item.always-show-controls:hover .control-bar,
  body.shorts-detail-page .video-item.always-show-controls:hover .volume-control,
  body.shorts-detail-page .video-item.always-show-controls:hover .progress-bar-container {
    opacity: 1;
    pointer-events: all;
  }
}
