/* Fresh Gallery Styles */
.freshgallery-container {
    display: grid;
    gap: 15px;
    margin: 20px 0;
    padding: 0;
}

/* Default 3-column layout */
.freshgallery-container[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

/* 2-column layout */
.freshgallery-container[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

/* 4-column layout */
.freshgallery-container[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Single column layout */
.freshgallery-container[data-columns="1"] {
    grid-template-columns: 1fr;
}

.freshgallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.freshgallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.freshgallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.freshgallery-item:hover img {
    transform: scale(1.05);
}

/* Lightbox Styles */
.freshgallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: pointer;
}

.freshgallery-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.freshgallery-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.freshgallery-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.freshgallery-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.freshgallery-lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.freshgallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.freshgallery-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.freshgallery-lightbox-prev {
    left: -60px;
}

.freshgallery-lightbox-next {
    right: -60px;
}

.freshgallery-lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .freshgallery-container[data-columns="4"],
    .freshgallery-container[data-columns="3"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .freshgallery-item img {
        height: 150px;
    }
    
    .freshgallery-lightbox-nav {
        font-size: 20px;
        padding: 8px 12px;
    }
    
    .freshgallery-lightbox-prev {
        left: -50px;
    }
    
    .freshgallery-lightbox-next {
        right: -50px;
    }
}

@media (max-width: 480px) {
    .freshgallery-container {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .freshgallery-item img {
        height: 200px;
    }
    
    .freshgallery-lightbox-nav {
        font-size: 18px;
        padding: 6px 10px;
    }
    
    .freshgallery-lightbox-prev {
        left: -40px;
    }
    
    .freshgallery-lightbox-next {
        right: -40px;
    }
}

/* Loading Animation */
.freshgallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 16px;
    color: #666;
}

.freshgallery-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image Captions and Links */
.freshgallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 15px 10px 10px;
    font-size: 14px;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.freshgallery-item:hover .freshgallery-caption {
    opacity: 1;
}

.freshgallery-link {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.freshgallery-item:hover .freshgallery-link {
    opacity: 1;
}

.freshgallery-link a {
    background: rgba(0, 115, 170, 0.9);
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.freshgallery-link a:hover {
    background: rgba(0, 115, 170, 1);
}

/* Pagination Styles */
.freshgallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 10px;
}

.freshgallery-pagination-link {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.freshgallery-pagination-link:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    text-decoration: none;
}

.freshgallery-pagination-current {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    background: #0073aa;
    color: white;
    border-radius: 4px;
    border: 1px solid #0073aa;
    font-size: 14px;
    font-weight: 500;
}

.freshgallery-pagination-dots {
    display: inline-block;
    padding: 8px 4px;
    margin: 0 2px;
    color: #6c757d;
    font-size: 14px;
}

.freshgallery-pagination-numbers {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.freshgallery-pagination-prev,
.freshgallery-pagination-next {
    font-weight: 600;
}

.freshgallery-pagination-info {
    margin-left: 20px;
    color: #6c757d;
    font-size: 14px;
    font-style: italic;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .freshgallery-pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .freshgallery-pagination-numbers {
        margin: 0;
        order: 2;
    }
    
    .freshgallery-pagination-prev {
        order: 1;
    }
    
    .freshgallery-pagination-next {
        order: 3;
    }
    
    .freshgallery-pagination-info {
        order: 4;
        margin-left: 0;
        text-align: center;
    }
    
    .freshgallery-pagination-link {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .freshgallery-pagination-current {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .freshgallery-pagination-link {
        padding: 5px 8px;
        font-size: 12px;
        margin: 0 1px;
    }
    
    .freshgallery-pagination-current {
        padding: 5px 8px;
        font-size: 12px;
        margin: 0 1px;
    }
    
    .freshgallery-pagination-dots {
        padding: 5px 2px;
        margin: 0 1px;
        font-size: 12px;
    }
}