.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
    gap: 0.5rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 50;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 95%;
    max-height: 90vh;
    position: relative;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: auto;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2.25rem; /* Increased from 1.5rem to 2.25rem (1.5x larger) */
    padding-right: 1rem; /* Add right padding to make it easier to click */
    cursor: pointer;
    color: white;
    z-index: 60;
}

.nav-area {
    /* Invisible navigation areas */
    /* These will be handled by JavaScript event listeners */
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    z-index: 55;
    background: none;
    border: none;
    opacity: 0.7;
    transition: opacity 0.3s;
    padding: 0.5rem;
    user-select: none;
}

.nav-btn:hover {
    opacity: 1;
}

#prevImage {
    left: 1rem;
}

#nextImage {
    right: 1rem;
}

/* Mobile specific styles */
@media (max-width: 640px) {
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
        gap: 0.25rem;
    }

    .container {
        padding: 0.5rem;
    }

    header {
        padding: 1rem 0;
    }

    h1 {
        font-size: 1.5rem;
    }

    .modal-content img {
        max-height: 85vh;
    }

    #closeModal {
        top: 1rem !important;
        right: 1rem !important;
        font-size: 2.25rem !important; /* Keep the increased size on mobile too */
        padding-right: 1rem !important; /* Ensure padding applies on mobile too */
    }
}