/**
 * media-galleries.css - Media Albums & Galleries Styles
 * =============================================================================
 * Responsive styles for photo galleries, video players, audio playlists
 * @version 1.0.0
 * @date 2025-11-25
 * =============================================================================
 */

/* =============================================================================
   ALBUM CARDS (albums.php)
   ============================================================================= */

.media-albums-grid {
    --album-card-transition: all 0.3s ease;
}

.album-card {
    transition: var(--album-card-transition);
    border: 1px solid rgba(0,0,0,0.1);
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,0.15) !important;
}

.album-cover-wrapper {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.album-cover {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-card:hover .album-cover {
    transform: scale(1.05);
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* =============================================================================
   PHOTO GALLERY (album.php - photo type)
   ============================================================================= */

.photo-gallery {
    margin-bottom: 2rem;
}

.photo-item {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
}

.photo-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 0.375rem;
    background: #f8f9fa;
}

.photo-wrapper img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.photo-item:hover .photo-wrapper img {
    transform: scale(1.1);
    opacity: 0.85;
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 1rem 0.75rem 0.5rem;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-item:hover .photo-caption {
    opacity: 1;
}

/* Responsive grid adjustments */
@media (min-width: 576px) {
    .photo-wrapper img {
        height: 200px;
    }
}

@media (min-width: 768px) {
    .photo-wrapper img {
        height: 220px;
    }
}

@media (min-width: 992px) {
    .photo-wrapper img {
        height: 240px;
    }
}

/* =============================================================================
   VIDEO PLAYLIST (album.php - video type)
   ============================================================================= */

.video-playlist {
    margin-bottom: 2rem;
}

#video-player-container {
    background: #000;
    border-radius: 0.5rem;
}

#video-player-container video,
#video-player-container iframe {
    border-radius: 0.5rem;
}

.playlist-sidebar {
    max-height: 600px;
    overflow-y: auto;
}

.playlist-sidebar::-webkit-scrollbar {
    width: 6px;
}

.playlist-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.playlist-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.playlist-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.playlist-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.playlist-item:hover:not(.active) {
    background-color: #f8f9fa;
}

.playlist-item.active {
    background-color: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
}

.playlist-item.active .text-muted {
    color: rgba(255,255,255,0.7) !important;
}

/* =============================================================================
   AUDIO PLAYLIST (album.php - audio type)
   ============================================================================= */

.audio-playlist {
    margin-bottom: 2rem;
}

.audio-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.audio-play-btn i {
    font-size: 1.2rem;
}

#audio-player {
    position: sticky;
    bottom: 20px;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#audio-element {
    border-radius: 0.375rem;
}

/* =============================================================================
   RESPONSIVE VIDEO CONTAINER (16:9 aspect ratio)
   ============================================================================= */

.video-container {
    position: relative;
    width: 100%;
}

.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

/* Album type badge colors */
.badge.bg-primary {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
}

/* Card spacing */
.card-footer {
    padding: 0.75rem 1rem;
}

/* Empty state */
.alert-info {
    border-left: 4px solid var(--bs-info);
}

/* =============================================================================
   LIGHTBOX BASIC STYLES (for future PhotoSwipe integration)
   ============================================================================= */

.photo-item::after {
    content: '\F52A'; /* Bootstrap icon zoom-in */
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.photo-item:hover::after {
    opacity: 0.8;
}

/* =============================================================================
   MOBILE OPTIMIZATIONS
   ============================================================================= */

@media (max-width: 575.98px) {
    /* Larger touch targets on mobile */
    .album-card .btn {
        padding: 0.5rem 1rem;
    }
    
    /* Playlist sidebar full width on mobile */
    .playlist-sidebar {
        max-height: none;
        margin-top: 2rem;
    }
    
    /* Photo grid single column on small screens */
    .photo-gallery .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .photo-wrapper img {
        height: 280px;
    }
}

/* =============================================================================
   DARK MODE SUPPORT (optional, based on data-bs-theme)
   ============================================================================= */

[data-bs-theme="dark"] .album-card {
    border-color: rgba(255,255,255,0.1);
    background-color: #1a1d20;
}

[data-bs-theme="dark"] .album-cover-wrapper {
    background: #2c3034;
}

[data-bs-theme="dark"] .photo-wrapper {
    background: #2c3034;
}

[data-bs-theme="dark"] .playlist-sidebar::-webkit-scrollbar-track {
    background: #2c3034;
}

[data-bs-theme="dark"] .playlist-sidebar::-webkit-scrollbar-thumb {
    background: #555;
}

[data-bs-theme="dark"] #video-player-container {
    background: #000;
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    .photo-gallery {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .photo-wrapper img {
        height: auto;
    }
    
    .video-playlist,
    .audio-playlist,
    .playlist-sidebar,
    #audio-player {
        display: none;
    }
}
