/* Exclusive Content Styles - Migrated from feed.css */

/* NSFW Content Visibility Controls */
.nsfw-hidden {
  display: none !important;
}

.nsfw-sliding {
  display: block !important;
  opacity: 1;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  transform: translateY(0);
  animation: slideDown 0.3s ease-in-out;
  animation-fill-mode: both;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.nsfw-sliding-out {
  display: block !important;
  animation: slideUp 0.3s ease-in-out both;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
}

/* Base state - visually hidden but animation-ready */
.post-exclusive-section:not(.nsfw-sliding):not(.nsfw-sliding-out) {
  display: none;
}

.post-exclusive-section {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  margin-top: 0;
  /* Start with hidden state but allow animations to override */
  padding: 1.5rem;
  overflow: hidden;
}

/* Post Actions Grid (replaces first video) */
.post-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  aspect-ratio: 16/9;
  justify-content: center;
  align-items: center;
  max-width: 200px;
  margin: 0 auto;
  height: 100%;
}

/* When only one button (no videos), center it and make it larger */
.post-actions-grid:has(.btn:only-child) {
  justify-content: center;
}

.post-actions-grid:has(.btn:only-child) .btn {
  flex: none;
  min-height: 60px;
  padding: 1.5rem 1.8rem;
  font-size: 1rem;
}

.post-actions-grid .btn {
  font-size: 1.1rem;
  padding: 1rem 1.2rem;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  width: 100%;
  flex: 1;
}

.post-actions-grid .btn-icon {
  width: 24px;
  height: 24px;
}

.post-actions-grid .btn span {
  font-size: 1rem;
  font-weight: 500;
}

/* Modern Grid Layout - 8 items */
.post-videos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0;
}

/* Video Grid Styles - Consolidated */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.post-video-thumbnail,
.video-thumbnail,
.media-thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--primary-color-darkest);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Remove cursor pointer from image thumbnails since they're not clickable */
.image-thumbnail {
  cursor: default;
}

.video-thumbnail {
  width: 100%;
}

.post-video-thumbnail:hover,
.video-thumbnail:hover,
.media-thumbnail:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.post-video-thumbnail img,
.post-video-thumbnail video,
.video-thumbnail img,
.video-thumbnail video,
.media-thumbnail img,
.media-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.post-video-thumbnail .play-icon,
.video-thumbnail .play-icon,
.media-thumbnail .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  padding-left: 4px;
  transition: all 0.3s ease;
}

.post-video-thumbnail:hover .play-icon,
.video-thumbnail:hover .play-icon,
.media-thumbnail:hover .play-icon {
  background: rgba(255, 255, 255, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

.post-video-thumbnail .duration,
.video-thumbnail .duration,
.media-thumbnail .duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--gray-1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.post-video-thumbnail .nsfw-badge,
.video-thumbnail .nsfw-badge,
.media-thumbnail .nsfw-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--gray-1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

/* Video actions styling - Vertical stacked layout */
.post-video-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0 1rem;
}

.post-video-actions-buttons {
  width: 100%;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  order: 1;
}

.post-video-actions-ad {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  /* min-height: 120px; collapse when no ad is present */
  order: 2;
  overflow: visible; /* Allow content to be fully visible */
}

/* Loading state for post-video-actions-ad */
.post-video-actions-ad:empty::after {
  content: 'Loading Ad...';
  color: #856404;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Collapsed state - when ad definitively fails */
.post-video-actions-ad.ad-failed {
  min-height: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

/* Loaded state - when ad successfully loads */
.post-video-actions-ad.ad-loaded {
  min-height: 0;
  height: auto;
}

/* Ensure CrakRevenue ads take full width within post-video-actions-ad */
.post-video-actions-ad .crakrevenue-container {
  width: 100%;
  max-width: 100%;
}

.post-video-actions-ad .crakrevenue-ad {
  width: 100%;
}

.post-video-actions-ad ins {
  width: 100%;
  height: auto;
  display: block;
}

/* CrakRevenue container order - should appear between ExoClick ads (order: 2) and buttons (order: 1) */
.crakrevenue-container {
  order: 1.5;
}

.view-all-btn,
.randomize-btn {
  /* Remove custom styles to use base.css btn-primary and btn-secondary */
}

.btn-icon {
  font-size: 0.7rem;
}

/* Grid Video Player Styles */
.grid-video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Exclusive Content Section - Merged with feed-post container */
.post-exclusive-section h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.post-exclusive-section p {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Exclusive Content Grid */
.exclusive-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.exclusive-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--primary-color-darkest);
}

.exclusive-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.exclusive-thumbnail img,
.exclusive-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exclusive-thumbnail .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding-left: 2px;
  transition: all 0.3s ease;
}

.exclusive-thumbnail:hover .play-icon {
  background: rgba(255, 255, 255, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

.exclusive-thumbnail .duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--gray-1);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
}

.exclusive-thumbnail .title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: var(--gray-1);
  padding: 20px 8px 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  background: var(--card-background);
}

/* Responsive Design */
@media (max-width: 768px) {
  .post-videos-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-actions-grid {
    max-width: none;
  }

  .post-video-actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .post-video-actions-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto; /* Allow container to collapse when empty on mobile too */
  }

  .post-video-actions-buttons {
    justify-content: center;
  }

  .videos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .post-videos-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-video-thumbnail .play-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .post-actions-grid {
    padding: 0.75rem;
  }

  .post-actions-grid:has(.btn:only-child) .btn {
    padding: 1rem 1.2rem;
    font-size: 0.9rem;
  }

  .post-actions-grid .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .post-actions-grid .btn-icon {
    width: 20px;
    height: 20px;
  }

  .post-actions-grid .btn span {
    font-size: 0.9rem;
  }

  .videos-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1200px) {
  .post-videos-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .post-video-actions {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .view-all-btn,
  .randomize-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}