/* Réinitialisation des styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrer le contenu */
    padding-top: 30px; /* Ajout d'un espace en haut de la page */
    position: relative;
    background-color: #000; /* Fallback color */
}

/* Vidéo en arrière-plan */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* Assombrit légèrement la vidéo pour améliorer la lisibilité */
}

/* Logo transparent statique */
.logo-container {
    
    position: static;
    margin: 0 auto 40px;
    text-align: center;
    z-index: 100;
}

.logo {
    
    max-width: 800px;
    height: auto;
    filter: brightness(1.2) opacity(0.7);
    transition: filter 0.3s ease;
    margin-top: -3rem;

}

.logo:hover {
    filter: brightness(1.5) opacity(1);
}

/* Mosaïque plus large et moins haute */
.image-mosaic {
    top: -11rem; 
    display: grid;
    grid-template-columns: repeat(20, 1fr); /* Plus de colonnes pour plus de largeur */
    grid-auto-rows: minmax(30px, auto); /* Réduction de la hauteur minimale */
    gap: 6px;
    margin: 10px auto 20px; /* Réduit la marge supérieure puisque le logo n'est plus fixe */
    max-width: 960px; /* Plus large que les 640px précédents */
    padding: 8px;
    position: relative;
}

/* Styles de base pour tous les éléments de la mosaïque */
.mosaic-item {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0.1s;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.mosaic-item:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 3px 12px rgba(123, 67, 151, 0.6);
    z-index: 10;
}

.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.mosaic-item:hover img {
    transform: scale(1.1);
}

/* Définition des tailles et positions des éléments - réorganisés pour être plus larges et moins hauts */
.mosaic-item:nth-child(1) {
    grid-column: 1 / span 7;
    grid-row: 1 / span 3;
    transform: rotate(-0.5deg);
    z-index: 3;
}

.mosaic-item:nth-child(2) {
    grid-column: 8 / span 6;
    grid-row: 1 / span 3;
    transform: rotate(0.5deg);
    z-index: 2;
}

.mosaic-item:nth-child(3) {
    grid-column: 14 / span 7;
    grid-row: 1 / span 3;
    transform: rotate(0.7deg);
    z-index: 4;
}

.mosaic-item:nth-child(4) {
    grid-column: 1 / span 10;
    grid-row: 4 / span 3;
    transform: rotate(-0.3deg);
    z-index: 1;
}

.mosaic-item:nth-child(5) {
    grid-column: 11 / span 5;
    grid-row: 4 / span 3;
    transform: rotate(-0.5deg);
    z-index: 2;
}

.mosaic-item:nth-child(6) {
    grid-column: 16 / span 5;
    grid-row: 4 / span 3;
    transform: rotate(0.4deg);
    z-index: 3;
}

/* Animation pour les images */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mosaic-item {
    animation: fadeIn 0.8s ease-in-out forwards;
    opacity: 0;
}

/* Délai d'animation pour chaque image */
.mosaic-item:nth-child(1) { animation-delay: 0.1s; }
.mosaic-item:nth-child(2) { animation-delay: 0.2s; }
.mosaic-item:nth-child(3) { animation-delay: 0.3s; }
.mosaic-item:nth-child(4) { animation-delay: 0.4s; }
.mosaic-item:nth-child(5) { animation-delay: 0.5s; }
.mosaic-item:nth-child(6) { animation-delay: 0.6s; }

/* Image overlay pour affichage plein écran */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-overlay.visible {
    opacity: 1;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border: 2px solid white;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* Footer styles */
footer {
    text-align: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    backdrop-filter: blur(15px);
    margin-top: 11rem;
    border-radius: 4px;
    max-width: 960px; /* Correspondant à la largeur de la mosaïque */
    margin-left: auto;  
    margin-right: auto;
    
    font-size: 0.8em;
    z-index: 5;
}

/* Effet de profondeur sur la mosaïque */
.mosaic-item:nth-child(odd) {
    transform-origin: bottom right;
}

.mosaic-item:nth-child(even) {
    transform-origin: bottom left;
}

.mosaic-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Keyframes pour l'animation du dégradé de texte */
@keyframes textShine {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Texte Weather superposé sur la mosaïque avec dégradé */
.textWeather {
    position: relative;
    margin-top: -800px; /* Valeur négative pour remonter le texte sur la mosaïque */
    width: 90%;
    max-width: 1200px;
    text-align: center;
    font-size: 1.8rem;
    line-height: 1.5;
    z-index: 50; /* S'assure qu'il est au-dessus des images */
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    text-justify:newspaper;     
    
    color: #fff;

}


.logo-aone {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.logo-hao {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}   


/* ====================== MEDIA QUERIES AMÉLIORÉES ====================== */
/* Tablettes moyennes à grandes et petits ordinateurs */
@media (max-width: 1024px) {
    .image-mosaic {
        grid-template-columns: repeat(12, 1fr);
        max-width: 800px;
        gap: 8px;
    }
    
    .mosaic-item:nth-child(1) {
        grid-column: 1 / span 4;
        grid-row: 1 / span 2;
    }
    
    .mosaic-item:nth-child(2) {
        grid-column: 5 / span 4;
        grid-row: 1 / span 2;
    }
    
    .mosaic-item:nth-child(3) {
        grid-column: 9 / span 4;
        grid-row: 1 / span 2;
    }
    
    .mosaic-item:nth-child(4) {
        grid-column: 1 / span 6;
        grid-row: 3 / span 2;
    }
    
    .mosaic-item:nth-child(5) {
        grid-column: 7 / span 6;
        grid-row: 3 / span 2;
    }
    
    .mosaic-item:nth-child(6) {
        grid-column: 3 / span 8;
        grid-row: 5 / span 2;
    }
    
    .textWeather {
        margin-top: -125px;
        font-size: 1.8rem;
        padding: 15px;
        max-width: 900px;
    }
}

/* Tablettes et grands smartphones */
@media (max-width: 768px) {
    body {
        padding: 15px 10px;
    }
    
    .logo {
        max-width: 600px;
    }
    
    .logo-container {
        margin-bottom: 20px;
    }
    
    .image-mosaic {
        grid-template-columns: repeat(8, 1fr);
        max-width: 600px;
        gap: 6px;
    }
    
    .mosaic-item:nth-child(1) {
        grid-column: 1 / span 4;
        grid-row: 1 / span 2;
    }
    
    .mosaic-item:nth-child(2) {
        grid-column: 5 / span 4;
        grid-row: 1 / span 2;
    }
    
    .mosaic-item:nth-child(3) {
        grid-column: 1 / span 4;
        grid-row: 3 / span 2;
    }
    
    .mosaic-item:nth-child(4) {
        grid-column: 5 / span 4;
        grid-row: 3 / span 2;
    }
    
    .mosaic-item:nth-child(5) {
        grid-column: 1 / span 4;
        grid-row: 5 / span 2;
    }
    
    .mosaic-item:nth-child(6) {
        grid-column: 5 / span 4;
        grid-row: 5 / span 2;
    }
    
    .textWeather {
        margin-top: -100px;
        font-size: 1.9rem;
        padding: 15px;
        width: 95%;
        max-width: 580px;
        line-height: 1.4;
    }
    
    footer {
        max-width: 600px;
        margin-top: 30px;
        padding: 8px;
    }
}

/* Smartphones en mode paysage */
@media (max-width: 667px) {
    .image-mosaic {
        grid-template-columns: repeat(6, 1fr);
        max-width: 500px;
        gap: 5px;
    }
    
    .mosaic-item {
        border-width: 1px;
    }
    
    .mosaic-item:nth-child(1), 
    .mosaic-item:nth-child(2),
    .mosaic-item:nth-child(3),
    .mosaic-item:nth-child(4),
    .mosaic-item:nth-child(5),
    .mosaic-item:nth-child(6) {
        transform: rotate(0deg);
    }
    
    .textWeather {
        margin-top: -90px;
        font-size: 1.5rem;
        padding: 12px;
        width: 95%;
        line-height: 1.3;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    body {
        padding: 10px 5px;
    }
    
    .logo {
        max-width: 280px;
    }
    
    .logo-container {
        margin-bottom: 15px;
    }
    
    .image-mosaic {
        margin-top: 6rem; /* Ajustement de la position */
        grid-template-columns: repeat(2, 1fr);
        max-width: 320px;
        gap: 5px;
    }
    
    .mosaic-item:nth-child(1) {
        grid-column: 1 / span 2;
        grid-row: 1 / span 2;
    }
    
    .mosaic-item:nth-child(2) {
        grid-column: 1;
        grid-row: 3 / span 1;
    }
    
    .mosaic-item:nth-child(3) {
        grid-column: 2;
        grid-row: 3 / span 1;
    }
    
    .mosaic-item:nth-child(4) {
        grid-column: 1 / span 2;
        grid-row: 4 / span 2;
    }
    
    .mosaic-item:nth-child(5) {
        grid-column: 1;
        grid-row: 6 / span 1;
    }
    
    .mosaic-item:nth-child(6) {
        grid-column: 2;
        grid-row: 6 / span 1;
    }
    
    .textWeather {
        margin-top: -250px;
        font-size: 1.5rem;
        padding: 10px;
        width: 98%;
        max-width: 310px;
        line-height: 1.3;
        border-radius: 6px;
      
    }
    
    footer {
        max-width: 320px;
        margin-top: 15px;
        padding: 6px;
        font-size: 0.7em;
    }
    
    /* Ajuster la vidéo sur mobile */
    #background-video {
        object-position: center;
    }
}

/* Petits smartphones */
@media (max-width: 375px) {
    .image-mosaic {
        max-width: 280px;
        gap: 4px;
    }
    
    .textWeather {
        margin-top: -250px;
        font-size: 1.5rem;
        padding: 8px;
        max-width: 270px;
    }
    
    footer {
        max-width: 280px;
    }
}

/* Très petits écrans */
@media (max-width: 320px) {
    .image-mosaic {
        max-width: 250px;
        gap: 3px;
    }
    
    .mosaic-item {
        border-width: 1px;
    }
    
    .textWeather {
        margin-top: -200px;
        font-size: 1.4rem;
        padding: 6px;
        max-width: 240px;
    }
    
    footer {
        max-width: 250px;
        font-size: 0.65em;
    }
}