.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid #333;
    background: transparent;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    border-radius: 4px;
}

.category-btn:hover {
    background: #333;
    color: white;
}

.category-btn.active {
    background: #333;
    color: white;
    cursor: default;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    grid-auto-rows: 312.5px;
    grid-auto-flow: dense;
    gap: 5px;
    padding: 5px;
    transition: 0.3s;
}

.image-container {
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    grid-row: span 1;
    cursor: pointer;
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform, filter;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: all 0.3s ease;
}

.image-container.landscape {
    grid-column: span 2;
    grid-row: span 1;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
}

.image-container img {
    transform: scale(1);
    filter: grayscale(0);
    will-change: transform, filter;
    transition: all 0.4s ease-in-out;
}

.image-grid:hover .image-container img {
    filter: grayscale(100%);
    transform: scale(1);
    transition: all 0.3s ease-out;
}

.image-grid:hover .image-container:hover img {
    filter: grayscale(0);
    transform: scale(1.15);
    z-index: 1;
    transition: all 0.3s ease-in;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.image-container:hover .image-info {
    transform: translateY(0);
}

.image-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
}

.header {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 15px;
    margin: 20px 0 40px;
}

.header h1 {
    font-size: 2.5em;
    margin: 0;
    color: #333;
    font-weight: 500;
}

.header p {
    font-size: 1.1em;
    color: #666;
    margin: 0;
}

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #333;
    font-family: Arial, sans-serif;
}

.footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #000;
}
.image-info p {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 1000;
    opacity: 0;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.show .modal-content {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-content.slide-left {
    transform: translate(-150%, -50%);
}

.modal-content.slide-right {
    transform: translate(50%, -50%);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover {
    color: #bbb;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 20px 15px;
    cursor: pointer;
    font-size: 24px;
    border: none;
    transition: background-color 0.3s ease;
    z-index: 1001;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.prev-button {
    left: 20px;
}

.next-button {
    right: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .image-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
        gap: 10px;
        padding: 0;
    }

    .image-container.landscape {
        grid-column: span 1;
    }

    .image-info {
        padding: 12px;
        background: rgba(0, 0, 0, 0.85);
        transform: translateY(0);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .image-container:hover .image-info {
        opacity: 1;
    }

    .image-info h3 {
        font-size: 1.1em;
        margin-bottom: 6px;
    }

    .image-info p {
        font-size: 0.9em;
        line-height: 1.3;
    }

    .nav-button {
        padding: 15px 12px;
        font-size: 20px;
        background: rgba(0, 0, 0, 0.5);
    }

    .prev-button {
        left: 10px;
    }

    .next-button {
        right: 10px;
    }

    .close-button {
        top: 10px;
        right: 15px;
        font-size: 35px;
    }

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