.gallery-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin: 32px 0 16px 0;
}

.gallery-controls input[type="text"] {
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 4px;
    border: 1px solid #444;
    background: #181c2a;
    color: #fff;
}

.gallery-controls select {
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 4px;
    border: 1px solid #444;
    background: #181c2a;
    color: #fff;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-item {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    width: 220px;
    transition: box-shadow 0.2s;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
}

.gallery-item img {
    width: 180px;
    height: 124px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.gallery-item img:hover {
    transform: scale(1.04);
    box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.18);
}

.gallery-item .caption {
    margin-top: 8px;
    color: #f2f2f2;
    font-size: 0.95rem;
    word-break: break-all;
}

.notification {
    position: fixed;
    left: 50%;
    top: 80px;
    transform: translateX(-50%);
    background: #222b;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
    z-index: 2000;
}

#backToTopBtn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 3000;
    background: #222b;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.18);
    display: none;
    transition: background 0.2s, opacity 0.2s;
}

#backToTopBtn:hover {
    background: #1CB5E0;
    color: #fff;
}

@media (max-width: 1200px) {
    .gallery-grid {
        max-width: 840px; 
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        max-width: 700px;
    }
    .gallery-item {
        width: 32vw;
    }
    .gallery-item img {
        width: 32vw;
        height: calc(32vw * 124 / 220);
    }
}

@media (max-width: 600px) {
    .gallery-item {
        width: 95vw;
    }
    .gallery-grid {
        max-width: 100vw;
        gap: 10px;
    }
    .gallery-item img {
        width: 95vw;
        height: calc(95vw * 124 / 220);
    }
}