/**
 * Open User Map Gallery Styles for King Theme
 * 
 * This file contains styles for the image gallery displayed below Open User Map posts
 */

/* Gallery Container - Seamlessly integrated with carousel */
.oum-post-gallery {
    margin: 0;
    padding: 15px 0 0 0; /* Add top padding to separate from carousel */
    background: #ff0000 !important; /* Bright red background for debugging */
    border: 3px solid #00ff00 !important; /* Bright green border for debugging */
    box-shadow: none;
    position: relative;
    overflow: visible; /* Changed from hidden to visible */
    /* Remove any visual separation */
    border-top: none;
    border-bottom: none;
    /* Ensure it's visible */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important; /* Very high z-index to ensure it's above other elements */
    min-height: 100px; /* Ensure minimum height */
}

.oum-post-gallery::before {
    display: none; /* Remove the separator line */
}

/* Gallery Title - Removed for seamless integration */

/* Thumbnails Container - Seamlessly integrated */
.gallery-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
    /* Ensure visibility */
    visibility: visible !important;
    opacity: 1 !important;
}

/* Individual Thumbnails - Integrated */
.gallery-thumbnail {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    /* Ensure visibility */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.gallery-thumbnail:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-color: #007cba;
}

.gallery-thumbnail.active {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.4);
    transform: scale(1.05);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    /* Ensure image visibility */
    visibility: visible !important;
    opacity: 1 !important;
}

.gallery-thumbnail:hover img {
    transform: scale(1.1);
}

/* Thumbnail Overlay */
.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.image-number {
    color: white;
    font-weight: 800;
    font-size: 16px;
    background: linear-gradient(135deg, #007cba, #005a87);
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    min-width: 30px;
    text-align: center;
}

/* Navigation Buttons - Removed for seamless integration */

/* Loading States */
.gallery-thumbnail.loading {
    opacity: 0.7;
    pointer-events: none;
}

.gallery-thumbnail.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .oum-post-gallery {
        margin: 0;
        padding: 15px 0 0 0;
        border-radius: 0;
    }
    
    .gallery-thumbnail {
        width: 60px;
        height: 60px;
        border-radius: 8px;
    }
    
    .gallery-thumbnails {
        gap: 8px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .oum-post-gallery {
        padding: 10px 0 0 0;
    }
    
    .gallery-thumbnail {
        width: 55px;
        height: 55px;
    }
    
    .gallery-thumbnails {
        gap: 6px;
    }
}

/* Dark Mode Support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .oum-post-gallery {
        background: transparent;
        border-color: transparent;
        color: #e2e8f0;
    }
    
    .gallery-thumbnail {
        background: #4a5568;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
}

/* Print Styles */
@media print {
    .oum-post-gallery {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    .gallery-navigation {
        display: none !important;
    }
    
    .gallery-thumbnail {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}
