/* 
   Media Gallery - Luma Aerials Portal
   Premium gallery with geometric accents — v3.0
*/

/* ============ MEDIA PAGE CONTAINER ============ */
#media-plane {
    background: var(--bg-background, #050505);
    overflow-y: auto;
    position: relative;
}

/* Subtle geometric grid pattern on background */
#media-plane::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.media-gallery {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 48px 80px;
    display: flex;
    flex-direction: column;
    gap: 56px;
}

/* ============ PAGE HEADER (above sections) ============ */
.media-container {
    display: flex;
    flex-direction: column;
    gap: 56px;
}

/* ============ SECTION CARDS ============ */
.media-section {
    position: relative;
    background: rgba(18, 18, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
}

/* Corner geometric accent — top-right */
.media-section::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 80px;
    height: 80px;
    border-right: 2px solid var(--accent, #E5DDD3);
    border-top: 2px solid var(--accent, #E5DDD3);
    border-radius: 0 20px 0 0;
    opacity: 0.4;
    pointer-events: none;
}

/* Corner geometric accent — bottom-left */
.media-section::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 60px;
    height: 60px;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 0 20px;
    pointer-events: none;
}

/* ============ SECTION LABELS ============ */
.section-label {
    font-family: 'Outfit', var(--font-sans, 'Inter', sans-serif);
    font-size: 22px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Decorative line under label */
.section-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
            var(--accent, #E5DDD3) 0%,
            var(--accent, #E5DDD3) 60px,
            rgba(255, 255, 255, 0.06) 60px,
            rgba(255, 255, 255, 0.06) 100%);
}

/* Small geometric diamond before label */
.section-label::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--accent, #E5DDD3);
    transform: rotate(45deg);
    flex-shrink: 0;
    opacity: 0.8;
}

/* ============ ITEM COUNT BADGES ============ */
/* Add via JS or use CSS counter — shows total items */

/* ============ VIDEO GRID ============ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    min-height: 100px;
}

.video-grid:empty::after {
    content: "No videos available";
    color: rgba(255, 255, 255, 0.15);
    font-family: 'Outfit', var(--font-sans, sans-serif);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

@media (max-width: 800px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* ============ IMAGE GRID ============ */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    min-height: 80px;
}

.image-grid:empty::after {
    content: "No images available";
    color: rgba(255, 255, 255, 0.15);
    font-family: 'Outfit', var(--font-sans, sans-serif);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

/* ============ MEDIA CARDS ============ */
.media-card {
    position: relative;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.media-card:hover {
    border-color: rgba(229, 221, 211, 0.3);
    transform: translateY(-4px);
    box-shadow:
        0 20px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(229, 221, 211, 0.15),
        0 0 30px -10px rgba(229, 221, 211, 0.1);
}

.media-card img,
.media-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.3s ease;
}

.media-card:hover img,
.media-card:hover video {
    transform: scale(1.08);
    filter: brightness(1.1);
}

/* Video cards - cinematic 16:9 */
.video-grid .media-card {
    aspect-ratio: 16/9;
}

/* Image cards - square */
.image-grid .media-card {
    aspect-ratio: 1;
}

/* Thin accent line at bottom of each card */
.media-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent, #E5DDD3);
    z-index: 3;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.media-card:hover::before {
    opacity: 1;
    left: 10%;
    right: 10%;
}

/* Play icon for videos */
.media-card .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    width: 56px;
    height: 56px;
    background: rgba(229, 221, 211, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 24px rgba(229, 221, 211, 0.35);
}

.media-card:hover .play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.media-card .play-icon .material-symbols-outlined {
    font-size: 26px;
    color: #000;
    margin-left: 3px;
}

/* Gradient overlay on video cards */
.video-grid .media-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-grid .media-card:hover::after {
    opacity: 1;
}

/* ============ VIDEO PLAYER OVERLAY ============ */
.video-player-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(16px);
}

.video-player-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.player-container {
    width: 100%;
    max-width: 960px;
}

.player-container video {
    width: 100%;
    border-radius: 14px;
    background: #000;
    box-shadow: 0 24px 80px -16px rgba(0, 0, 0, 0.8);
}

.player-container .video-title {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 20px;
    font-family: 'Outfit', var(--font-sans, sans-serif);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
}

.close-player {
    position: absolute;
    top: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.close-player:hover {
    background: var(--accent, #f97316);
    border-color: var(--accent, #f97316);
    color: #000;
    transform: rotate(90deg);
}

/* ============ IMAGE LIGHTBOX ============ */
.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.97);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(16px);
}

.image-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.image-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 14px;
    box-shadow: 0 24px 80px -16px rgba(0, 0, 0, 0.8);
}

/* ============ CARD OVERLAY & TITLE ============ */
/* Gradient overlay at bottom of each card — generated by JS */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-card:hover .card-overlay {
    opacity: 1;
}

/* Title text inside the card overlay */
.card-title {
    position: absolute;
    bottom: 10px;
    left: 12px;
    right: 12px;
    z-index: 3;
    font-family: 'Outfit', var(--font-sans, sans-serif);
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-card:hover .card-title {
    opacity: 1;
}

/* ============ DECORATIVE ELEMENTS ============ */
/* Floating geometric cross-hair accent (purely decorative) */
.media-gallery::before {
    content: '+';
    position: absolute;
    top: 90px;
    right: 48px;
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 200;
    color: rgba(255, 255, 255, 0.06);
    letter-spacing: 0;
    pointer-events: none;
}

/* Thin vertical accent line on left edge */
.media-gallery::after {
    content: '';
    position: absolute;
    top: 120px;
    left: 20px;
    width: 1px;
    height: 120px;
    background: linear-gradient(to bottom, var(--accent, #f97316), transparent);
    opacity: 0.2;
    pointer-events: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .media-gallery {
        padding: 100px 20px 40px;
        gap: 32px;
    }

    .media-section {
        padding: 24px;
        border-radius: 14px;
    }

    .section-label {
        font-size: 16px;
        letter-spacing: 3px;
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .media-card {
        border-radius: 10px;
    }

    .media-section::before {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .media-gallery {
        padding: 90px 12px 24px;
    }

    .section-label {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .image-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .media-card {
        border-radius: 8px;
    }
}