/* Gallery Styles - Glide.js Implementation */
.gallery-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 1rem;
}

/* Glide.js Gallery Styles */
.glide {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.glide * {
    box-sizing: inherit;
}

.glide__track {
    overflow: hidden;
}

/* Custom touch improvements */
.glide__track {
    cursor: grab;
}

.glide__track:active {
    cursor: grabbing;
}

.glide__slides {
    position: relative;
    width: 100%;
    list-style: none;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    touch-action: pan-Y;
    overflow: hidden;
    padding: 0;
    margin: 0;
    display: flex;
}

.glide__slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    transition: transform 0.3s ease;
}

.glide__slide--active .gallery-item {
    transform: scale(1.02);
}

/* Gallery Item Styles */
.gallery-item {
    position: relative;
    width: 280px;
    height: 350px;
    overflow: hidden;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-bounce);
    background: #111;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 20px var(--glow-gold);
    border: 1px solid var(--border-gold);
    margin: 0 auto;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-bounce);
    filter: brightness(0.9) contrast(1.1);
}

.gallery-item:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    z-index: 10;
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(1.1) contrast(1.2);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.4) 0%,
            var(--glow-gold) 50%,
            rgba(0, 0, 0, 0.2) 100%);
    opacity: 0;
    transition: var(--transition-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    pointer-events: none;
    /* Allow clicks to pass through */
}

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

/* Video Gallery Items */
.gallery-item-video {
    cursor: default;
}

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

.gallery-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-bounce);
    filter: brightness(0.9) contrast(1.1);
}

.gallery-item-video:hover video {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.2);
}

.gallery-item-video .gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.3) 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.2) 100%);
    opacity: 0;
    transition: var(--transition-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

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

.gallery-play-icon {
    font-size: 3rem;
    color: var(--primary-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.gallery-item-video:hover .gallery-play-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Video controls styling */
.gallery-video-container video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.gallery-video-container video::-webkit-media-controls-play-button {
    background-color: var(--primary-gold);
    border-radius: 50%;
}

/* Firefox video controls */
.gallery-video-container video::-moz-media-controls {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

/* Glide.js Navigation Arrows */
.glide__arrows {
    touch-action: manipulation;
}

.glide__arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    color: var(--primary-gold);
    text-transform: uppercase;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    transform: translateY(-50%);
    line-height: 1;
    font-size: 20px;
    font-weight: bold;
    outline: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glide__arrow:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Glide.js Theme Overrides */
.glide__arrow--disabled {
    opacity: 0.33 !important;
    cursor: default !important;
}

.glide__arrow--disabled:hover {
    background: rgba(0, 0, 0, 0.6) !important;
    box-shadow: none !important;
}

.glide__arrow--left {
    left: 20px;
}

.glide__arrow--right {
    right: 20px;
}

.glide__arrow:disabled {
    opacity: 0.33;
    cursor: not-allowed;
}

/* Improve focus styles for accessibility */
.glide__arrow:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

.glide__bullet:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* Glide.js Bullets/Indicators */
.glide__bullets {
    position: absolute;
    z-index: 2;
    bottom: -60px;
    left: 50%;
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    transform: translateX(-50%);
    gap: 12px;
}

.glide__bullet {
    background: rgba(255, 215, 0, 0.3);
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    padding: 0;
    transition: var(--transition-smooth);
    touch-action: manipulation;
}

.glide__bullet:hover {
    background: rgba(255, 215, 0, 0.7);
    transform: scale(1.2);
}

.glide__bullet--active {
    background: var(--primary-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transform: scale(1.3);
}

/* Loading state */
.glide.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Ensure proper spacing */
.gallery-container {
    padding-bottom: 80px;
    /* Space for bullets */
}

@media (max-width: 768px) {
    .gallery-item {
        width: 250px;
        height: 300px;
    }

    .glide__arrow {
        width: 40px;
        height: 40px;
        font-size: 16px;
        padding: 8px 12px;
    }

    .glide__arrow--left {
        left: 10px;
    }

    .glide__arrow--right {
        right: 10px;
    }

    .glide__bullets {
        bottom: -50px;
    }

    .glide__bullet {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        width: 220px;
        height: 280px;
    }

    .gallery-item:hover {
        transform: translateY(-10px) scale(1.02);
    }

    .glide__slide {
        padding: 5px;
    }

    .glide__arrows {
        display: none;
    }

    .glide__bullets {
        bottom: -40px;
        gap: 8px;
    }

    .glide__bullet {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        padding-bottom: 60px;
    }
}