/**
 * WP Gallery Pro - Professional Lightbox CSS
 * Extracted and adapted from HNDC Booth Booking lightbox
 */

/* Main Gallery Popup Styles */
.wp-gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wp-gallery-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.wp-gallery-container {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    max-width: 92vw;
    max-height: 92vh;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

/* Gallery Header */
.wp-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(222, 226, 230, 0.6);
    position: relative;
}

.wp-gallery-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #007cba 0%, #00a0d2 100%);
}

.wp-gallery-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.wp-gallery-counter {
    font-size: 14px;
    color: #666;
}

.wp-gallery-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.wp-gallery-close:hover {
    background: #e9ecef;
    color: #000;
}

/* Gallery Main Content */
.wp-gallery-main {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-height: 400px;
    overflow: hidden;
}

.wp-gallery-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: #f8f9fa;
    height: 100%;
    position: relative;
}

.wp-gallery-image-container img {
    max-width: calc(100% - 60px);
    max-height: calc(100% - 60px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    display: block;
}

/* Navigation Buttons */
.wp-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 50px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-gallery-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.wp-gallery-prev {
    left: 10px;
}

.wp-gallery-next {
    right: 10px;
}

.wp-gallery-nav span {
    font-size: 24px;
    font-weight: bold;
}

/* Thumbnails */
.wp-gallery-thumbnails {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    overflow-x: auto;
    max-width: 100%;
    flex-shrink: 0;
    min-height: 75px;
    align-items: center;
}

.wp-gallery-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wp-gallery-thumb:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wp-gallery-thumb.active {
    opacity: 1;
    border-color: #007cba;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 186, 0.3);
}

/* Prevent body scroll when lightbox is open */
body.wp-gallery-lightbox-open {
    overflow: hidden !important;
}

/* Loading Animation */
.wp-gallery-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 16px;
}

.wp-gallery-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: wp-gallery-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes wp-gallery-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade animations */
.wp-gallery-popup {
    animation: wp-gallery-fade-in 0.3s ease-out;
}

.wp-gallery-popup.closing {
    animation: wp-gallery-fade-out 0.2s ease-in;
}

@keyframes wp-gallery-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wp-gallery-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-gallery-container {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .wp-gallery-header {
        padding: 10px 15px;
    }
    
    .wp-gallery-title {
        font-size: 14px;
    }
    
    .wp-gallery-counter {
        font-size: 12px;
    }
    
    .wp-gallery-main {
        min-height: 300px;
    }
    
    .wp-gallery-image-container {
        padding: 15px;
    }
    
    .wp-gallery-image-container img {
        max-width: calc(100% - 30px);
        max-height: calc(100% - 30px);
        border-radius: 8px;
    }
    
    .wp-gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .wp-gallery-nav span {
        font-size: 18px;
    }
    
    .wp-gallery-prev {
        left: 5px;
    }
    
    .wp-gallery-next {
        right: 5px;
    }
    
    .wp-gallery-thumbnails {
        padding: 10px 15px;
        min-height: 65px;
    }
    
    .wp-gallery-thumb {
        width: 50px;
        height: 38px;
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .wp-gallery-container {
        max-width: 98vw;
        max-height: 98vh;
        border-radius: 8px;
    }
    
    .wp-gallery-header {
        padding: 8px 12px;
    }
    
    .wp-gallery-title {
        font-size: 13px;
    }
    
    .wp-gallery-counter {
        font-size: 11px;
    }
    
    .wp-gallery-main {
        min-height: 250px;
    }
    
    .wp-gallery-image-container {
        padding: 10px;
    }
    
    .wp-gallery-image-container img {
        max-width: calc(100% - 20px);
        max-height: calc(100% - 20px);
        border-radius: 6px;
    }
    
    .wp-gallery-nav {
        width: 35px;
        height: 35px;
    }
    
    .wp-gallery-nav span {
        font-size: 16px;
    }
    
    .wp-gallery-prev {
        left: 3px;
    }
    
    .wp-gallery-next {
        right: 3px;
    }
    
    .wp-gallery-thumbnails {
        padding: 8px 12px;
        min-height: 55px;
        gap: 6px;
    }
    
    .wp-gallery-thumb {
        width: 45px;
        height: 34px;
        border-radius: 3px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .wp-gallery-nav {
        -webkit-tap-highlight-color: transparent;
    }
    
    .wp-gallery-thumb {
        -webkit-tap-highlight-color: transparent;
    }
    
    .wp-gallery-close {
        -webkit-tap-highlight-color: transparent;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .wp-gallery-image-container img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
} 