/* Gallery container */
.naidised-gallery-container {
    margin: 20px 0;
}

/* Gallery grid */
.naidised-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* Gallery item */
.naidised-gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f5f5f5;
}

.naidised-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.naidised-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.naidised-gallery-item img.loaded {
    opacity: 1;
}

.naidised-gallery-item:hover img {
    transform: scale(1.05);
}

/* Loading placeholder */
.loading-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Overlay */
.naidised-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.naidised-gallery-item:hover .naidised-overlay {
    transform: translateY(0);
}

.naidised-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: block;
}

/* Load more button */
.naidised-load-more-container {
    text-align: center;
    margin-top: 30px;
}

.naidised-load-more {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.naidised-load-more:hover {
    background: #005a87;
}

.naidised-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.naidised-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff40;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.naidised-lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.naidised-lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    border-radius: 5px;
}

.naidised-lightbox-title {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
    max-width: 600px;
    line-height: 1.4;
}

/* Lightbox controls */
.naidised-close,
.naidised-prev,
.naidised-next {
    position: absolute;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 10001;
}

.naidised-close {
    top: 15px;
    right: 25px;
    font-size: 35px;
}

.naidised-prev,
.naidised-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    padding: 10px;
}

.naidised-prev {
    left: 20px;
}

.naidised-next {
    right: 20px;
}

.naidised-close:hover,
.naidised-prev:hover,
.naidised-next:hover {
    color: #0073aa;
    transform: translateY(-50%) scale(1.1);
}

.naidised-close:hover {
    transform: scale(1.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .naidised-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .naidised-gallery-item {
        border-radius: 5px;
    }

    .naidised-overlay {
        padding: 15px 10px 10px;
    }

    .naidised-title {
        font-size: 12px;
    }

    .naidised-load-more {
        padding: 10px 20px;
        font-size: 14px;
    }

    .naidised-lightbox {
        padding: 10px;
    }

    .naidised-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }

    .naidised-prev,
    .naidised-next {
        font-size: 30px;
        padding: 5px;
    }

    .naidised-prev {
        left: 10px;
    }

    .naidised-next {
        right: 10px;
    }

    .naidised-lightbox-title {
        font-size: 14px;
        margin-top: 10px;
    }

    .naidised-lightbox-img {
        max-height: calc(100vh - 100px);
    }
}

@media (max-width: 480px) {
    .naidised-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .naidised-gallery-item {
        border-radius: 3px;
    }

    .naidised-overlay {
        padding: 10px 8px 8px;
    }

    .naidised-title {
        font-size: 11px;
    }
}

/* Print styles */
@media print {
    .naidised-lightbox {
        display: none !important;
    }
}
