/* Optimized Gallery Styles */
.gallery-section {
    padding: var(--spacing-4xl) 0;
    background: linear-gradient(135deg,
        rgba(20, 18, 12, 0.98) 0%,
        rgba(25, 22, 15, 0.95) 50%,
        rgba(18, 16, 10, 0.98) 100%);
    position: relative;
}

.gallery-container {
    max-width: var(--container-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.gallery-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.gallery-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    color: var(--white);
    margin-bottom: var(--spacing-lg);
}

.gallery-icon {
    font-size: 1.2em;
    margin-right: var(--spacing-sm);
}

.gallery-description {
    font-size: var(--font-size-lg);
    color: var(--gray);
    max-width: min(800px, 90vw);
    margin: 0 auto;
    line-height: 1.8;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-3xl);
}

.gallery-filter-btn {
    padding: var(--spacing-sm) var(--spacing-xl);
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--yellow);
    border-radius: 50px;
    color: var(--yellow);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-filter-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.gallery-filter-btn.active {
    background: var(--yellow);
    color: var(--black);
    box-shadow: 0 5px 25px rgba(255, 215, 0, 0.5);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-3xl);
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 9/16; /* Vertical aspect ratio */
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    border-color: var(--yellow);
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.1), 
        rgba(255, 165, 0, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.video-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.play-button {
    font-size: clamp(32px, 8vw, 48px);
    color: var(--yellow);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    transition: all 0.3s ease;
    z-index: 2;
}

.gallery-item:hover .play-button {
    transform: scale(1.1);
    color: var(--yellow-light);
}

.video-overlay {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.7);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.video-category {
    font-size: var(--font-size-xs);
    color: var(--yellow);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-md);
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--white);
}

.gallery-item-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

/* Pagination */
.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-3xl);
    grid-column: 1 / -1;
}

.pagination-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid var(--yellow);
    border-radius: 8px;
    color: var(--yellow);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.pagination-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: var(--yellow);
    color: var(--black);
    box-shadow: 0 3px 15px rgba(255, 215, 0, 0.4);
}

.pagination-btn.prev-btn,
.pagination-btn.next-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.video-modal.active {
    display: flex;
}

.video-modal-content {
    position: relative;
    max-width: min(90vw, 400px);
    max-height: 90vh;
    width: min(400px, 90vw);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--yellow);
    border: none;
    width: clamp(35px, 8vw, 40px);
    height: clamp(35px, 8vw, 40px);
    border-radius: 50%;
    color: var(--black);
    font-size: clamp(18px, 5vw, 24px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.video-modal-close:hover {
    transform: rotate(90deg);
    background: var(--yellow-light);
}

.video-modal video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    border-radius: 12px;
    display: block;
    aspect-ratio: 9/16; /* Vertical aspect ratio for modal */
    object-fit: cover;
}

/* Loading states */
.gallery-item.loading {
    opacity: 0.7;
}

.gallery-item.loading .play-button {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
        gap: var(--spacing-lg);
    }
    
    .gallery-filters {
        gap: var(--spacing-sm);
        overflow-x: auto;
        padding: var(--spacing-sm) 0;
        justify-content: flex-start;
    }
    
    .gallery-filter-btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--font-size-sm);
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .video-modal-content {
        width: 95%;
        max-width: min(350px, 95vw);
        margin: var(--spacing-md);
    }
    
    .gallery-pagination {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }
    
    .pagination-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
        min-width: 35px;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        padding: 0 var(--spacing-md);
    }
    
    .gallery-title {
        font-size: var(--font-size-2xl);
    }
    
    .gallery-description {
        font-size: var(--font-size-base);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
        gap: var(--spacing-md);
    }
    
    .video-overlay {
        top: var(--spacing-xs);
        right: var(--spacing-xs);
        padding: var(--spacing-xs);
    }
    
    .video-category {
        font-size: 10px;
    }
}
