/* Base Gallery Styles */
.eag-gallery-wrapper {
    width: 100%;
    position: relative;
}

.eag-gallery-container {
    display: grid;
    width: 100%;
    transition: all 0.3s ease;
}

.eag-gallery-container.eag-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.eag-gallery-container.eag-layout-masonry {
    column-count: 3;
    column-gap: 15px;
}

.eag-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f8f9fa;
}

.eag-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.eag-masonry-item {
    break-inside: avoid;
    margin-bottom: 15px;
}

.eag-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.eag-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.eag-gallery-item:hover img {
    transform: scale(1.05);
}

/* Overlay Styles */
.eag-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;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.eag-gallery-item:hover .eag-overlay {
    opacity: 1;
}

.eag-lightbox {
    color: white;
    font-size: 24px;
    text-decoration: none;
    padding: 15px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.eag-lightbox:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.eag-caption {
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    margin-top: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
}

/* Load More Button */
.eag-load-more-wrapper {
    text-align: center;
    margin: 30px 0;
}

.eag-load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.eag-load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
}

.eag-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading Indicator */
.eag-loading-indicator {
    text-align: center;
    padding: 20px;
}

.eag-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: eag-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes eag-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter Navigation */
.eag-filter-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.eag-filter-btn {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    color: #495057;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.eag-filter-btn:hover,
.eag-filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .eag-gallery-container.eag-layout-masonry {
        column-count: 2;
    }

    .eag-gallery-container.eag-layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .eag-gallery-container.eag-layout-masonry {
        column-count: 1;
    }

    .eag-gallery-container.eag-layout-grid {
        grid-template-columns: 1fr;
    }

    .eag-load-more-btn {
        padding: 12px 25px;
        font-size: 14px;
    }
}

/* Animations */
.eag-gallery-item {
    animation: eag-fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes eag-fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.eag-gallery-item:nth-child(1) { animation-delay: 0.1s; }
.eag-gallery-item:nth-child(2) { animation-delay: 0.2s; }
.eag-gallery-item:nth-child(3) { animation-delay: 0.3s; }
.eag-gallery-item:nth-child(4) { animation-delay: 0.4s; }
.eag-gallery-item:nth-child(5) { animation-delay: 0.5s; }
.eag-gallery-item:nth-child(6) { animation-delay: 0.6s; }

/* Justified Layout */
.eag-gallery-container.eag-layout-justified {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.eag-layout-justified .eag-gallery-item {
    flex: 0 0 auto;
    margin-bottom: 15px;
}

/* High Performance Optimizations */
.eag-gallery-item img {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.eag-overlay {
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .eag-gallery-item {
        background: #2d3748;
    }

    .eag-filter-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}
