/* Freedom Pools Gallery Frontend Styles */

.freedom-pools-gallery {
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Grid Layouts */
.fpg-gallery-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 2rem;
}

.fpg-grid-2 .fpg-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
}

.fpg-grid-3 .fpg-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
}

.fpg-grid-4 .fpg-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
}

.fpg-grid-5 .fpg-gallery-grid {
    grid-template-columns: repeat(5, 1fr);
}

.fpg-grid-6 .fpg-gallery-grid {
    grid-template-columns: repeat(6, 1fr);
}

/* Gallery Item */
.fpg-gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fff;
}

.fpg-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.fpg-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.fpg-gallery-item:hover .fpg-image-container {
    transform: scale(1.05);
}

/* Remove the old img styles since we're using background images */
.fpg-gallery-image {
    display: none; /* Hide img elements since we're using background images */
}

/* Image Caption */
.fpg-image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    padding: 20px 15px 15px;
    font-size: 14px;
    line-height: 1.4;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.fpg-gallery-item:hover .fpg-image-caption {
    transform: translateY(0);
}

/* Image Overlay */
.fpg-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Tags */
.fpg-image-tags,
.fpg-lightbox-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.fpg-tag {
    background: rgb(2, 39, 62, 0.5);
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

/* No Images Message */
.fpg-no-images {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
}

.fpg-no-images p {
    margin: 0;
    font-size: 16px;
}

/* Lightbox */
.fpg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fpg-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.fpg-lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.fpg-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.fpg-lightbox-image-container {
    max-height: 70vh;
    overflow: hidden;
}

#fpg-lightbox-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

.fpg-lightbox-info {
    padding: 20px;
    background: #fff;
}

.fpg-lightbox-info h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.fpg-lightbox-info p {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
}

/* Lightbox Navigation */
.fpg-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
}

.fpg-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.fpg-lightbox-prev {
    left: 20px;
}

.fpg-lightbox-next {
    right: 20px;
}

/* Body scroll lock when lightbox is open */
body.fpg-lightbox-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .fpg-grid-4 .fpg-gallery-grid,
    .fpg-grid-5 .fpg-gallery-grid,
    .fpg-grid-6 .fpg-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .fpg-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
    
    .fpg-image-caption {
        padding: 15px 10px 10px;
        font-size: 13px;
    }
   
    
    .fpg-lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .fpg-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .fpg-lightbox-prev {
        left: 10px;
    }
    
    .fpg-lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .fpg-gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .fpg-image-container {
        padding-bottom: 66.67%; /* 3:2 aspect ratio for mobile */
    }
    
    .fpg-lightbox-info {
        padding: 15px;
    }
    
    .fpg-lightbox-info h3 {
        font-size: 18px;
    }
    
    .fpg-lightbox-nav {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* Loading Animation */
@keyframes fpg-pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Accessibility */
.fpg-gallery-item:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.fpg-lightbox-nav:focus,
.fpg-lightbox-close:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fpg-gallery-item {
        border: 2px solid #000;
    }
    
    .fpg-image-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .fpg-tag {
        background: #000;
        color: #fff;
        border: 1px solid #fff;
    }
}

/* Loading States */
.fpg-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.fpg-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: fpg-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.fpg-image-container.loading {
    background-color: #f8f9fa;
    animation: fpg-pulse 1.5s ease-in-out infinite;
}

.fpg-image-container.error {
    background-color: #f8d7da;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="300" height="200"%3E%3Crect width="100%25" height="100%25" fill="%23f8d7da"/%3E%3Ctext x="50%25" y="50%25" text-anchor="middle" dy=".3em" fill="%23721c24"%3EImage not found%3C/text%3E%3C/svg%3E') !important;
}

.fpg-image-container.loaded {
    animation: none;
    background-color: transparent;
} 