/* // public/css/main.css */
:root {
    --primary-dark: rgb(26, 26, 26);
    /* Anciennement #333333 */
    --accent-blue: #4DC0E0;
    --background-white: #FFFFFF;
    --header-height: 50px;
    /* Hauteur du navbar */
    --footer-height: 40px;
    /* Hauteur du footer en mode normal */
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: var(--primary-dark);
    width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-dark);
    padding: 0 10px 0 20px;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    width: 100%;
    box-sizing: border-box;
    z-index: 1000
}

.navbar {
    touch-action: pan-y;
    /* Bloque le swipe horizontal sur la navbar */
}

.navbar .logo img {
    height: 40px;
    vertical-align: middle;
    filter: drop-shadow(0 0 3px #fff)
}

.navbar .logo {
    cursor: pointer;
}

.navbar nav {
    display: flex;
    align-items: center
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0 20px 0 0;
    display: flex
}

.navbar nav ul li {
    padding: 5px 2px 0px 2px;
    cursor: pointer;
    transition: background-color .3s ease, color .3s ease
}

.navbar nav ul li:hover {
    background-color: rgba(255, 255, 255, .1)
}

.navbar nav ul li.active:not(.no_style) {
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue)
}

.station-selector {
    background-color: var(--accent-blue);
    padding: 5px 20px;
    width: 100%;
    box-sizing: border-box;
    z-index: 900;
    display: flex;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    justify-content: space-between;
    align-items: center
}

.station-selector {
    touch-action: pan-y;
    /* Bloque le swipe horizontal sur le sélecteur de station */
}

.station-info {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    /* Peut rétrécir */
    min-width: 0;
}

.station-selector-container {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    /* Grandit pour remplir l'espace */
    min-width: 0;
    /* Permet aux enfants de rétrécir */
}

.station-selector-container:last-child {
    flex: 0 1 auto;
    /* Le dernier conteneur ne grandit pas */
    justify-content: flex-end;
}

#global-station-select {
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 13px;
    background-color: #fff;
    color: var(--primary-dark);
    border: 1px solid #ddd;
    min-width: 150px;
    /* Largeur minimale raisonnable */
    max-width: 250px;
    /* Largeur maximale */
    width: auto;
    /* Laisse le navigateur décider */
    box-sizing: border-box;
    flex-shrink: 1;
    /* Peut rétrécir */
}

.station-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    opacity: .5;
    border-radius: 50%;
    background-color: var(--primary-dark);
    cursor: pointer;
    transition: all .3s ease;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    /* N'enrètrécit pas */
}

.station-icon-btn:hover {
    background-color: var(--primary-dark);
    opacity: .8;
    transform: scale(1.1)
}

.station-icon-btn .nav-icon {
    width: 24px;
    height: 24px;
    margin-right: 0;
    margin-inline: 0;
}

.condition-tile.value-changed .condition-value {
    color: #4CAF50;
    font-weight: bold;
}

.condition-tile.major-change {
    animation: majorUpdate 1.8s ease-out;
    border: 2px solid #FF9800;
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.condition-tile.major-change .condition-value {
    color: #FF9800;
    font-weight: bold;
}

@keyframes majorUpdate {
    0% {
        transform: scale(1) rotate(0deg);
        background-color: inherit;
    }

    15% {
        transform: scale(1.08) rotate(-1deg);
        background-color: rgba(255, 152, 0, 0.15);
    }

    30% {
        transform: scale(1.05) rotate(1deg);
        background-color: rgba(255, 152, 0, 0.1);
    }

    45% {
        transform: scale(1.03) rotate(-0.5deg);
        background-color: rgba(255, 152, 0, 0.05);
    }

    60% {
        transform: scale(1.01) rotate(0.5deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        background-color: inherit;
    }
}

.content-container {
    margin-top: calc(var(--header-height) + 48px);
    /* Navbar + Station Selector */
    margin-bottom: var(--footer-height);
    display: flex;
    width: 500vw;
    transform: translateX(0);
    transition: transform .3s ease-out;
    flex: 1;
    /* overflow: hidden; /* Le scroll est géré par .content-section */
    position: relative;
    box-sizing: border-box;
}

.content-section {
    height: 100%;
    min-width: 100vw;
    box-sizing: border-box;
    padding: 2px 12px;
    overflow-y: auto
}

.content-section h1 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.8em;
    color: var(--accent-blue);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    z-index: 2000;
    justify-content: center;
    align-items: center
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px
}

.form-group {
    margin-bottom: 15px
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap
}

.form-row .form-group {
    flex: 1;
    min-width: 200px
}

button,
input[type=button],
input[type=submit] {
    background-color: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color .3s
}

button:hover,
input[type=button]:hover,
input[type=submit]:hover {
    background-color: #3a9db6
}

.btn-secondary {
    background-color: #6c757d
}

.btn-secondary:hover {
    background-color: #5a6268
}

.station-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    opacity: .5;
    border-radius: 50%;
    background-color: var(--primary-dark);
    /* border: 2px solid #fff; */
    border-radius: 50%;
    cursor: pointer;
    transition: all .3s ease;
    padding: 0;
    line-height: 1
}

.station-icon-btn:hover {
    background-color: var(--primary-dark);
    opacity: .8;
    transform: scale(1.1)
}

.filter-group {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.btn-text {
    transition: opacity .2s ease
}

.btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    position: absolute
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.btn-collect.loading {
    cursor: wait;
    transform: none
}

.btn-collect.loading:hover {
    background-color: rgba(255, 255, 255, .2);
    transform: none
}

.btn-collect.loading .btn-text {
    opacity: 0;
    visibility: hidden
}

.btn-collect.loading .btn-spinner {
    display: block
}

.refresh-btn {
    background-color: var(--primary-dark);
    margin-left: 10px
}

.refresh-btn:hover {
    background-color: #555
}

input,
select,
textarea {
    background-color: #fff;
    color: var(--primary-dark);
    border: 1px solid #ddd;
    padding: 4px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box
}

input[type=checkbox] {
    width: 16px
}

label {
    display: block;
    margin-bottom: 5px;
    width: 100%;
    font-weight: 700
}

.status-message {
    padding: 8px;
    margin: 0;
    border-radius: 0 0 6px 6px;
    font-weight: 700;
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translate(-50%, -10px);
    z-index: 1001;
    min-width: 300px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .3s ease-out, opacity .3s ease-out
}

.status-message.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto
}

.status-loading {
    background-color: #e3f2fd;
    color: #1976d2
}

.status-success {
    background-color: #e8f5e8;
    color: #2e7d32
}

.status-warning {
    background-color: #fff3e0;
    color: #f57c00
}

.status-error {
    background-color: #ffebee;
    color: #c62828
}

.error-message {
    color: #c62828;
    font-size: .9em;
    text-align: center;
    padding: 20px
}

.footer {
    background-color: var(--primary-dark);
    color: white;
    /* width: 100vw;  <-- REMPLACEZ CECI */
    width: 100%;
    /* Plus sûr que vw sur mobile */
    left: 0;
    right: 0;
    /* Assure que ça prend toute la largeur */

    height: var(--footer-height);
    position: fixed;
    bottom: 0 !important;
    /* Forcez la priorité */
    z-index: 1100;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, .1);

    /* CORRECTION MAGIQUE POUR MOBILE : */
    transform: translateZ(0);
    /* Force l'accélération matérielle et fixe le contexte */
    -webkit-transform: translateZ(0);

    transition: transform .2s ease-in-out, height .2s ease-in-out;
    /* Soyez spécifique sur la transition */
}

.footer.hidden-animated {
    transform: translateY(100%);
    /* Slide the footer down to hide it */
}

/* Styles pour le footer quand il est ouvert en panneau de détail */
.footer.details-open {
    height: 40vh;
    /* 40% de la hauteur de la vue */
}

.footer.details-open .chart-container {
    height: 100%;
    width: 100%;
    max-height: none;
    /* Override default max-height */
}

.footer:not(.details-open) .details-footer-header,
.footer:not(.details-open) .chart-container {
    display: none;
}

.footer-bottom {
    padding: 6px 12px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, .1)
}

.footer-bottom p {
    margin: 0;
    font-size: .8em;
    color: #ccc
}

.footer.details-open .footer-bottom {
    display: none;
}

.cron-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%
}

.cron-container select {
    flex-grow: 1
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-dark);
    transition: .4s
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .4s
}

input:checked+.slider {
    background-color: var(--accent-blue)
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent-blue)
}

input:checked+.slider:before {
    transform: translateX(18px)
}

.slider.round {
    border-radius: 34px
}

.slider.round:before {
    border-radius: 50%
}

.probe-label-preview,
.probe-measurement-preview {
    font-size: .8em;
    color: #6c757d;
    font-style: italic;
    font-weight: 400
}

.station-selector-container {
    display: flex;
    align-items: center;
    gap: 10px
}

#global-station-select {
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    color: var(--primary-dark);
    border: 1px solid #ddd;
    width: 220px;
    box-sizing: border-box
}

.add-station-btn {
    background-color: rgba(255, 255, 255, .2);
    border: 2px solid #fff;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1
}

.add-station-btn:hover {
    background-color: #fff;
    color: var(--accent-blue);
    transform: scale(1.1)
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    animation: fadeIn .3s ease-out
}

.modal.show {
    display: block
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    animation: slideIn .3s ease-out
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.modal-header h2 {
    margin: 0;
    color: #333
}

.modal-body {
    padding: 20px
}

.form-group {
    margin-bottom: 15px
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: #333
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box
}

.form-group input:focus {
    border-color: #4dc0e0;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .25)
}

.form-group.required label::after {
    content: " *";
    color: #dc3545
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color .2s
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff
}

.btn-secondary:hover {
    background-color: #545b62
}

.btn-primary {
    background-color: #4dc0e0;
    color: #fff
}

.btn-primary:hover {
    background-color: #3a9db6
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4dc0e0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px
}

@keyframes spin {
    0% {
        transform: rotate(0)
    }

    100% {
        transform: rotate(360deg)
    }
}

.error-message-add {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none
}

.success-message-add {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none
}

.conditions-controls {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 2px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between
}

.conditions-controls .filter-group,
.conditions-controls .view-group {
    display: flex;
    flex-direction: row;
    gap: 5px
}

.conditions-controls .filter-group label,
.conditions-controls .view-group label {
    font-size: .9em;
    color: var(--primary-dark);
    font-weight: 700
}

.conditions-controls input[type=text],
.conditions-controls select {
    min-width: 120px;
}

.conditions-container {
    background: #fff;
    border-radius: 8px;
    padding: 5px 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .5)
}

.unit-group {
    margin-bottom: 30px
}

.unit-group h3 {
    background: var(--accent-blue);
    color: #fff;
    margin: 0 0 15px 0;
    padding: 6px 12px;
    font-size: 1.1em;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .5)
}

.unit-group .unit-count {
    background: rgba(255, 255, 255, .2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: .9em;
    font-weight: 400
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    margin-bottom: 20px
}

.condition-tile {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
    transition: all .2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .6);
    display: flex;
    position: relative;
    flex-direction: column
}

.condition-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
    border-color: var(--accent-blue)
}

.condition-tile .hide-tile-btn,
.condition-tile .hide-tile-btn svg {
    height: 24px;
    width: 24px;
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
    background: none;
    padding: 0;
    color: #888;
}

.condition-tile:hover .hide-tile-btn {
    opacity: 1;
}

.condition-content {
    display: flex;
    flex-direction: column;
    height: 100%
}

.condition-info {
    flex-shrink: 0
}

.condition-name {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: .95em;
    line-height: 1.3
}

.condition-value {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 5px
}

.condition-unit {
    font-size: .9em;
    color: #6c757d;
    font-weight: 400
}

.condition-meta {
    font-size: .8em;
    color: #6c757d;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
    font-style: italic
}

.condition-chart {
    margin-top: 10px;
    flex-grow: 1;
    min-height: 100px
}

.plot-container {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center
}

.conditions-stats {
    background: #e3f2fd;
    padding: 5px 8px;
    margin-bottom: 2px;
    border-radius: 6px;
    font-size: .9em;
    color: #1976d2;
    border-left: 4px solid var(--accent-blue)
}

.weather-forecast-container {
    position: relative;
    width: 100%;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}

.weather-icon {
    position: absolute;
    width: 220px;
    height: 220px;
    top: 33%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity .5s ease, transform 1s ease
}

.weather-icon.active {
    opacity: 1;
    filter: none;
    transform: translate(-50%, -50%) scale(1.1)
}

.weather-sun {
    top: 20%;
    left: 40%;
    opacity: 1
}

.weather-sun.active {
    filter: drop-shadow(0 0 10px gold)
}

.weather-cloud {
    top: 30%;
    left: 60%;
    opacity: .8
}

.weather-cloud.active {
    filter: drop-shadow(0 0 8px #87ceeb)
}

.weather-rain {
    top: 50%;
    left: 60%;
    opacity: .8
}

.weather-rain.active {
    filter: drop-shadow(0 0 8px #4682b4)
}

@keyframes sunPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1)
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1)
    }
}

@keyframes cloudFloat {

    0%,
    100% {
        transform: translate(-50%, -50%);
        opacity: .8
    }

    50% {
        transform: translate(calc(-50% + 10%), -50%);
        opacity: .5
    }
}

@keyframes rainSway {

    0%,
    100% {
        transform: translate(-50%, -50%)
    }

    50% {
        transform: translate(calc(-50% - 10%), -50%)
    }
}

@keyframes snowDrift {

    0%,
    100% {
        transform: translate(-50%, -50%)
    }

    50% {
        transform: translate(calc(-50% + 10%), -50%)
    }
}

.weather-forecast-container:hover .weather-sun {
    animation: sunPulse 2s ease-in-out
}

.weather-forecast-container:hover .weather-cloud {
    animation: cloudFloat 3s ease-in-out
}

.weather-forecast-container:hover .weather-rain {
    animation: rainSway 2.5s ease-in-out
}

.weather-name {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: .8em;
    font-weight: 700;
    color: var(--accent-blue, #4dc0e0);
    text-align: center;
    background: rgba(255, 255, 255, .9);
    padding: 2px 8px;
    border-radius: 12px;
    z-index: 10
}

.condition-tile[data-key=ForecastIcon]:hover .weather-icon:not(.active) {
    opacity: .6;
    transform: translate(-50%, -50%) scale(1.05)
}

.condition-tile[data-key=ForecastIcon]:hover .weather-icon.active {
    transform: translate(-50%, -50%) scale(1.2)
}

.wind-compass {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center
}

.wind-rose {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 16%;
    left: 69%;
    transform: translate(-50%, -50%);
    opacity: .7;
    z-index: 1
}


.wind-arrow {
    position: absolute;
    width: 30px;
    height: 30px;
    top: 15%;
    left: 70%;
    z-index: 2;
    transform-origin: center center;
    transition: transform .5s ease-in-out;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, .3))
}

.battery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -80px -80px -80px 0;
    padding: 8px
}

.battery-icon {
    width: 100px;
    height: 200px;
    transition: transform .3s ease, filter .3s ease
}

.condition-tile:hover .battery-icon {
    transform: scale(1.1)
}

.missing-battery {
    width: 140px;
    height: 160px;
    margin-top: 10px
}

@keyframes pulse {
    0% {
        opacity: 1
    }

    50% {
        opacity: .6
    }

    100% {
        opacity: 1
    }
}

.condition-tile {
    transition: transform 1.3s ease, box-shadow 1.3s ease
}

@keyframes tileUpdate {
    0% {
        transform: scale(1);
        background-color: inherit
    }

    25% {
        transform: scale(1.05);
        background-color: rgba(76, 175, 80, .1)
    }

    50% {
        transform: scale(1.02);
        background-color: rgba(76, 175, 80, .05)
    }

    100% {
        transform: scale(1);
        background-color: inherit
    }
}

.condition-value {
    transition: color 1.3s ease
}

@keyframes majorUpdate {
    0% {
        transform: scale(1) rotate(0);
        background-color: inherit
    }

    15% {
        transform: scale(1.08) rotate(-1deg);
        background-color: rgba(255, 152, 0, .15)
    }

    30% {
        transform: scale(1.05) rotate(1deg);
        background-color: rgba(255, 152, 0, .1)
    }

    45% {
        transform: scale(1.03) rotate(-.5deg);
        background-color: rgba(255, 152, 0, .05)
    }

    60% {
        transform: scale(1.01) rotate(.5deg)
    }

    100% {
        transform: scale(1) rotate(0);
        background-color: inherit
    }
}

.sun-icon {
    width: 100px;
    height: 100px;
    transition: transform .3s ease, filter .3s ease;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, .3))
}

.condition-tile:hover .sun-icon {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(3px 3px 8px rgba(255, 165, 0, .5)) brightness(1.2)
}

.sun-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding: 8px
}

.sun-container.sunrise {
    justify-content: flex-start
}

.sun-container.sunset {
    justify-content: flex-end
}

@media (max-width: 768px) {
    .footer.details-open {
        height: 70vh !important;
        /* Optionnel : ajuster le max-height du chart container pour correspondre */
    }

    /* .footer.details-open .chart-container {
        max-height: 65vh; 
    } */
    .station-info {
        display: none;
    }

    #add-station-btn {
        display: none;
    }

    .nav-menu {
        padding: 0 5px 0 0;
    }

    #conditions-stats-display {
        display: none !important
    }

    .weather-icon {
        top: 50%;
        width: 160px;
        height: 160px
    }

    .conditions-controls {
        flex-wrap: nowrap;
        /* Garde les contrôles sur une seule ligne */
        gap: 10px;
        /* Réduit l'espacement sur mobile */
    }

    .conditions-controls .filter-group,
    .conditions-controls .view-group {
        flex: 1;
        /* Partage l'espace équitablement */
        min-width: 0;
        /* Permet aux éléments de rétrécir si nécessaire */
    }

    .weather-name {
        font-size: .7em
    }

    .wind-rose {
        width: 150px;
        height: 150px;
        top: 40%
    }

    .wind-arrow {
        width: 25px;
        height: 25px;
        top: 40%;
    }

    .wind-period-display {
        bottom: -20px;
    }

    .wind-compass {
        min-height: 130px;
        margin-top: -30px;
    }

    .condition-chart {
        margin: 0;
    }

    .conditions-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 5px;
        margin-bottom: 5px
    }

    .unit-group {
        margin-bottom: 5px;
    }

    .condition-tile {
        padding: 5px;
    }

    /* --- Font size reductions for mobile --- */
    /* "le reste" -25% */
    body {
        font-size: 12px;
        /* Base 16px * 0.75 = 12px */
    }

    /* h1 -50% */
    .content-section h1 {
        font-size: 1.2em;
        /* (1.8em * 16px) * 0.5 / 12px */
    }

    .probes-header h1,
    .section-header h1 {
        font-size: 1em;
        /* (1.5em * 16px) * 0.5 / 12px */
    }

    /* h2 -40% */
    .modal-header h2 {
        font-size: 1.2em;
        /* Assuming 1.5em base: (1.5em * 16px) * 0.6 / 12px */
    }

    /* h3 -30% */
    .unit-group h3,
    .settings-group>h3,
    .settings-group-header h3 {
        font-size: 1.1em;
        /* Approx (1.2em * 16px) * 0.7 / 12px */
    }
}

.tile-link {
    text-decoration: none;
    color: inherit
}

.condition-tile.selected {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, .5);
    transform: translateY(-2px);
    background-color: #e7f3ff
}

.context-menu {
    position: absolute;
    display: none;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
    border-radius: 5px;
    padding: 5px 0;
    z-index: 1001;
    min-width: 150px
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0
}

.context-menu li {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px
}

.context-menu li:hover {
    background-color: #f0f0f0
}

.smallText {
    margin-left: auto;
    float: right;
    font-size: .6em;
    color: #666;
    font-weight: 400 !important
}

.settings-form {
    background: #fff;
    border-radius: 8px;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1)
}

.settings-group {
    margin-bottom: 3px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 6px
}

.settings-group h3 {
    color: var(--accent-blue);
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-blue);
    font-size: 1.2em
}

.settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 5px
}

.settings-field {
    position: relative
}


.settings-field input,
.settings-field select {
    width: 100%;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px
}

.settings-field input:focus,
.settings-field select:focus {
    outline: 0;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(77, 192, 224, .2)
}

.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    color: white;
    fill: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: pre-wrap;
    z-index: 1000;
    font-size: 12px;
    min-width: 200px;
    max-width: 300px;
    text-align: left;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

.settings-actions {
    margin-top: 0;
    padding: 10px 10px 0 10px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 15px
}

.stations-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px
}

.station-item {
    border: 1px solid var(--primary-dark);
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f9f9f9
}

.station-header {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    align-items: center
}

.station-name {
    font-weight: 700;
    font-size: 1.1em
}

.station-last-archive {
    color: #666;
    font-size: .9em;
    margin-left: 10px
}

.property-item {
    margin-bottom: 8px
}

.property-label {
    font-weight: 700;
    display: block;
    margin-bottom: 3px
}

.property-value {
    padding: 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-height: 20px
}

.station-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px
}

.station-selector-container {
    display: flex;
    align-items: center;
    gap: 10px
}

.btn-secondary {
    background-color: #6c757d
}

.btn-secondary:hover {
    background-color: #5a6268
}

.probes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 20px;
    background-color: var(--accent-blue);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .4)
}

#composite-probes-container .settings-form {
    padding: 0;
    background: 0 0;
    box-shadow: none
}

.probes-header h1 {
    margin: 0;
    padding: 0;
    border: none;
    color: #fff;
    font-size: 1.5em
}

/* .probes-header .add-station-btn {
    display: none;
} */

.probe-item {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #f9f9f9;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .4)
}

.probe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    background-color: #f1f1f1
}

.probe-header h1 {
    margin: 25px;
    font-size: 1.2em;
    color: var(--accent-blue)
}

.probe-header h3 {
    margin-top: 0;
    margin-bottom: 0;
    color: var(--accent-blue);
    font-size: 1.2em
}

.probe-header .toggle-icon {
    margin-right: 10px;
    font-size: .8em;
    display: inline-block;
    width: 1em
}

.probe-label-preview {
    font-weight: 400;
    font-style: italic;
    font-size: .9em;
    color: #666
}


.btn-delete-probe:hover {
    background-color: var(--accent-blue);
    color: #fff;
    transform: scale(1.1)
}

.probe-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease-out, padding .3s ease-out;
    padding: 10px 10px 0 10px
}

.probe-content form {
    padding: 0;
    margin: 0
}

.probe-content.open {
    max-height: 1000px;
    padding: 10px 10px 0 10px;
    transition: max-height .5s ease-in, padding .5s ease-in
}

.probe-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 10px
}

.probe-fields .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.settings-field input[type=number],
.settings-field input[type=text] {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace, sans-serif;
    font-size: .9em;
    box-sizing: border-box
}

.settings-field textarea {
    resize: vertical;
    min-height: 80px
}

.settings-actions {
    margin-top: 0;
    text-align: right
}

#add-probe-modal .modal-content {
    width: 400px
}

#help-modal-body {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-top: 1px solid var(--accent-blue)
}

#help-modal-body h4 {
    color: var(--accent-blue);
    margin-bottom: 10px
}

#help-modal-body ul {
    margin: 0;
    padding-left: 20px
}

#help-modal-body li {
    margin-bottom: 5px;
    color: var(--primary-dark)
}

#help-modal-body code {
    padding: 2px 4px;
    border-radius: 2px;
    color: #e6db74;
    background-color: var(--primary-dark)
}

.auth-container {
    margin-left: 20px
}

.auth-btn {
    background: 0 0;
    border: 3px solid var(--accent-blue);
    color: var(--background-white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
    margin: 4px 0 4px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all .3s ease
}

.auth-btn:hover {
    background-color: var(--background-white);
    color: var(--primary-dark)
}

.auth-btn.logged-in {
    border-color: var(--accent-blue);
    color: var(--accent-blue)
}

.auth-btn.logged-in:hover {
    background-color: var(--accent-blue);
    color: var(--background-white)
}

.auth-modal-content {
    max-width: 400px
}

.conditions-container.sortable .condition-tile {
    cursor: move
}

.condition-tile.dragging {
    opacity: .5;
    border: 2px dashed #007bff
}

.condition-tile.drag-over {
    border-left: 3px solid #007bff
}

.details-footer-header {
    display: flex;
    justify-content: flex-end;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
    /* Empêche l'en-tête de rétrécir */
}

.details-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.details-close-btn .nav-icon {
    color: #888;
}

.chart-container {
    display: block;
    padding: 0.1rem;
    box-sizing: border-box;
    max-height: 70vh;
    overflow-y: auto;
}

:where(.plot-d6a7b5) {
    --plot-background: white;
    display: block;
    height: auto;
    height: intrinsic;
    max-width: 100%
}

:where(.plot-d6a7b5text),
:where(.plot-d6a7b5tspan) {
    white-space: pre
}

/* ==========================================================================
   Main Component Styles
   Merges and cleans station.css, compositeProbes.css, and settings.css
   ========================================================================== */
/* ---
   1. Generic & Shared Styles
   --------------------------- */
.nav-icon,
.nav-icon-green,
.nav-icon-red {
    /* color: #eee; /* Couleur grise par défaut pour les icônes */
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 5px;
    margin-inline: 2px;
    transition: all .2s ease;
    cursor: pointer;
}

.nav-icon:hover,
.nav-menu li.active .nav-icon {
    color: var(--accent-blue);
    /* Icône blanche au survol ou si active */
    transform: scale(1.2)
}

.nav-icon-green:hover {
    color: green;
    /* Icône blanche au survol ou si active */
    transform: scale(1.2)
}

.nav-icon-red:hover {
    color: red;
    /* Icône blanche au survol ou si active */
    transform: scale(1.2)
}

.access-control-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 5px;
    transform: scale(1.5);
    color: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 20px;
    background-color: var(--accent-blue);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.section-header h1 {
    margin: 0;
    padding: 0;
    border: none;
    color: white;
    font-size: 1.5em;
}

.settings-form {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.settings-group {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-group>h3 {
    /* Title for non-collapsible groups */
    color: var(--accent-blue);
    margin: 15px 15px 20px 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-blue);
    font-size: 1.2em;
}

.settings-field {
    position: relative;
    display: flex;
    flex-direction: column;
}

.settings-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--primary-dark);
}

.settings-field input,
.settings-field select {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.settings-field input:focus,
.settings-field select:focus:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(77, 192, 224, 0.2);
}

.settings-actions {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* ---
   2. Station Section Specifics
   --------------------------- */
#stations-section .settings-group {
    padding: 10px 6px;
}

#stations-section .settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 5px;
    padding: 0 9px;
    /* To align with group padding */
}

/* ---
   3. Composite Probes Section Specifics
   ------------------------------------- */
.settings-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    background-color: #f1f1f1;
}

.settings-group-header h3 {
    margin: 0;
    color: var(--accent-blue);
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-icon {
    font-size: 0.8em;
    display: inline-block;
    width: 1em;
    transition: transform 0.2s ease-in-out;
}

.settings-group-header.open .toggle-icon {
    transform: rotate(90deg);
}

.probe-label-preview,
.probe-measurement-preview {
    font-weight: normal;
    font-style: italic;
    font-size: 0.9em;
    color: #666;
}

.btn-delete-probe {
    background-color: transparent;
    color: var(--primary-dark);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

/* .btn-delete-probe:hover {
    background-color: var(--accent-blue);
    color: white;
    transform: scale(1.1);
} */

.btn-delete-probe:hover {
    color: var(--accent-blue);
    transform: scale(1.2);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    padding: 0 15px;
}

.collapsible-content.open {
    max-height: 1500px;
    padding: 15px;
    transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

#compositeProbes-section .probe-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

#compositeProbes-section .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}



#compositeProbes-section .settings-actions {
    text-align: right;
    justify-content: flex-end;
}

/* ---
   5. Wind Rose & Vector Chart Styles (Footer)
   ------------------------------------------- */
.wind-details-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 5px;
    box-sizing: border-box;
}

.wind-top-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    height: 60%;
    width: 100%;
}

.wind-period-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ccc;
    font-size: 0.9em;
    text-align: center;
    flex-shrink: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0px;
}

.wind-bottom-row {
    height: 40%;
    width: 100%;
}

.wind-top-row {
    position: relative;
    /* Contexte de positionnement pour l'enfant absolu */
}

.rose-container {
    border-radius: 8px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 1;
}

.rose-title {
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ccc;
}

.axes circle {
    fill: none;
    stroke: #666;
    stroke-width: 0.5px;
}

.tickmarks text {
    font: 10px sans-serif;
    text-anchor: middle;
    fill: #ccc;
}

.calmwind text {
    font: 14px sans-serif;
    text-anchor: middle;
    fill: #fff;
}

.arcs {
    stroke: #fff;
    stroke-width: 0.5px;
    fill-opacity: 0.6;
    cursor: pointer;
    transition: stroke-width 0.2s, fill-opacity 0.2s;
}

.arcs:hover {
    fill-opacity: 0.9;
    stroke-width: 2px;
    stroke: #ff6b6b;
}

.arcs_max {
    stroke: #fff;
    stroke-width: 1.5px;
    fill: none;
}

.labels text {
    letter-spacing: 1px;
    fill: #aaa;
    font-size: 10px;
    text-anchor: middle;
}

/* ---
   4. Settings Section Specifics (Units)
   ------------------------------------- */
#settings-section .settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 5px;
    padding: 0 9px;
}

#settings-section .settings-group {
    padding: 10px 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
}

#settings-section .skin-type-field {
    margin-top: 10px;
}

#settings-section .skin-type-info {
    margin-top: 8px;
    padding: 8px;
    background: #f0f8ff;
    border-radius: 4px;
    font-size: 0.9em;
}

#settings-section .skin-type-info p {
    margin: 0 0 5px 0;
    color: #666;
}

#settings-section .current-dem {
    font-weight: bold;
    color: var(--accent-blue);
}



.axis {
    font-size: 9px;
}

.axis text {
    fill: #eee;
}

.axis path,
.axis line {
    fill: none;
    stroke: #eee;
    shape-rendering: crispEdges;
    stroke-width: 1px;
}

.grid line {
    stroke: #ddd;
    stroke-dasharray: 2, 2;
}

.line {
    fill: none;
    stroke-width: 1px;
}

.overlay {
    fill: none;
    pointer-events: all;
}

.focus {
    pointer-events: none;
}

.focus line {
    stroke: #666;
    stroke-width: 1px;
    stroke-dasharray: 3, 3;
}

.focus text,
.legend text,
.axis-label,
.hover-date,
.hover-value,
.info-text {
    /* font-size: 11px; */
    font-weight: bold;
    /* fill: #eeeeee; */
    text-shadow:
        1px 0px 1px #333,
        /* droite */
        -1px 0px 1px #333,
        /* gauche */
        0px 1px 1px #333,
        /* bas */
        0px -1px 1px #333,
        /* haut */
        1px 1px 1px #333,
        /* bas-droite */
        -1px -1px 1px #333,
        /* haut-gauche */
        1px -1px 1px #333,
        /* haut-droite */
        -1px 1px 1px #333,
        /* bas-gauche */
        2px 0px 2px #333,
        /* droite */
        -2px 0px 2px #333,
        /* gauche */
        0px 2px 2px #333,
        /* bas */
        0px -2px 2px #333,
        /* haut */
        2px 2px 2px #333,
        /* bas-droite */
        -2px -2px 2px #333,
        /* haut-gauche */
        2px -2px 2px #333,
        /* haut-droite */
        -2px 2px 2px #333;
    /* bas-gauche */
}

.legend {
    font-size: 11px;
    fill: #eeeeee;
}

.legend rect {
    stroke: none;
}



/* main.css - Ajout des styles pour la Spirale Refactorisée */

/* ... (Garder tout le contenu existant avant la section Spirale, je remplace/ajoute ici les parties pertinentes) ... */

/* --- SPIRAL CHART STYLES REFACTORED --- */

.spiral-layout-container {
    display: flex;
    flex-wrap: wrap;
    /* Permet le retour à la ligne sur mobile */
    width: 100%;
    height: 100%;
    background: var(--primary-dark);
    /* Anciennement #151515 */
    overflow-y: auto;
    /* Scroll vertical si empilement */
    overflow-x: hidden;
}

/* Bloc de gauche : La Spirale SVG */
.spiral-viz-block {
    flex: 1 1 480px;
    /* Grandit, Rétrécit, Base 480px */
    min-height: 400px;
    position: relative;
    /* Pour positionner les boutons de contrôle */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Bloc de droite : Stats et Mini-Chart */
.spiral-stats-block {
    flex: 1 1 480px;
    /* Grandit, Rétrécit, Base 480px */
    background: #1a1a1a;
    border-left: 1px solid #333;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 250px;
}

/* Sur mobile (quand ça wrap), on change la bordure */
@media (max-width: 960px) {
    .spiral-stats-block {
        border-left: none;
        border-top: 1px solid #333;
    }
}

.spiral-panel-content {
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 2;
    position: relative;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.panel-date {
    font-size: 1.2rem;
    color: #ddd;
    font-family: sans-serif;
    margin-bottom: 5px;
}

.spiral-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    /* Déplacé à droite du bloc viz */
    display: flex;
    gap: 6px;
    z-index: 10;
    pointer-events: auto;
}

.spiral-controls-left {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.spiral-btn {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid #555;
    color: #eee;
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    font-family: sans-serif;
    transition: background 0.2s;
}

.spiral-btn:hover {
    background: #666;
}

.svg-hover-date {
    font-family: 'Segoe UI', sans-serif;
    font-weight: 900;
    fill: rgba(255, 255, 255, 0.5);
    /* fill: rgba(255, 255, 255, 0.5); */
    pointer-events: none;
    text-anchor: middle;
}

.spiral-tooltip {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #555;
    border-radius: 4px;
    color: #eee;
    font-family: sans-serif;
    font-size: 12px;
    padding: 8px;
    line-height: 1.4;
}

.axis-label {
    font-family: sans-serif;
    font-size: 10px;
    fill: #999;
    pointer-events: none;
}

.grid-ring {
    fill: none;
    stroke: #444;
    stroke-width: 1;
    opacity: 0.2;
    pointer-events: none;
}

.axis-line {
    stroke: #444;
    stroke-width: 1;
    stroke-dasharray: 3, 3;
    opacity: 0.3;
    pointer-events: none;
}

/* --- GESTION DES PATHS (Optimisation) --- */
.sp-path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    /* Les clics sont gérés par le ghost-path */
    transition: stroke-width 0.2s;
}

/* --- GESTION DE LA PROXIMITÉ (Path) --- */

/* Le Ghost Path : invisible, large de 5px, capture les clics */
.sp-ghost-path {
    stroke: transparent;
    stroke-width: 5px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: pointer;
    pointer-events: stroke;
}

/* La ligne détaillée (segments) */
.sp-line {
    stroke-linecap: round;
    pointer-events: none;
}

/* Effet de survol appliqué au groupe */
.period-group.hover-active .sp-line,
.period-group.hover-active .sp-path {
    stroke-width: 4 !important;
    stroke-opacity: 1 !important;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8));
    stroke: #fff !important;
    /* Surbrillance blanche au survol */
}

@keyframes spin {
    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(360deg)
    }
}

@keyframes flashRecord {
    0% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 0.1;
    }
}

.blink-record {
    animation: flashRecord 0.6s infinite ease-in-out;
}

.btn-group-action {
    background: none;
    border: none;
    padding: 0;
    margin-left: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    vertical-align: middle;
}

.btn-group-action:hover svg {
    opacity: 1;
    transform: scale(1.1);
    color: #ff4d4d;
}

.btn-group-action img {
    display: block;
}