@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

header {
    width: 100%;
    max-width: 1200px; /* Pour s'aligner aux cartes météo */
    display: flex;
    justify-content: flex-end; /* Pousse le bouton de contact à droite */
    padding: 20px 0;
}

header input {
    background: transparent ;
    color:white;
    border: 0;
    border-bottom: 1px solid gray;;
    outline: 0;
    height: 2em;
    align-self: center;
    margin-right: 20px;
    text-transform: capitalize;
    text-indent: 1em; 
    
}

header input:focus {

    transition: 1s;
    border-color: white;

}

.btn-contact {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
}

/* Couleurs de l'effect Shimmer du bouton */
.btn-contact{

    background: -moz-linear-gradient(-45deg,  rgba(8, 34, 84, 0) 0%, rgba(8, 34, 84, 0) 40%, rgba(255,255,255,0.2) 50%, rgba(8, 34, 84, 0), rgba(8, 34, 84, 0));
    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(8, 34, 84, 0)), color-stop(40%,rgba(8, 34, 84, 0)), color-stop(50%,rgba(255,255,255,0.2)), color-stop(60%,rgba(8, 34, 84, 0)), color-stop(100%,rgba(8, 34, 84, 0)));
    background: -webkit-linear-gradient(-45deg,  rgba(8, 34, 84, 0) 0%,rgba(8, 34, 84, 0) 40%,rgba(255,255,255,0.2) 50%,rgba(8, 34, 84, 0) 60%,rgba(8, 34, 84, 0) 100%);
    background: -o-linear-gradient(-45deg,  rgba(8, 34, 84, 0) 0%,rgba(8, 34, 84, 0) 40%,rgba(255,255,255,0.2) 50%,rgba(8, 34, 84, 0) 60%,rgba(8, 34, 84, 0) 100%);
    background: -ms-linear-gradient(-45deg,  rgba(8, 34, 84, 0) 0%,rgba(8, 34, 84, 0) 40%,rgba(255,255,255,0.2) 50%,rgba(8, 34, 84, 0) 60%,rgba(8, 34, 84, 0) 100%);
    background-position:0px;
    background-size:300%;  

}

.btn-contact:hover{
    animation:light 2s;
    -webkit-animation:light 1s;

  
}

body {
    position:relative;
    background: #082254;
    background: linear-gradient(36deg, rgba(8, 34, 84, 1) 0%, rgba(3, 21, 44, 1) 80%);
    color: white;
    display: flex;
    justify-content: flex-start;
    align-items: center; 
    flex-direction: column;
    /* min-height centrage vertical parfait sur toute la page */
    min-height: 100vh; 
    /* inutile maintenant mais je le garde pour moi */
    background-attachment: fixed;
    animation: gradient 15s ease infinite;
}

/* Le conteneur de pluie invisible qui couvre tout l'écran */
.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Empêche la pluie de bloquer les clics sur tes boutons */
    z-index: 999; /* S'affiche par-dessus tout */
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Quand le body a la classe pluie, on affiche la zone de pluie */
body.pluie *.rain-container, body.averse *.rain-container 
{
    opacity: 1;
}

/* Création d'une goutte (petite ligne blanche verticale) */
.drop {
    position: absolute;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.4));
    width: 1px;
    height: 20px;
    opacity: 0.7;
    animation: fall linear infinite;
}



main {
    display: flex;
    flex-direction: column; 
    /* limitation de la largeur maximale */
    max-width: 900px;
    width: 100%;
}

@media (min-width: 1400px) {
    main {
        /* Centrage vertical au milieu de l'écran */
        margin: auto;
        /* Élargissement du conteneur central */
        max-width: 1050px;
        /* Agrandissement global du contenu de 5% */
        transform: scale(1.05);
    }
}

.dashboard {
    display: flex;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    /* Sépare des cartes de prévision meteo*/
    margin-bottom: 2em; 
}

.cartesDuHaut {
    display: flex;
    gap: 2em;
    /* Pour que les cartes prennent toute la largeur du main */
    width: 100%; 
}

/* Ephemeride (Carte 1)*/
.carte {
    
    background: #3b4e65; 
    background: rgba(59, 78, 101, 0.20) ;    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0);
    flex: 1;
    /* Flou d'arrière-plan */
    backdrop-filter: blur(10px); 

    position: relative; /*  pour placer la lumière par dessus */
    overflow: hidden; /* Empêche la lumière de déborder de la carte */
}

/* 1. On prépare la carte de base */
.carte {
    background: #3b4e65; 
    background: rgba(59, 78, 101, 0.20) ;    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 30px;
    flex: 1;
    backdrop-filter: blur(10px); 
    
    position: relative; /*  pour placer la lumière par dessus */
    overflow: hidden; /* Empêche la lumière de déborder de la carte */
}

.carte::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        800px circle at var(--x) var(--y), 
        rgba(255, 255, 255, 0.10), 
        transparent 30% 
    );
    opacity: 0; /* Caché par défaut */
    transition: opacity 0.8s ease; /* Apparition en douceur */
    pointer-events: none; 
}

.carte:hover::before {
    opacity: 1;
}



#titre {
    font-size: 28px;
    font-weight: 600;   
}

.ephemeride h2 {
    font-size: 22px;
    font-weight: 400;
    margin-top: 0.1em;
    margin-bottom: 1em; 
}

.ephemeride p {
    margin-top: 0.1em; 
    font-weight: normal;
}
.heure {
    display: flex;
    flex-direction: row;
}

.ephemeride .details {
    font-size: 14px;
    line-height: 1.8; 
}

.ephemeride .fete {
    font-size: 14px;
    font-weight: 500;
    margin-top: 1em; 
}

/* Température actuelle (Carte 2)*/
.carte.donneesMeteo {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Partie haute de la carte */
.temp {
    display: flex;
    align-items: center;
    /* Espacement entre l'icône et le texte */
    gap: 30px; 
    padding-top: 2.5em;
    padding-left: 3.8em;
    /* Met la température actuel et l'icone au début de la boite justify-content:center pour centrer */
    justify-content: flex-start;
    
    
}

/* texte */
.LiveTemp {
    display: flex;
    flex-direction: column;
    /* Alignement du texte à gauche par rapport au bloc temp */
    align-items: flex-start; 
    justify-content: center;
    

    
}

div.LiveTemp span.actuellement {
    font-size: 16px; 
    margin-bottom: -5px; /* Rapproche le mot de la température */
}

/* Température actuelle */
.temperature {
    display: flex;
    flex-direction: row;
    /* MODIFIÉ : Température beaucoup plus grosse */
    font-size: 54px; 
    font-weight: 600;
}

/* Cible spécifiquement le conteneur de la grande icône */
div.temp .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    
}

/* Cible l'image elle-même pour qu'elle soit bien visible */
div.temp .icon img {
    width: 90px;
    height: auto;
}

/* anime l'image */
div.temp div.icon {
    animation: flottaison 4s ease-in-out infinite;
}

/* Donnees de température (Carte 2) */
.donneesTemp {
    display: flex;
    flex-direction: row;
    /* MODIFIÉ : Espacement régulier et centré */
    justify-content: space-around; 
    align-items: center;
    width: 100%;
    margin-top: 20px; 
}

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

/* Classes pour styliser Min et Max correctement */
.donnees-label {
    font-size: 18px;
    margin-bottom: 5px;
}

.donnees-value {
    font-size: 26px;
    font-weight: 500;
}

/* Données prévision météo */
.prevision {
    display: flex;
    width: 100%;
    /* centrage */
    justify-content: center; 
}

.previsionMeteo {
    display: grid;
    width: 100%;
    /* 2 colonnes égales au lieu de 49% */
    grid-template-columns: 1fr 1fr; 
    /* Espacement correct entre les elements de la grille */
    column-gap: 50px; 
    row-gap: 30px;
    padding: 1em 2em;
    
}

.grid-item {
    /* utilisation de flexbox pour aligner le texte et l'image de chaque jour */
    display: flex;
    align-items: center;
    justify-content: space-between; 
    font-size: 18px;
    font-weight: 500;
}

/* Le jour prend l'espace à gauche */
.grid-item .jour {
    flex: 1;
    text-align: left;
}

/* La condition prend l'espace à droite */
.grid-item .condition {
    flex: 1;
    text-align: left;
}

.grid-item img.icon {
    /* Taille contrôlée pour les petites icônes des prévisions */
    width: 45px; 
    height: auto;
    /* Marge droite/gauche pour centrer l'icône entre les textes */
    margin: 0 20px; 
}

/* --- MODALE --- */

/* arrière-plan sombre qui couvre tout l'écran */
.modale-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* le modale passe au-dessus de tout le reste */
    
    /* Caché par défaut */
    opacity: 0;
    pointer-events: none; 
    transition: opacity 0.3s ease;
}

.modale-overlay.actif {
    opacity: 1;
    pointer-events: auto;
}

/* La fenêtre de contact elle-même */
.modale-contenu {
    
    background: rgb(3, 21, 44);
    padding: 10vh;
    padding-bottom:10vh;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);

}

.modale-contenu h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
}

.modale-contenu p {
    text-align: center;
    font-size: 18px;
    margin-bottom: 30px;
}

.btn-fermer {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

/* --- LE FORMULAIRE --- */
#formulaireContact {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#formulaireContact input,
#formulaireContact textarea {
    width: 60%; 
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #d9d9d9; 
    color: #333;
    font-size: 16px;
    outline: none;
}

/* Le bouton Envoyer */
.btn-envoyer {
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    align-self: flex-end; 
    width: 35%; 
    padding: 15px;
    margin-top: -100px; 
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;

}

/* Couleurs de l'effect Shimmer du bouton */
.btn-envoyer {

    background: -moz-linear-gradient(-45deg,  rgba(8, 34, 84, 0.3) 0%, rgba(8, 34, 84, 0.3) 40%, rgba(255,255,255,0.2) 50%, rgba(8, 34, 84, 0.3), rgba(8, 34, 84, 0.3));
    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(8, 34, 84, 0.3)), color-stop(40%,rgba(8, 34, 84, 0.3)), color-stop(50%,rgba(255,255,255,0.2)), color-stop(60%,rgba(8, 34, 84, 0.3)), color-stop(100%,rgba(8, 34, 84, 0.3)));
    background: -webkit-linear-gradient(-45deg,  rgba(8, 34, 84, 0.3) 0%,rgba(8, 34, 84, 0.3) 40%,rgba(255,255,255,0.2) 50%,rgba(8, 34, 84, 0.3) 60%,rgba(8, 34, 84, 0.3) 100%);
    background: -o-linear-gradient(-45deg,  rgba(8, 34, 84, 0.3) 0%,rgba(8, 34, 84, 0.3) 40%,rgba(255,255,255,0.2) 50%,rgba(8, 34, 84, 0.3) 60%,rgba(8, 34, 84, 0.3) 100%);
    background: -ms-linear-gradient(-45deg,  rgba(8, 34, 84, 0.3) 0%,rgba(8, 34, 84, 0.3) 40%,rgba(255,255,255,0.2) 50%,rgba(8, 34, 84, 0.3) 60%,rgba(8, 34, 84, 0) 100%);
    background-position:0px;
    background-size:300%;  

}

.btn-envoyer:hover{
    animation:light 2s;
    -webkit-animation:light 1s;
}


/* Site sur mobile */
@media (max-width: 768px) {
    
    .cartesDuHaut {
        flex-direction: column; 
        gap: 1.5em; 
    }

    .temperature {
        font-size: 40px; 
    }
    .carte {
        margin-inline: 3vh;
    }
    
    div.temp .icon img {
        width: 70px;
    }

    .previsionMeteo {
        grid-template-columns: 1fr; /* Une seule fraction qui prend 100% de la largeur */
        row-gap: 20px; /* Espace entre les lignes */
        padding: 1em; /* On réduit un peu les marges intérieures sur mobile */
    }

    header {
        justify-content: center; 
    }

    #formulaireContact input, #formulaireContact textarea, .btn-envoyer {
        width: 100%;
    }

    #modale-contact {
        margin-block: 20px;
    }
    .btn-envoyer {
        margin-top: 10px;
    }
}


/* Animations */
/* animation glow des cartes*/
@keyframes light {
  0% {
        background-position:-600px; 
  }
  100% { 
        background-position:0px; 
  }
}
/* animation de pluie*/
@keyframes fall {
    from{
        transform: translateY(-20px);
    }to{
        transform:translateY(105vh          );
    }
}

/*animation icone de température actuelle*/
@keyframes flottaison {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); } 
    100% { transform: translateY(0px); }
}