/* Gallery Grid Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #f8f9fa;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
    display: block;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 2;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

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

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 12px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-item .overlay .title {
    color: white;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.gallery-item .overlay .meta {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    margin: 4px 0 0;
}

.gallery-item .image-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    backdrop-filter: blur(4px);
}

.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: #e9ecef;
    color: #adb5bd;
}

.no-image-placeholder i {
    font-size: 48px;
    margin-bottom: 8px;
}

.no-image-placeholder span {
    font-size: 13px;
}

/* Loading */
#loadingSearch {
    padding: 40px 0;
}

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

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

/* Lightbox/Viewer Styles */
.photo-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-viewer-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.photo-viewer-overlay .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}

.photo-viewer-overlay .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    border: none;
    padding: 20px 10px;
}

.photo-viewer-overlay .nav-btn.prev {
    left: 10px;
}

.photo-viewer-overlay .nav-btn.next {
    right: 10px;
}

.photo-viewer-overlay .photo-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
}