
/* ============================================================
   HEATMAP ANNUEL — V4.5
   ============================================================ */

.heatmap-content {
    min-height: 900px;
}

.heatmap-controls {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 15px 18px;
    margin-bottom: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.heatmap-control label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .7px;
}

.heatmap-control select {
    min-width: 150px;
    padding: 9px 34px 9px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
}

.heatmap-metric-control select {
    min-width: 240px;
}

.heatmap-info {
    margin-left: auto;
    text-align: right;
}

.heatmap-info span {
    display: block;
    font-size: 22px;
    font-weight: 850;
}

.heatmap-info strong {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.heatmap-card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.heatmap-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.heatmap-card-head h2 {
    font-size: 21px;
}

.heatmap-grid-wrap {
    display: grid;
    grid-template-columns: 76px 1fr;
    grid-template-rows: 24px auto;
    gap: 4px 8px;
}

.heatmap-months {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-rows: repeat(12, 34px);
}

.heatmap-month-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
}

.heatmap-days-header {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(31, 1fr);
    gap: 2px;
}

.heatmap-day-label {
    text-align: center;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
}

.heatmap-grid {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(31, 1fr);
    grid-template-rows: repeat(12, 34px);
    gap: 2px;
}

.heatmap-cell {
    position: relative;
    min-width: 0;
    border: 1px solid rgba(38,55,70,.12);
    border-radius: 3px;
    background: #eef2f5;
    cursor: crosshair;
    transition: transform .08s ease, box-shadow .08s ease;
}

.heatmap-cell.has-value:hover {
    transform: scale(1.12);
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

.heatmap-cell.invalid {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.heatmap-cell.missing {
    background: #f1f3f5;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 17px;
    color: var(--muted);
    font-size: 9px;
}

.heatmap-gradient {
    width: 280px;
    height: 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg,
        hsl(220, 75%, 55%),
        hsl(180, 70%, 55%),
        hsl(110, 70%, 55%),
        hsl(55, 90%, 55%),
        hsl(20, 90%, 55%),
        hsl(0, 80%, 50%)
    );
}

.heatmap-note {
    margin-top: 13px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
}

.heatmap-tooltip {
    position: fixed;
    z-index: 100000;
    display: none;
    min-width: 120px;
    padding: 7px 9px;
    border-radius: 7px;
    background: rgba(38,55,70,.97);
    color: #fff;
    font-size: 11px;
    pointer-events: none;
    box-shadow: 0 5px 18px rgba(0,0,0,.22);
}

.heatmap-tooltip strong {
    display: block;
    margin-top: 2px;
}


/* ============================================================
   V4.5.2 — CURSEUR DE LÉGENDE + VALEURS DANS LES CASES
   ============================================================ */

.heatmap-gradient-wrap {
    position: relative;
    width: 280px;
}

.heatmap-gradient-wrap .heatmap-gradient {
    width: 100%;
}

.heatmap-legend-marker {
    position: absolute;
    left: 0;
    top: -9px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--text);
    transform: translateX(-6px);
    opacity: 0;
    transition: left .06s linear, opacity .12s ease;
    pointer-events: none;
}

.heatmap-legend-marker.visible {
    opacity: 1;
}

.heatmap-cell-value {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1px;
    color: #173042;
    font-size: 8px;
    font-weight: 850;
    line-height: 1;
    text-align: center;
    text-shadow:
        0 1px 0 rgba(255,255,255,.78),
        0 -1px 0 rgba(255,255,255,.55);
    pointer-events: none;
}

.heatmap-grid.show-values .heatmap-cell-value {
    display: flex;
}

/* Meilleure lisibilité sur les cases foncées */
.heatmap-cell.dark-cell .heatmap-cell-value {
    color: #fff;
    text-shadow:
        0 1px 2px rgba(0,0,0,.65),
        0 -1px 2px rgba(0,0,0,.45);
}

.heatmap-actions {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.heatmap-toggle-values {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.heatmap-toggle-values:hover,
.heatmap-toggle-values.active {
    border-color: var(--primary);
    background: #eaf1fa;
    color: var(--primary-dark);
}

/* V5.0 — 0 mm signifie journée sèche : case volontairement neutre. */
.heatmap-cell.rain-dry{background:#f4f6f8!important;border-color:#e4e9ed}
