/* ========================================
   MEDIA PAGE - MODERN STYLE
   Matches styles from Index/Roster/Squadrons
   ======================================== */

:root {
    --bandits-bg-1: #0f172e;
    --bandits-bg-2: #1a1f3a;
    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
}

/* --- Media Section Layout --- */
.media-section {
    padding: 80px 0 120px;
    background: linear-gradient(135deg, var(--bandits-bg-1) 0%, var(--bandits-bg-2) 50%, var(--bandits-bg-1) 100%);
    min-height: 80vh;
    position: relative;
    overflow: hidden;
}

/* Background decoration similar to Roster/Squadrons */
.media-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Header Styling */
.section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.section-title {
    font-family: 'Horizon', sans-serif;
    font-size: 2.5rem; /* Adjusted to match Roster (~40px) */
    color: #fff;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 25px rgba(96, 165, 250, 0.2);
    display: inline-block;
    letter-spacing: 2px;
}

.section-line {
    display: none; /* Removed in modern style or replaced by something else */
}

.section-subtitle {
    font-family: 'Oswald', sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Filters --- */
.media-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.filter-btn {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 10px 30px;
    font-family: 'Horizon', sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-radius: 4px;
}

.filter-btn:hover {
    border-color: rgba(96, 165, 250, 0.5);
    color: #fff;
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4);
}

/* --- Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 2;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.6); /* Glassmorphism base */
    aspect-ratio: 16/9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05); /* Subtle border */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border-color: rgba(96, 165, 250, 0.3);
    z-index: 10;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    /* Protection */
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.1);
}

/* --- Overlay & Badge --- */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 46, 0.95) 0%, rgba(15, 23, 46, 0.4) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 25px;
    pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.author-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--accent-blue);
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.gallery-item:hover .author-badge {
    transform: translateY(0);
}

.author-badge img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
}

.author-badge span {
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.author-badge strong {
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Hero Override --- */
.roster-hero {
    height: 50vh;
    min-height: 400px;
}

/* --- Loading Spinner --- */
.loading-spinner {
    grid-column: 1/-1;
    width: 50px;
    height: 50px;
    margin: 60px auto;
    border: 4px solid rgba(96, 165, 250, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-blue);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Lightbox --- */
.lightbox {
    position: fixed;
    z-index: 99999;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    will-change: opacity;
}

.lightbox.active {
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    user-select: none;
    transform: translateZ(0);
    will-change: transform;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: sans-serif;
    font-weight: 100;
    opacity: 0.7;
}

.lightbox-close:hover {
    color: var(--accent-blue);
    opacity: 1;
    transform: rotate(90deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .media-filters {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .filter-btn {
        width: 100%;
        text-align: center;
    }
}


/* --- Pagination Controls (Styled) --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 60px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}

.pagination-btn {
    background: rgba(15, 23, 46, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    min-width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    user-select: none;
    text-transform: uppercase;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(96, 165, 250, 0.15);
    border-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.25);
    transform: translateY(-2px);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #0f172e;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(0,0,0,0.2);
    border-color: transparent;
}

/* Specific Arrow Styling */
.pagination-btn.prev-btn, 
.pagination-btn.next-btn {
    font-family: 'Horizon', sans-serif;
    font-size: 0.65rem; /* Horizon is naturally large */
    letter-spacing: 2px;
    padding: 0 24px;
    width: auto;
    border-radius: 30px; /* Pill shape for navigation */
}

.pagination-info {
    font-family: 'Oswald', sans-serif !important;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    margin: 0 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
