/* Importation de la police moderne depuis Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;600;700&display=swap');

/* --- Variables de couleurs pour un style cohérent --- */
:root {
    --dark-blue: #0D1B2A;
    --mid-blue: #1B263B;
    --light-grey: #E0E1DD;
    --gold: #FFC300;
    --text-color: #F8F9FA;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-blue);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 1200px;
}

/* --- Section Héros avec le compteur --- */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    border-radius: 20px;
    background: var(--mid-blue);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: 2px;
}

.hero span {
    color: var(--gold);
}

#countdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.time-box {
    background: var(--dark-blue);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    min-width: 90px;
    flex-grow: 1;
}

.time-box .number {
    font-size: 2.5em;
    font-weight: 600;
    color: var(--gold);
}

.time-box .label {
    font-size: 0.8em;
    text-transform: uppercase;
    color: var(--light-grey);
}

/* --- Section Galerie --- */
.gallery-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--gold);
}

/* --- Formulaire d'upload stylé --- */
.upload-form {
    background: var(--mid-blue);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
    text-align: center;
}

.upload-form p {
    margin-bottom: 1.5rem;
    font-weight: 300;
    color: var(--light-grey);
}

.upload-form input[type="file"] {
    display: none;
}

.upload-form .label-file {
    background-color: var(--gold);
    color: var(--dark-blue);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.upload-form .label-file:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 195, 0, 0.3);
}

.upload-form button {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem; /* Marge pour la vue desktop */
}

.upload-form button:hover {
    background-color: var(--gold);
    color: var(--dark-blue);
}

.upload-message {
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
}

/* --- NOUVEAU : Styles pour la prévisualisation --- */
#file-preview {
    width: 100%;
    max-width: 300px;
    height: 300px;
    border: 3px dashed var(--gold);
    border-radius: 15px;
    margin: 0 auto 1.5rem auto;
    display: none; /* Caché par défaut */
    padding: 10px;
}

#file-preview img,
#file-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* --- Grille photo moderne --- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.photo-item img,
.photo-item video {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 15px;
    transition: transform 0.4s ease, filter 0.4s ease;
    vertical-align: middle;
}

.photo-item img:hover,
.photo-item video:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* --- OPTIMISATION POUR MOBILES --- */
@media (max-width: 550px) {
    .upload-form .label-file,
    .upload-form button {
        display: block;
        margin: 0 auto 1rem auto;
        width: 90%;
        max-width: 300px;
    }
}

/* --- Animation Post-Upload --- */
.photo-item.highlight {
    animation: highlight-photo 2.5s ease-out;
}

@keyframes highlight-photo {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 195, 0, 0);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px 10px rgba(255, 195, 0, 0.7);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 195, 0, 0);
    }
}

/* Animation pour le bouton "Envoyer" après sélection */
.upload-form button.highlight-send {
    animation: pulse-button 1.5s infinite;
}

@keyframes pulse-button {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}