html {
    height: 100%;
    padding: 0;
    margin: 0;
}

body {
    background-color: #112;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    color: white;
    height: 100%;
    padding: 0;
    margin: 0;
}

#topPage {
    background-color: #223;
    Padding: 10px;
    margin: 0;
}

h1 {
    font-size: 2.5em;
    margin: 5px 5px 0 5px;
    text-align: center;
}

h2 {
    font-size: 1.2em;
    text-align: center;
    margin: 0 5px 5px 5px;
}

#newGoalButton {
    margin: 10px;
    font-size: 1.2em;
    padding: 10px;
    font-weight: bold;
    border-radius: 15px;
    border: none;
    background-color: #EEF;
    display: flex;
    gap: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#newGoalButton:hover {
    background-color: #CCF;
}

nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    flex-direction: row;
    margin: 0 5px 5px 5px;
}

.material-symbols-rounded {
    padding: 0 0 0 0;
}

nav a {
    margin: 5px;
    font-size: 1.2em;
    padding: 10px;
    font-weight: bold;
    border-radius: 15px;
    border: none;
    color: white;
    background-color: #334;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #445;
}

#topPageActions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

#topPageActions > *:first-child {
    margin-right: auto;
}

#loginSection {
    display: flex;
    background-color: #112;
    border-radius: 20px;
    width: fit-content;
}

#loginSection button {
    font-size: 1.2em;
    padding: 10px;
    font-weight: bold;
    border: none;
    display: flex;
    gap: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#loginButton {
    background-color: #EEF;
    border-radius: 15px 5px 5px 15px;
    margin: 5px 2px 5px 5px;
}

#loginButton:hover {
    background-color: #CCF;
}

#registerButton {
    background-color: #EEF;
    border-radius: 5px 15px 15px 5px;
    margin: 5px 5px 5px 2px;
}

#registerButton:hover {
    background-color: #CCF;
}

.goalCard {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.goalCard:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#mainContent {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    flex: 1;
    padding: 10px;
    box-sizing: border-box;
}

#mainContent > * {
    flex: 0 0 calc(33.333% - 20px);
    width: calc(33.333% - 20px);
    box-sizing: border-box;
    max-width: calc(33.333% - 20px);
}

.goalCard {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 10px;
    padding: 10px;
    border-radius: 20px;
    background-color: #334;
}
.goalEmoji {
    font-size: 3em;
    background-color: #223;
    padding: 10px;
    border-radius: 15px;
    margin-right: 10px;
}

.goalText {
    border-left: 1px solid #667;
    padding: 10px;
}

.goalText button {
    margin: 5px;
    font-size: 1.2em;
    padding: 10px;
    font-weight: bold;
    border-radius: 15px;
    border: none;
    text-align: right;
    display: flex;
    gap: 5px;
    cursor: pointer;
    transition: background-color 0.3s, filter 0.3s;
}

#routineValidation {
    background-color: #9E9;
}

#routineValidation:hover {
    background-color: #7C7;
}

#abstinenceValidation {
    background-color: #E99;
}

#abstinenceValidation:hover {
    background-color: #C77;
}

#objectifValidation {
    background-color: #9E9;
}

#objectifValidation:hover {
    background-color: #7C7;
}

#deadlineValidation {
    background-color: #EE9;
}

#deadlineValidation:hover {
    background-color: #CC7;
}

.goalTitle {
    font-size: 1.5em;
    text-align: left;
    font-weight: bold;
}

.goalType {
    font-size: 1em;
    text-align: center;
    font-weight: bold;
    color: #99A;
    padding: 2px 7px 2px 7px;
    background-color: #223;
    border-radius: 10px;
    align-self: flex-start;
    width: fit-content;
}

.modalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Fond noir semi-transparent */
    backdrop-filter: blur(8px);      /* LE FLOU MAGIQUE ICI ! 🔮 */
    z-index: 1000;                   /* Pour être sûr d'être au-dessus de tout */

    /* Centrer la modale au milieu */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* La classe pour cacher la modale */
.hidden {
    opacity: 0;
    pointer-events: none; /* Empêche de cliquer quand c'est invisible */
}

/* Le style de la fenêtre contextuelle elle-même */
.modalContent {
    background-color: #2e2e3e; /* Une couleur sombre comme ton thème */
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    min-width: 300px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#newGoalForm, #authForm {
    display: flex;
    flex-direction: column;
}

.modalContent h2 {
    font-size: 2em;
}

#newGoalForm label, #authForm label {
    margin-top: 10px;
    font-size: 1.2em;
    margin-bottom: 5px;
}

input {
    padding: 10px;
    border-radius: 15px;
    border: none;
    font-family: 'Roboto', sans-serif;
    font-size: 1.2em;
    margin-bottom: 10px;
    background-color: #112;
    color: white;
}

#goalEmojiField {
    width: 20px;
}

select {
    padding: 10px;
    border-radius: 15px;
    border: none;
    font-size: 1.2em;
    margin-bottom: 10px;
    background-color: #112;
    color: white;
}

textarea {
    padding: 10px;
    border-radius: 15px;
    border: none;
    font-family: 'Roboto', sans-serif;
    font-size: 1.2em;
    margin-bottom: 10px;
    background-color: #112;
    color: white;
    resize: none;
    height: 100px;
}

.modalButtons {
    display: flex;
    justify-content: flex-end;
}

#close-modal, #close-auth-modal {
    background-color: #E99;
    margin: 5px;
    font-size: 1.2em;
    padding: 10px;
    font-weight: bold;
    border-radius: 15px;
    border: none;
    text-align: right;
    display: flex;
    gap: 5px;
    cursor: pointer;
    transition: background-color 0.3s, filter 0.3s;
}

#close-modal:hover, #close-auth-modal:hover {
    background-color: #C77;
}

#newGoalSubmit, #authSubmit {
    background-color: #9E9;
    margin: 5px;
    font-size: 1.2em;
    padding: 10px;
    font-weight: bold;
    border-radius: 15px;
    border: none;
    text-align: right;
    display: flex;
    gap: 5px;
    cursor: pointer;
    transition: background-color 0.3s, filter 0.3s;
}

#newGoalSubmit:hover, #authSubmit:hover {
    background-color: #7C7;
}

/* Styles pour la modale de détail */
#goalDetailHeader {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

#goalDetailHeader .goalEmoji {
    font-size: 3em;
    margin: 0;
}

#goalDetailHeader h2 {
    margin: 0;
    text-align: left;
    font-size: 1.8em;
}

#goalDetailDescription {
    font-size: 1.1em;
    color: #CCC;
    margin-bottom: 10px;
}

#goalDetailDate {
    font-style: italic;
    color: #99A;
    margin-bottom: 20px;
}

#eventSection {
    background-color: #112;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
}

#eventSection h3 {
    margin-top: 0;
    font-size: 1.2em;
}

.eventInputs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.eventInputs input, .eventInputs select {
    margin-bottom: 0;
    font-size: 1em;
    padding: 8px;
}

#addEventButton {
    background-color: #EEF;
    color: #112;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#addEventButton:hover {
    background-color: #CCF;
}

#eventList {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    max-height: 150px;
    overflow-y: auto;
}

#eventList li {
    background-color: #223;
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 5px;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
}

#goalActions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    background-color: #334;
    color: white;
    transition: background-color 0.3s;
}

.btn-action:hover {
    background-color: #445;
}

.btn-danger {
    color: black;
    background-color: #E99;
}

.btn-danger:hover {
    color: black;
    background-color: #C77;
}

.username-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 15px;
    font-size: 1.1em;
    color: #EEF;
}

.btn-logout {
    background-color: #E99 !important;
    border-radius: 0 15px 15px 0 !important;
    margin: 5px 5px 5px 0 !important;
}

.btn-logout:hover {
    background-color: #C77 !important;
}

#settingsButton {
    background-color: #334;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 10px;
}

#settingsButton:hover {
    background-color: #445;
}

.settings-section {
    border-top: 1px solid #445;
    padding-top: 15px;
    margin-bottom: 15px;
}

.settings-section h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: #99A;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-primary {
    background-color: #EEF;
    color: #112;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: #CCF;
}

.btn-disabled {
    background-color: #556 !important;
    color: #99A !important;
    cursor: not-allowed !important;
    filter: grayscale(0.8);
}

.goal-finished {
    filter: grayscale(1) opacity(0.7);
    pointer-events: auto; /* Permettre le clic pour la modale (suppression) */
}

.event-notable {
    display: flex;
    gap: 10px;
    align-items: center;
}

.event-feeling {
    font-size: 1.5em;
    background-color: #112;
    padding: 5px;
    border-radius: 10px;
}

.event-info {
    display: flex;
    flex-direction: column;
}

.event-name {
    margin: 0;
    font-weight: bold;
}

.event-date {
    margin: 0;
    font-size: 0.8em;
    color: #99A;
}
