/* 
   OBJECTIFS.CSS — Styles spécifiques à objectifs.html
 */


/* -
   CONTAINER PRINCIPAL DE LA PAGE
   flex:1 = prend tout l'espace entre le haut et le footer
  sticky footer pattern de global.css).
   display:flex + flex-direction:column pour que .Container
   puisse utiliser flex:1 à son tour.
   */
#Container-Principal {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/*
   LA GRILLE CSS GRID PRINCIPALE
   
   Visualisation des zones (4 colonnes × 4 rangées) :
   ┌──────────────┬──────────────────────────────────┐
   │  Calendrier  │          Graphique               │
   ├──────────────┤                                  │
   │   Objectif   │          Graphique               │
   │              ├──────────────────────────────────┤
   │   Objectif   │           Habits                 │
   │              │                                  │
   │   Objectif   │           Habits                 │
   └──────────────┴──────────────────────────────────┘
*/
.Container {
    display: grid;
    grid-template-areas:
        "Calendrier Graphique Graphique Graphique"
        "Objectif   Graphique Graphique Graphique"
        "Objectif   Habits    Habits    Habits"
        "Objectif   Habits    Habits    Habits";

    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr 1fr;

    gap: 20px;
    background-color: #f0f4f8;
    padding: 70px 25px 25px 25px; /* padding-top = passe sous le hamburger fixe */

    flex: 1;            /* Prend toute la hauteur disponible dans #Container-Principal */
    box-sizing: border-box;
    min-height: 0;      /* Fix: empêche la grille de déborder dans un contexte flex */
}


/* ------------------------------------------------------------
   STYLE COMMUN DES CARTES (Soft UI)
   box-shadow crée la profondeur sans bordure visible. L'effet contraste blanc sur blanc
   overflow:hidden empêche le contenu de dépasser les coins arrondis.
   ------------------------------------------------------------ */
.Objectif, .Graphique, .Habits, .Calendrier {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;  
    min-height: 0;    
}

.Objectif:hover, .Graphique:hover, .Habits:hover, .Calendrier:hover {
    transform: scale(1.01);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    z-index: 2;
}


/* 
   CALENDRIER (case 0,0)
 */
.Calendrier {
    grid-area: Calendrier;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.calendar-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.calendar header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.header-display p {
    color: #1E90FF;
    margin: 5px;
    font-size: 1.1rem;
    font-weight: bold;
}

.calendar pre {
    padding: 5px;
    margin: 0;
    cursor: pointer;
    font-size: 1.1rem;
    color: black;
}

.days, .week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
}

.week div, .days div {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 2.2rem;
    border-radius: 50%;
    font-family: Arial, sans-serif;
    font-size: 0.8rem;
}

.days div:hover {
    background: #f0f4f8;
    color: #1E90FF;
    cursor: pointer;
}

.week div {
    opacity: 0.5;
    font-weight: bold;
}

.display-selected {
    text-align: center;
    margin-top: auto;
    font-family: var(--font-text);
    font-size: 13px;
    color: #888;
}


/* 
   OBJECTIFS (colonne gauche, 3 rangées)
   overflow-y:auto = scroll interne élégant si contenu long.
 */
.Objectif {
    grid-area: Objectif;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 20px;
}

/* Scrollbar stylisés
*/
.Objectif::-webkit-scrollbar       { width: 3px; }
.Objectif::-webkit-scrollbar-track { background: #f0f4f8; }
.Objectif::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* Sous-cartes d'objectifs */
.Objectif-details {
    border-radius: 12px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.Objectif-details:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.Objectif-details h2 {
    font-family: var(--font-title);
    font-size: 0.95rem;
    margin: 0;
    color: #333;
    font-weight: 400;
}

.Objectif-details .description-courte {
    font-family: var(--font-text);
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin: 0;
}

.Objectif-details ul {
    font-family: var(--font-text);
    font-size: 11px;
    line-height: 1.6;
    margin: 0;
    padding-left: 14px;
    color: #666;
}


/*
   GRAPHIQUE (grande zone droite, 2 rangées)
   object-fit:cover sur l'image = remplit sans déformer.
 */
.Graphique {
    grid-area: Graphique;
    padding: 0;
    overflow: hidden;
    display: block;
    position: relative;
}

.Graphique img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;   
    object-position: center;
    transition: transform 0.5s ease;
}

.Graphique:hover img {
    transform: scale(1.03);
}


/* 
   HABITS — Habit Tracker (bas droite, 2 rangées)
   */
.Habits {
    grid-area: Habits;
    justify-content: center;
    align-items: center;
    padding: 20px 25px;
}

.habit-tracker-container {
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #f0f4f8;
    padding-bottom: 8px;
}

.tracker-header h3 {
    margin: 0;
    font-family: var(--font-title);
    font-size: 18px;
    color: #333;
}

.days-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 50%;
    max-width: 280px;
}

.days-labels span {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #888;
}

.tracker-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.habit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.habit-name {
    font-size: 13px;
    font-family: var(--font-text);
    color: #444;
    font-weight: bold;
}

.habit-dots {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 50%;
    max-width: 280px;
}

/* Checkbox customisée — cercle style Bullet Journal
   appearance:none supprime le rendu natif du navigateur.
   aspect-ratio:1/1 force la hauteur à être égale à la largeur → cercle parfait. */
.habit-dots input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px solid #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.habit-dots input[type="checkbox"]:hover {
    border-color: #1E90FF;
}

.habit-dots input[type="checkbox"]:checked {
    background-color: #1E90FF;
    border-color: #1E90FF;
    box-shadow: 0 0 8px rgba(30, 144, 255, 0.4);
}
