/*
   ========================
   1) Mise en page globale
   ========================
*/
html, body {
    margin: 100px;
    padding: 0;
    height: 100%;
    background: #121212;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* On aligne vers le haut */
    font-family: Arial, sans-serif;
    color: #fff;
}

h1 {
    margin: 100px 0 10px 0;
    font-size: 1.8em;
    text-align: center;
}

#intro {
    margin: 0 0 150px 0; /* pour ajouter espace entre coeur et premier texte */
    text-align: center;
    font-size: 1.1em;
}

/*
   ========================
   2) Conteneur du coeur
   ========================
*/
.heart-container {
    position: relative;
    width: 200px;
    height: 180px;
    margin-bottom: 120px; /* On met de l'espace au-dessous 
                           pour éloigner le bouton */
}

/*
   ========================
   3) Le coeur
   ========================
*/
.heart {
    position: relative;
    width: 200px;
    height: 180px;
    background: radial-gradient(circle, #b32424 25%, #800000 90%);
    transform: rotate(-45deg);
    cursor: pointer;
    
    animation: heart-appear 1.2s ease-out forwards,
               heart-pulse 2s infinite ease-in-out 1.4s;
    
    box-shadow: 0 0 20px rgba(179,36,36, 0.7);
}

.heart::before,
.heart::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 180px;
    background: radial-gradient(circle, #b32424 25%, #800000 90%);
    border-radius: 50%;
}

.heart::before {
    top: -100px;
    left: 0;
}

.heart::after {
    top: 0;
    left: 100px;
}

/*
   ========================
   4) Le texte au centre (mais plus haut)
   ========================
*/
.heart-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* On annule la rotation de -45° du parent */
    transform: rotate(0deg);
    transform-origin: center;

    /* On utilise flexbox pour positionner le texte vers le "haut" du cœur */
    display: flex;
    align-items: flex-start; /* Aligne en haut */
    justify-content: center;
    text-align: center;

    font-weight: bold;
    font-size: 1.7em;
    padding: -40px; /* Ajuste le padding pour descendre ou monter le texte */
    box-sizing: border-box;
    color: #fff;
    text-shadow: 2px 2px 4px #000;
}

/*
   ========================
   5) Bouton
   ========================
*/
#new-message-btn {
    background-color: #272727;
    color: #fff;
    border: 2px solid #555;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 30px; /* Plus d'espace en bas */
}

#new-message-btn:hover {
    background-color: #333;
}

/*
   ========================
   6) Animations
   ========================
*/
@keyframes heart-appear {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    100% {
        transform: scale(1) rotate(-45deg);
    }
}

@keyframes heart-pulse {
    0%, 100% {
        transform: scale(1) rotate(-45deg);
    }
    50% {
        transform: scale(1.05) rotate(-45deg);
    }
}

/* ====================================
   7) Styles Responsives pour Mobile
   ==================================== */
@media (max-width: 768px) {
    html, body {
        margin: 20px;
    }

    h1 {
        margin: 50px 0 10px 0;
        font-size: 2.5em;
    }

    #intro {
        margin: 0 0 100px 0;
        font-size: 1.3em;
    }

    .heart-container {
        width: 150px;
        height: 135px;
        margin-bottom: 80px;
    }

    .heart, .heart::before, .heart::after {
        width: 150px;
        height: 135px;
    }

    .heart-text {
        font-size: 2em;
        padding: -30px;
    }

    #new-message-btn {
        padding: 15px 20px;
        font-size: 1.2em;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    html, body {
        margin: 10px;
    }

    h1 {
        margin: 30px 0 10px 0;
        font-size: 3em;
    }

    #intro {
        margin: 0 0 80px 0;
        font-size: 1.5em;
    }

    .heart-container {
        width: 120px;
        height: 108px;
        margin-bottom: 60px;
    }

    .heart, .heart::before, .heart::after {
        width: 120px;
        height: 108px;
    }

    .heart-text {
        font-size: 2.5em;
        padding: -20px;
    }

    #new-message-btn {
        padding: 20px 25px;
        font-size: 1.5em;
        margin-bottom: 15px;
    }
}
