body {
    font-family: "Arial", sans-serif;
    background: #faf7f7;
    margin: 0;
    padding: 0;
    text-align: center;
}

/* TITRE */
.title {
    margin-top: 90px; 
    font-size: 32px;
    color: #182d09;
    font-weight: bold;
}

/* LOGOUT */
.logout-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    background: #b05276;
    padding: 10px 15px;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    z-index: 1000;
}
.logout-btn:hover {
    background: #b05276;
}

/* UPLOAD */
.upload-form {
    margin-top: 25px;
}
.upload-form button {
    padding: 10px 20px;
    background: #b05276;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 6px;
    font-size: 15px;
}
.upload-form button:hover {
    background: #b05276;
}

.error {
    color: red;
    font-weight: bold;
    margin: 10px 0;
}

/* GALERIE */
.gallery {
    margin: 30px auto;
    width: 90%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 20px;
}

.photo {
    position: relative;
    width: 100%;
    height: 250px; /* Hauteur fixe pour toutes les images */
    overflow: hidden;
    border-radius: 10px;
}

.photo-actions {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;     /* BOUTONS L’UN SOUS L’AUTRE */
    gap: 6px;                    /* petit espace entre eux */
    z-index: 10;
}

.btn {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    color: white;
    text-align: center;
    opacity: 0.95;
    width: 120px;               /* même largeur pour les deux */
}

.download {
    background: #75824d;
}
.download:hover {
    background: #75824d;
}

.delete {
    background: #7d0531;
}
.delete:hover {
    background: #7d0531;
}


/* Effet pour que les boutons apparaissent au survol */
.photo:hover .photo-actions {
    opacity: 1;
}

.photo-actions {
    opacity: 1;
    transition: opacity 0.2s ease;
}
.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* Remplit sans déformer */
    object-position: center; /* Centre l’image */
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.photo:hover img {
    transform: scale(1.02);
    opacity: 0.9;
}


/* FULLSCREEN */
#fullscreen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#fullscreen img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 50px;
    color: white;
    cursor: pointer;
}

.container {
    max-width: 1200px; /* largeur maximale pour grand écran */
    margin: 0 auto;    /* centre le contenu */
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

/* Tablette (768px et moins) */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        grid-gap: 15px;
    }

    .photo-actions {
        width: auto;
        right: 10px;
        bottom: 10px;
        gap: 4px;
    }

    .btn {
        width: 100px;
        font-size: 12px;
        padding: 5px 10px;
    }

    .upload-form button {
        font-size: 14px;
        padding: 8px 15px;
    }

    .title {
        font-size: 38px;
        margin-top: 70px;
        margin-left: 20px;
        margin-right: 20px;
        text-align: center;
        
    }

    p {
        margin-left: 20px;
        margin-right: 20px;
    }

    .logout-btn {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 13px;
    }

     .container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Mobile (480px et moins) */
@media (max-width: 480px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        grid-gap: 10px;
    }

    .photo-actions {
        gap: 3px;
    }

    .btn {
        width: 90px;
        font-size: 11px;
        padding: 4px 8px;
    }

    .upload-form input[type="file"] {
        width: 70%;
    }

    .upload-form button {
        width: 25%;
        font-size: 12px;
        padding: 6px 8px;
    }

    .title {
        font-size: 32px;
        margin-top: 60px;
        margin-left: 15px;
        margin-right: 15px;
        text-align: center;
    }

    p {
        margin-left: 15px;
        margin-right: 15px;
        font-size: 16px; /* optionnel : texte plus lisible sur petit écran */
    }

     .logout-btn {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}
