/* Media Queries pour la responsiveness */

/* Très grands écrans (Optionnel, au dessus de 1200px c'est le défaut 3 col) */

/* Paliers tous les 200px selon la demande utilisateur */

/* Écrans Larges (Tablettes Paysage / Petits écrans PC) */
@media screen and (max-width: 1200px) {
    #mainContent > * {
        flex: 0 0 calc(50% - 20px);
        width: calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

/* Écrans Moyens (Tablettes Portrait) */
@media screen and (max-width: 1000px) {
    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.1em;
    }

    #topPage {
        padding: 5px;
    }

    #topPageActions {
        gap: 5px;
    }

    /* Masque les labels sur les écrans étroits pour gagner de la place */
    #newGoalButton .label, #loginButton .label, #registerButton .label {
        display: none;
    }

    #newGoalButton, #loginButton, #registerButton {
        padding: 10px 12px;
    }

    #mainContent > * {
        flex: 0 0 calc(50% - 20px);
        width: calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

/* Petites Tablettes / Grands Téléphones */
@media screen and (max-width: 800px) {
    h1 {
        font-size: 1.8em;
    }

    #mainContent {
        flex-direction: column;
    }

    #mainContent > * {
        flex: 0 0 calc(100% - 20px);
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
    }

    .goalCard {
        margin: 10px;
    }

    .modalContent {
        width: 85%;
        padding: 1.5rem;
    }
}

/* Téléphones Standard */
@media screen and (max-width: 600px) {
    h1 {
        font-size: 1.5em;
    }

    nav {
        justify-content: center;
        gap: 5px;
    }

    nav a {
        font-size: 1em;
        padding: 8px 12px;
    }

    .goalCard {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .goalEmoji {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .goalText {
        border-left: none;
        border-top: 1px solid #667;
        padding-top: 15px;
        width: 100%;
    }

    .goalType {
        align-self: center;
    }

    .eventInputs {
        flex-direction: column;
    }

    #goalActions {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
    }
}

/* Petits Téléphones */
@media screen and (max-width: 400px) {
    h1 {
        font-size: 1.3em;
    }

    #topPageActions {
        flex-wrap: wrap;
        justify-content: center;
    }

    #loginSection {
        width: 100%;
        justify-content: center;
    }

    #newGoalButton {
        margin-right: 0 !important; /* Force l'alignement central */
    }

    .modalContent {
        width: 95%;
        padding: 1rem;
    }

    .modalContent h2 {
        font-size: 1.5em;
    }

    input, select, textarea {
        font-size: 1em;
    }
}
