/* Media Viewer Styles */

/* =====================
   UPLOAD PREVIEW AREA
   ===================== */
#media-preview-area {
    animation: fade-in 0.2s ease-out;
}

#media-preview-grid {
    min-height: 80px;
}

#media-preview-grid > div {
    animation: scale-in 0.2s ease-out;
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =====================
   LIGHTBOX
   ===================== */
#media-lightbox {
    backdrop-filter: blur(4px);
}

#media-lightbox img {
    animation: lightbox-fade-in 0.2s ease-out;
}

@keyframes lightbox-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =====================
   VIDEO PLAYER
   ===================== */
.post-video-container {
    background: #000;
}

.post-video-container video {
    width: 100%;
    height: 100%;
}

.post-video-container.playing .video-overlay {
    opacity: 0 !important;
    pointer-events: none;
}

.post-video-container:not(.playing):hover .video-overlay {
    opacity: 1;
}

.video-progress {
    transition: height 0.1s ease;
}

.video-progress:hover {
    height: 6px;
}

.video-progress-fill {
    transition: width 0.1s linear;
}

/* Fullscreen video */
.post-video-container:fullscreen {
    background: #000;
}

.post-video-container:fullscreen video {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

.post-video-container:fullscreen .video-controls {
    opacity: 1;
}

/* =====================
   MEDIA GALLERY
   ===================== */
.post-media-gallery {
    max-width: 100%;
}

.post-media-gallery .gallery-image {
    transition: transform 0.3s ease;
}

.post-media-gallery .gallery-image:hover {
    z-index: 10;
}

/* Single image should have max height */
.post-media-gallery:not(.grid) img {
    max-height: 400px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    display: block;
}

/* Responsive video aspect ratio */
.aspect-video {
    aspect-ratio: 16 / 9;
}

/* Image aspect ratio for galleries */
.aspect-square {
    aspect-ratio: 1 / 1;
}
