* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    background: #111;
    color: #eee;
    margin: 0;
    padding: 0;
}

h1, .filters {
    text-align: center;
    margin: 1em 0 0.5em 0;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 10px 20px;
    gap: 10px;
}

.gallery-item {
    flex: 1 1 250px;
    max-width: 250px;
    position: relative;
}

.gallery img, .gallery video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 3px solid #333;
    border-radius: 8px;
    cursor: pointer;
}

.gallery-item.like img, .gallery-item.like video {
    border-color: limegreen;
}

.gallery-item.dislike img, .gallery-item.dislike video {
    border-color: orangered;
}

.votes {
    display: flex;
    justify-content: center;
    margin-top: 5px;
    font-size: 1.4em;
    gap: 8px;
}

.votes form button {
    background: none;
    border: none;
    color: #eee;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s;
}

.votes form button:hover {
    transform: scale(1.3);
}

.votes .active-like {
    color: limegreen;
}

.votes .active-dislike {
    color: orangered;
}

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

.popup img, .popup video {
    max-width: 90%;
    max-height: 90%;
    border: 5px solid white;
    border-radius: 10px;
}

.popup video::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Fond semi-transparent */
    pointer-events: none; /* Permet de cliquer à travers le pseudo-élément */
}

.popup video {
    background-color: black;
    border: none;
}

.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0.5em auto 1em auto;
    gap: 10px;
}

.links a {
    color: #0af;
    text-decoration: none;
    font-size: 1.2em;
}

form.login {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 2em;
}

input, button {
    padding: 0.5em;
    font-size: 1em;
}

.wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.user-info {
    text-align: center;
    margin-bottom: 10px;
}

.upload-form {
    text-align: center;
    margin: 1em 0;
}

@media (max-width: 1024px) {
    .gallery {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .gallery {
        justify-content: center;
    }

    .links {
        flex-direction: column;
        align-items: center;
    }
}

.legend {
    text-align: center;
    margin-top: 4px;
    font-size: 0.9em;
    color: #aaa;
}

a.filter {
    margin: 0 10px;
    color: #0af;
    text-decoration: none;
}

a.filter.selected {
    font-weight: bold;
    text-decoration: underline;
}