.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.cropped-image {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
    background: #fff;
    position: relative;
    image-rendering: auto;
}

.cropped-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--crop-x, 50%) var(--crop-y, 50%);
    transform: scale(var(--zoom, 1));
    transform-origin: var(--crop-x, 50%) var(--crop-y, 50%);
}

.image-id {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--secondary-color);
    font-size: 14px;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    transition: transform 0.2s ease-in-out;
}

.lightbox-details {
    color: white;
    text-align: left;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    width: 100%;
    font-size: 14px;
}

.lightbox-id {
    color: var(--secondary-color);
    font-size: 16px;
    font-weight: bold;
    margin-right: 8px;
}

.zoom-in {
    transform: scale(2.5);
    transition: transform 0.3s ease, transform-origin 0.3s ease;
}

.nav-button {
    position: absolute;
    top: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 12px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.nav-button:hover {
    background: var(--secondary-color);
    transform: scale(1.5);
}

.nav-button:active {
    transform: scale(1);
}

#prev-btn {
    left: 10px;
}

#next-btn {
    right: 10px;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    color: white;
    font-size: 24px;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease;
    opacity: 0.7;
}

.close-button:hover {
    opacity: 1;
}

.button-container {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.switch-button {
    background-color: #fff;
    border: 2px solid #ddd;
    padding: 12px 18px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    font-weight: bold;
    color: #333;
    border-radius: 6px;
}

.switch-button:hover {
    color: #000;
    background-color: #f1c40f;
}

.switch-button.active {
    background-color: #f1c40f;
    color: #1e1e1e;
}