/* ========================================
   Media Gallery Page - Shared Styles with Video Support
   ======================================== */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: var(--secondary-white);
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path fill="%231a7a4f" d="M0 0v46.29c47.79 22.2 103.59 32.17 158 28 70.36-5.37 136.33-33.31 206.8-37.5 73.84-4.36 147.54 16.88 218.2 35.26 69.27 18 138.3 24.88 209.4 13.08 36.15-6 69.85-17.84 104.45-29.34C989.49 25 1113-14.29 1200 52.47V0z" opacity=".25"/></svg>');
    background-size: cover;
    opacity: 0.3;
}

.page-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.page-subtitle {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
    opacity: 0.95;
}

.page-breadcrumb {
    font-size: 1rem;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.page-breadcrumb a {
    color: var(--accent-color);
    text-decoration: underline;
    transition: var(--transition-normal);
}

.page-breadcrumb a:hover {
    color: var(--secondary-white);
}

/* Back Button Section */
.back-button-section {
    padding: var(--spacing-md) 0;
    background-color: #f8f9fa;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 10px 24px;
    background-color: var(--primary-green);
    color: var(--secondary-white);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.back-btn:hover {
    background-color: var(--accent-color);
    color: var(--text-primary);
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
}

.back-arrow {
    transition: var(--transition-normal);
}

.back-btn:hover .back-arrow {
    transform: translateX(-5px);
}

/* Gallery Section */
.gallery-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--secondary-white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition-normal);
    background-color: #f0f0f0;
    aspect-ratio: 4 / 3;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Gallery Image */
.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
    display: block;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

/* Gallery Video */
.gallery-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
    display: block;
}

.gallery-item:hover .gallery-video {
    transform: scale(1.05);
}

/* Video Play Icon Overlay */
.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.gallery-item:hover .video-play-icon {
    opacity: 0;
}

/* Video Badge */
.gallery-item[data-type="video"]::after {
    content: 'VIDEO';
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(22, 94, 63, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Lightbox Overlay */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#lightboxContent {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.lightbox-video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

/* Lightbox Controls */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: transparent;
    color: var(--secondary-white);
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    transition: var(--transition-normal);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-close:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(22, 94, 63, 0.8);
    color: var(--secondary-white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
    z-index: 10001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: var(--primary-green);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--secondary-white);
    font-size: 1rem;
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 10001;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.empty-state svg {
    color: var(--primary-green);
    opacity: 0.3;
    margin-bottom: var(--spacing-md);
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    margin-bottom: var(--spacing-xs);
}

.empty-state code {
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--primary-green);
}

/* Partners Section */
.partners-section {
    background-color: #f8f9fa;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-title {
        font-size: 3.5rem;
    }
    
    .lightbox-prev {
        left: 30px;
    }
    
    .lightbox-next {
        right: 30px;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .page-title {
        font-size: 4rem;
    }
}

@media (max-width: 767px) {
    .page-title {
        font-size: 2.5rem;
    }
    
    .gallery-item {
        aspect-ratio: 1 / 1;
    }
    
    .lightbox-prev {
        left: 10px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-next {
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    
    .lightbox-counter {
        bottom: 10px;
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    .lightbox-video {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .video-play-icon svg {
        width: 48px;
        height: 48px;
    }
    
    .gallery-item[data-type="video"]::after {
        font-size: 0.65rem;
        padding: 3px 8px;
        top: 8px;
        right: 8px;
    }
}

/* Loading State (Optional) */
.gallery-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Smooth Transitions */
.gallery-item,
.gallery-image,
.gallery-video,
.video-play-icon {
    transition: all 0.3s ease;
}

/* Focus Styles for Accessibility */
.back-btn:focus,
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .back-button-section,
    .lightbox-overlay,
    .video-play-icon,
    .partners-section {
        display: none;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gallery-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}