/* Skeleton Loading */

/* Video Skeleton Loading */

.video-skeleton {
  position: relative;
  background: linear-gradient(90deg, 
    var(--color-background-dark) 25%, 
    var(--color-background) 50%, 
    var(--color-background-dark) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--border-radius);
  width: 100%;
  height: 300px; /* Approximate video height */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.video-skeleton::before {
  content: 'Loading video...';
  color: var(--color);
  opacity: 0.7;
  font-size: var(--size-small);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--size-medium);
}

/* Play button overlay for skeleton */
.video-skeleton::after {
  content: '>';
  position: absolute;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transform: translateX(2px); /* Center the > symbol */
}

/* Error state for skeleton */
.video-skeleton-error {
  background: linear-gradient(90deg, 
    #ff6b6b 25%, 
    #ff8787 50%, 
    #ff6b6b 75%
  );
  animation: none;
}

.video-skeleton-error::before {
  content: 'Video failed to load';
  color: white;
  opacity: 0.9;
}

.video-skeleton-error::after {
  content: '!';
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Image Skeleton Loading */
.image-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.image-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0) 100%);
    animation: skeleton-shine 2s ease-in-out infinite;
}

/* Image wrapper for skeleton loading */
.image-wrapper {
    position: relative;
    display: inline-block;
    width: auto;
    height: auto;
}

.image-wrapper img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-wrapper img.loaded {
    opacity: 1;
}

.image-wrapper .skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

/* Gallery specific skeleton styles */
.gallery .image-wrapper .skeleton {
    border-radius: var(--border-radius);
}

/* Profile specific skeleton styles */
.profile .image-wrapper .skeleton {
    border-radius: 100px;
}

/* Carousel specific skeleton styles */
.carousel .image-wrapper .skeleton {
    border-radius: var(--border-radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes skeleton-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive skeleton height */
@media (max-width: 768px) {
    .video-skeleton {
    height: 200px;
    }
  
    .video-skeleton::before {
    font-size: calc(var(--size-small) * 0.9);
    }
  
    .video-skeleton::after {
    width: 40px;
        height: 40px;
        font-size: 16px;
    }
}
