/**
 * Custom styles for Meow Lightbox
 * Place this in your theme's css directory and enqueue it properly
 */

/* Override default styles for the lightbox container */
.mwl.visible {
    /* Use !important to ensure your styles take precedence */
    background-color: rgba(0, 0, 0, 0.9) !important;
    /* Darker background */
}

/* Custom styles for the navigation buttons */
.mwl .mwl__navigation__next,
.mwl .mwl__navigation__previous {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    padding: 15px !important;
    transition: all 0.3s ease !important;
    /* Make the arrows more visible but keep the hitbox */
    z-index: 10 !important;
}

.mwl .mwl__navigation__next:hover,
.mwl .mwl__navigation__previous:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.1) !important;
}

/* Style for the navigation overlay areas - now covering entire halves */
.mwl-nav-overlay-left,
.mwl-nav-overlay-right {
    transition: background-color 0.2s ease-in-out !important;
    pointer-events: auto !important;
}

/* Subtle hover effect to indicate clickable areas */
.mwl-nav-overlay-left:hover,
.mwl-nav-overlay-right:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Cursor indicators for the navigation areas */
.mwl-nav-overlay-left {
    cursor: w-resize !important;
}

.mwl-nav-overlay-right {
    cursor: e-resize !important;
}

/* Ensure overlays don't interfere with other UI elements */
.mwl .mwl__topbar,
.mwl .mwl__navigation,
.mwl .mwl__metadata {
    z-index: 10 !important;
    position: relative !important;
}

/* Make sure the image doesn't show a pointer cursor since we're using it for navigation */
.mwl .mwl__slider .mwl__slider__image .mwl__slider__image__thumbnail img {
    cursor: default !important;
}

/* Left half of the image = previous */
.mwl .mwl__slider .mwl__slider__image .mwl__slider__image__thumbnail img:hover {
    cursor: pointer !important;
}

/* Custom styles for the top bar controls */
.mwl .mwl__topbar .mwl__topbar__controls .mwl__topbar__controls__control {
    opacity: 0.8 !important;
}

.mwl .mwl__topbar .mwl__topbar__controls .mwl__topbar__controls__control:hover {
    opacity: 1 !important;
}

/* Customize the image caption area */
.mwl .mwl__metadata {
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-radius: 8px !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
}

.mwl .mwl__metadata h2 {
    font-size: 24px !important;
    font-weight: 600 !important;
    margin-bottom: 15px !important;
}

.mwl .mwl__metadata .description .caption {
    font-size: 16px !important;
    line-height: 1.5 !important;
}

/* Custom styles for the EXIF data display */
.mwl .mwl__metadata .exifs .exif {
    margin: 10px 15px !important;
    padding: 5px 10px !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
}

.mwl .mwl__metadata .exifs .exif svg {
    margin-right: 5px !important;
}

/* For PhotoSwipe engine */
.mwl.pswp--open .pswp__custom-caption {
    background-color: rgba(0, 0, 0, 0.7) !important;
    padding: 10px 15px !important;
    border-radius: 5px !important;
}

/* Ensure PhotoSwipe navigation works similarly */
.pswp__ui--over-close .pswp__button--arrow--left,
.pswp__ui--over-close .pswp__button--arrow--right {
    opacity: 1 !important;
}

/* Custom map container styles */
.mwl .image-map.visible,
.custom-meow-map {
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) !important;
    overflow: hidden !important;
}

/* Mobile responsiveness improvements */
@media screen and (max-width: 768px) {

    .mwl .mwl__navigation__next,
    .mwl .mwl__navigation__previous {
        padding: 10px !important;
    }

    .mwl .mwl__metadata {
        width: 90% !important;
        padding: 10px !important;
    }

    .mwl .mwl__metadata h2 {
        font-size: 20px !important;
    }

    .mwl .mwl__metadata .description .caption {
        font-size: 14px !important;
    }

    .mwl .mwl__metadata .exifs .exif {
        margin: 5px !important;
        padding: 3px 5px !important;
    }

    /* Keep full-width navigation overlays on mobile for better usability */
    .mwl-nav-overlay-left,
    .mwl-nav-overlay-right {
        width: 50% !important;
        /* Keep full halves on mobile for easier navigation */
    }
}

/**
 * Simple Meow Lightbox Navigation Styles
 * Styles for the 50/50 navigation overlay
 */

/* Main navigation overlay container */
#simple-lightbox-nav {
    /* All styles are set via JavaScript for maximum compatibility */
}

/* Left navigation area */
#simple-lightbox-nav .nav-left {
    /* Styles set via JavaScript */
}

/* Right navigation area */
#simple-lightbox-nav .nav-right {
    /* Styles set via JavaScript */
}

/* Optional: Add visual indicators when hovering (can be customized) */
#simple-lightbox-nav .nav-left:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

#simple-lightbox-nav .nav-right:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Ensure the overlay doesn't interfere with other lightbox UI elements */
.mwl .mwl__topbar,
.mwl .mwl__navigation,
.mwl .mwl__metadata,
.pswp__ui,
.pswp__top-bar,
.pswp__button,
.mwl__topbar__controls {
    z-index: 1000001 !important;
    position: relative !important;
}

/* Specific high z-index for close button and top controls */
.mwl .mwl__topbar,
.mwl .mwl__topbar .mwl__topbar__controls,
.mwl .mwl__topbar .mwl__topbar__controls .mwl__topbar__controls__control,
.pswp__top-bar,
.pswp__button--close {
    z-index: 1000002 !important;
}

/* Our navigation overlay should be below the controls */
#simple-lightbox-nav {
    z-index: 1000000 !important;
}

.pswp__top-bar {
    z-index: 9999999 !important;
    position: relative !important;
}

/* Optional: Add subtle visual feedback on click */
#simple-lightbox-nav .nav-left:active {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

#simple-lightbox-nav .nav-right:active {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Ensure the overlay works on mobile devices */
@media (max-width: 768px) {

    #simple-lightbox-nav .nav-left,
    #simple-lightbox-nav .nav-right {
        /* Keep full 50% width on mobile for easy navigation */
        width: 50% !important;
    }
}

/* Optional: Add cursor indicators for better UX */
#simple-lightbox-nav .nav-left {
    cursor: w-resize !important;
}

#simple-lightbox-nav .nav-right {
    cursor: e-resize !important;
}

/* Hide the overlay when lightbox is not active */
#simple-lightbox-nav[style*="display: none"] {
    pointer-events: none !important;
}

/* Ensure overlay is above everything else */
#simple-lightbox-nav {
    z-index: 999999 !important;
}