* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

img, svg, a {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-drag: none;
}

#map {
    height: 100%;
    width: 100%;
}

.info-box {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    max-width: 280px;
}

.info-box h3 {
    margin: 0 0 8px 0;
    font-size: var(--text-base);
    color: #333;
}

.info-box p {
    margin: 0;
    font-size: var(--text-xs);
    color: #666;
    line-height: 1.4;
}

.opacity-control {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.opacity-control label {
    display: block;
    font-size: var(--text-xs);
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.opacity-control input[type="range"] {
    width: 120px;
    vertical-align: middle;
}

.opacity-control .value {
    font-size: var(--text-xs);
    color: #666;
    margin-left: 8px;
}

/* Légende - Style collapsible */
.legend {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    line-height: 1.6;
    font-size: var(--text-xs);
}

.legend .legend-header {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eee;
    user-select: none;
}

.legend .legend-header:hover {
    background: #f9f9f9;
}

.legend .legend-header h4 {
    margin: 0;
    flex: 1;
    font-size: var(--text-sm);
    color: #333;
    border: none;
    padding: 0;
}

.legend .legend-toggle {
    color: #999;
    font-size: var(--text-xs);
}

.legend .legend-body {
    padding: 12px 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.legend-line {
    width: 30px;
    height: 4px;
    margin-right: 10px;
    border-radius: 2px;
}

.legend-area {
    width: 30px;
    height: 18px;
    margin-right: 10px;
    border-radius: 3px;
    border: 1px solid #999;
}

.legend-text {
    color: #444;
}

/* Style central line */
.line-central {
    background: #00BFFF;
}

/* Style north/south limits */
.line-limits {
    background: #FF4444;
}

/* Style max eclipse line */
.line-max-eclipse {
    background: repeating-linear-gradient(
        90deg,
        #FFA500 0px,
        #FFA500 4px,
        transparent 4px,
        transparent 8px
    );
}

/* Style totality zone */
.area-totality {
    background: rgba(128, 0, 128, 0.5);
}

.legend .legend-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    cursor: pointer;
}

.legend .legend-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.legend .legend-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: var(--text-xs);
    color: #999;
    text-align: center;
}

.legend .legend-footer a {
    color: #666;
    text-decoration: none;
}

.legend .legend-footer a:hover {
    text-decoration: underline;
}

/* Centered search control - aligné avec les contrôles Leaflet */
.search-control {
    position: fixed !important;
    top: 0px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Desktop avec panneau gauche : centrer sur la zone carte */
@media (min-width: 768px) and (min-height: 501px) {
    .search-control {
        left: calc(50vw + 175px) !important;
    }
}
@media (min-width: 1000px) and (min-height: 501px) {
    .search-control {
        left: calc(500px + 175px) !important;
    }
}

.search-control input {
    width: 220px;
    height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 15px;
    background: var(--color-input-bg, white);
    box-shadow: var(--shadow-md, 0 2px 6px rgba(0,0,0,0.2));
    font-size: var(--text-sm, 13px);
    outline: none;
    box-sizing: border-box;
    color: var(--color-text-primary, #333);
    transition: background-color var(--transition-theme, 0.2s), color var(--transition-theme, 0.2s);
}

.search-control input::placeholder {
    color: var(--color-text-tertiary, #999);
}

.search-control input:focus {
    box-shadow: 0 2px 8px var(--color-accent, rgba(74, 144, 217, 0.4));
}

.search-geolocate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--color-bg-elevated, white);
    box-shadow: var(--shadow-md, 0 2px 6px rgba(0,0,0,0.2));
    cursor: pointer;
    color: var(--color-text-secondary, #666);
    transition: background-color var(--transition-fast, 0.2s), color var(--transition-fast, 0.2s);
}

.search-geolocate-btn svg {
    width: 16px;
    height: 16px;
}

.search-input-wrapper {
    position: relative;
}

.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 4px 0 0 0;
    padding: 0;
    list-style: none;
    background: var(--color-bg-elevated, white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg, 0 2px 10px rgba(0,0,0,0.2));
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    color: var(--color-text-primary, #333);
}

.search-suggestions li {
    padding: 8px 14px;
    cursor: pointer;
    font-size: var(--text-sm, 13px);
    color: var(--color-text-primary, #333);
    border-bottom: 1px solid var(--color-border-subtle, #eee);
}

.search-suggestions li:last-child {
    border-bottom: none;
}

.search-suggestions li:hover,
.search-suggestions li.selected {
    background: var(--color-accent-subtle, #f0f7ff);
}

.search-geolocate-btn:hover {
    background: var(--color-accent-subtle, #f0f7ff);
    color: var(--color-accent, #4A90D9);
}

.search-geolocate-btn.locating {
    color: var(--color-accent, #4A90D9);
}

.search-geolocate-btn.locating svg {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Top bar control */
.top-bar-control {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.top-bar-control .top-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--color-bg-elevated, white) !important;
    box-shadow: var(--shadow-md, 0 1px 4px rgba(0,0,0,0.15));
    cursor: pointer;
    color: var(--color-text-primary, #333);
    transition: background-color var(--transition-fast, 0.2s), color var(--transition-fast, 0.2s);
}

.top-bar-control .top-bar-btn:hover {
    background: var(--color-accent-subtle, #f0f7ff);
    color: var(--color-accent, #4A90D9);
}

.top-bar-control .top-bar-btn svg {
    width: 18px;
    height: 18px;
}

/* Contrôle de couches personnalisé - barre horizontale en bas centrée */
.custom-layers-control {
    background: var(--color-bg-overlay, rgba(255, 255, 255, 0.6));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    box-shadow: var(--shadow-md, 0 1px 4px rgba(0,0,0,0.15));
    /* Même largeur que .timeline-datetime */
    width: 320px;
    height: 44px !important;
    transition: background-color var(--transition-theme, 0.2s);
}

/* Override Leaflet default anchor styles in this control */
.custom-layers-control.leaflet-bar a {
    width: auto !important;
    height: 44px !important;
}

/* Arrondir les coins des boutons aux extrémités */
.custom-layers-control .control-toggle-btn:first-of-type {
    border-radius: 12px 0 0 12px;
}
.custom-layers-control .control-toggle-btn:last-of-type {
    border-radius: 0 12px 12px 0;
}

.custom-layers-control .control-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 44px !important;
    min-height: 44px !important;
    color: var(--color-text-primary, #333);
    text-decoration: none;
    border-right: 1px solid var(--color-border-subtle, rgba(0,0,0,0.1));
    position: relative;
    background: transparent;
    transition: background-color var(--transition-fast, 0.15s), color var(--transition-fast, 0.15s);
}

.custom-layers-control .control-toggle-btn svg {
    width: 28px;
    height: 28px;
}

.custom-layers-control .control-toggle-btn:last-of-type {
    border-right: none;
}

.custom-layers-control .control-toggle-btn:hover {
    background: var(--color-accent-subtle, rgba(0,0,0,0.08));
}

.custom-layers-control .control-toggle-btn.active {
    background: var(--color-accent-subtle, rgba(25, 118, 210, 0.2));
    color: var(--color-accent, #1976d2);
}

/* Indicateur bleu quand au moins une checkbox est cochée dans le panel */
.custom-layers-control .control-toggle-btn.has-active::before {
    content: '✓';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 14px;
    height: 14px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.custom-layers-control .control-panel {
    position: absolute;
    bottom: 50px; /* Bas du panel aligné avec bas de la timeline (80px - 30px) */
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-overlay, rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: var(--shadow-lg, 0 2px 10px rgba(0,0,0,0.2));
    width: 320px;
    box-sizing: border-box;
    padding: 12px;
    font-size: var(--text-sm, 13px);
    max-height: 50vh;
    overflow-y: auto;
    color: var(--color-text-primary, #333);
    transition: background-color var(--transition-theme, 0.2s), color var(--transition-theme, 0.2s);
}

/* Compatibilité avec ancien nom */
.custom-layers-control .layers-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #333;
    text-decoration: none;
}

.custom-layers-control .layers-toggle-btn:hover {
    background: #f4f4f4;
}

.custom-layers-control .layers-panel {
    position: absolute;
    bottom: 50px; /* Bas du panel aligné avec bas de la timeline */
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    width: 320px;
    box-sizing: border-box;
    padding: 12px;
    font-size: var(--text-sm);
}

.custom-layers-control .layers-section {
    margin-bottom: 12px;
}

.custom-layers-control .layers-section:last-child {
    margin-bottom: 0;
}

.custom-layers-control .layers-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: var(--text-base);
}

.custom-layers-control .layers-radio,
.custom-layers-control .layers-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    color: #444;
}

.custom-layers-control .layers-radio input,
.custom-layers-control .layers-checkbox input {
    margin: 0;
    cursor: pointer;
}

.custom-layers-control .layers-divider {
    height: 1px;
    background: #eee;
    margin: 12px 0;
}

.custom-layers-control .legend-details {
    margin-top: 8px;
    padding-left: 4px;
}

.custom-layers-control .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.custom-layers-control .legend-opacity {
    margin-top: 8px;
}

.custom-layers-control .legend-opacity label {
    font-size: var(--text-sm);
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.custom-layers-control .opacity-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-layers-control .opacity-slider-row input {
    flex: 1;
}

.custom-layers-control .opacity-slider-row span {
    font-size: var(--text-xs);
    min-width: 35px;
}

.custom-layers-control .legend-credit {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: var(--text-xs);
    color: #999;
}

.custom-layers-control .legend-credit a {
    color: #0066cc;
    text-decoration: none;
}

.custom-layers-control .legend-credit a:hover {
    text-decoration: underline;
}

/* Styles pour les panneaux Shadow et Satellite */
.custom-layers-control .panel-title {
    font-weight: 600;
    font-size: var(--text-base);
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-layers-control .panel-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.custom-layers-control .panel-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* État inactif pour les options de panel */
.custom-layers-control .panel-options-inactive {
    opacity: 0.4;
    pointer-events: none;
}

.custom-layers-control .panel-section-title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: #666;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.custom-layers-control .shadow-toggle,
.custom-layers-control .panel-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    color: #444;
}

.custom-layers-control .shadow-toggle input,
.custom-layers-control .panel-checkbox input {
    margin: 0;
    cursor: pointer;
}

.custom-layers-control .panel-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.custom-layers-control .panel-slider-row input[type="range"] {
    flex: 1;
}

.custom-layers-control .panel-slider-row span {
    font-size: var(--text-xs);
    min-width: 35px;
    color: #666;
}

/* Layer sampler grid (shared by layers panel + satellite panel) */
.layer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.layer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 5px 3px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    text-align: center;
}
.shadow-sub-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.shadow-sub-panel .layer-card {
    flex-shrink: 0;
    width: 80px;
}
.shadow-sub-panel .shadow-label-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-self: center;
    align-items: flex-start;
}
.shadow-sub-panel .shadow-label {
    font-size: var(--text-base, 14px);
    font-weight: 500;
    color: #333;
}
.shadow-sub-panel .shadow-credit {
    font-size: var(--text-xs);
    color: #999;
    line-height: 1;
    cursor: default;
}
.shadow-sub-panel .shadow-credit a {
    color: #999;
    text-decoration: none;
    line-height: 1;
    display: inline;
}
.shadow-sub-panel .shadow-credit a:hover {
    color: #666;
    text-decoration: underline;
}
.layer-card:hover {
    background: rgba(33, 150, 243, 0.05);
}
.layer-card.selected {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.08);
}
.layer-card.active {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.08);
}
.layer-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
}
.layer-card span {
    font-size: var(--text-xs, 11px);
    line-height: 1.2;
    color: var(--color-text-primary, #333);
}
.layer-card small {
    color: #888;
    font-size: 9px;
}

.custom-layers-control .btn-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.custom-layers-control .btn-row button {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    border-radius: 4px;
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all 0.15s;
}

.custom-layers-control .btn-row button:hover {
    background: #eee;
}

.custom-layers-control .btn-row button.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.custom-layers-control .time-display {
    text-align: center;
    font-size: var(--text-base);
    font-weight: 600;
    color: #333;
    margin: 8px 0;
}

.custom-layers-control .help-btn-inline {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #f9f9f9;
    color: #666;
    font-size: var(--text-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-layers-control .help-btn-inline:hover {
    background: #eee;
}

/* Bouton de partage */
.share-control {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.share-btn {
    background: #4A90D9;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.share-btn:hover {
    background: #357ABD;
}

.share-btn.copied {
    background: #5CB85C;
}

.share-btn svg {
    width: 14px;
    height: 14px;
}

/* Conteneur des boutons d'action (Partager + Eclipsefan côte à côte) */
.action-buttons-control {
    display: flex;
    gap: 8px;
}

/* Contrôle temporel pour shadow simulator - Style collapsible */
.time-control {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    width: 260px;
    transition: all 0.3s ease;
}

.time-control .time-control-header {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eee;
    user-select: none;
}

.time-control .time-control-header:hover {
    background: #f9f9f9;
}

.time-control .time-control-icon {
    font-size: var(--text-md);
}

.time-control .time-control-title {
    flex: 1;
    font-weight: 600;
    font-size: var(--text-base);
    color: #333;
}

.time-control .time-control-toggle {
    color: #999;
    font-size: var(--text-xs);
}

.time-control .time-control-body {
    padding: 12px 15px;
}

.time-control h4 {
    margin: 0 0 10px 0;
    font-size: var(--text-sm);
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.time-control label {
    display: block;
    font-size: var(--text-xs);
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.time-control input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.time-control .time-display {
    font-size: var(--text-base);
    font-weight: bold;
    color: #00BFFF;
    text-align: center;
    margin-top: 5px;
}

.time-control .eclipse-info {
    font-size: var(--text-xs);
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.time-control .eclipse-info div {
    margin-bottom: 3px;
}

.time-control .btn-row {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.time-control button:not(.help-btn-inline) {
    flex: 1;
    padding: 5px 8px;
    font-size: var(--text-xs);
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    cursor: pointer;
}

.time-control button:not(.help-btn-inline):hover {
    background: #e0e0e0;
}

.time-control button.active {
    background: #00BFFF;
    color: white;
    border-color: #00BFFF;
}

.time-control .shadow-toggle {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-control .shadow-toggle input {
    width: 16px;
    height: 16px;
}

/* Panneau d'informations éclipse calculées - Style collapsible */
.eclipse-calc-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    width: 260px;
}

.eclipse-calc-box .eclipse-calc-header {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #eee;
    user-select: none;
}

.eclipse-calc-box .eclipse-calc-header:hover {
    background: #f9f9f9;
}

.eclipse-calc-box .eclipse-calc-header h3 {
    margin: 0;
    flex: 1;
    font-size: var(--text-base);
    color: #333;
    border: none;
    padding: 0;
}

.eclipse-calc-box .eclipse-calc-toggle {
    color: #999;
    font-size: var(--text-xs);
}

/* Icône d'ouverture/fermeture du panneau skyline */
.skyline-toggle {
    font-size: var(--text-base) !important;
    font-weight: bold;
    color: #666 !important;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 1px 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.skyline-toggle:hover {
    background: #e0e0e0;
}

.eclipse-calc-box .eclipse-calc-body {
    padding: 12px 15px;
}

.eclipse-calc-box .calc-content {
    font-size: var(--text-xs);
    line-height: 1.6;
}

.eclipse-calc-box .calc-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.eclipse-calc-box .calc-label {
    color: #666;
}

.eclipse-calc-box .calc-value {
    color: #333;
    font-weight: 500;
    font-family: monospace;
}

.eclipse-calc-box .calc-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.eclipse-calc-box .calc-section-title {
    font-weight: bold;
    color: #444;
    margin-bottom: 6px;
    font-size: var(--text-xs);
    text-transform: uppercase;
}

.eclipse-calc-box .total-badge {
    display: inline-block;
    background: #800080;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-xs);
    font-weight: bold;
}

.eclipse-calc-box .partial-badge {
    display: inline-block;
    background: #FFA500;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-xs);
    font-weight: bold;
}

.eclipse-calc-box .not-visible-badge {
    display: inline-block;
    background: #999;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-xs);
    font-weight: bold;
}

.eclipse-calc-box .loading {
    color: #999;
    font-style: italic;
}

.eclipse-calc-box .error {
    color: #c00;
    font-size: var(--text-xs);
}

.eclipse-calc-box .duration-highlight {
    color: #800080;
    font-weight: bold;
    font-size: var(--text-base);
}

.eclipse-calc-box .crosshair-info {
    font-size: var(--text-xs);
    color: #888;
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

/* Diagramme Soleil/Lune */
.eclipse-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 8px 0;
}

.eclipse-diagram svg {
    max-width: 100%;
}

/* Toggle UTC/Local (header) - masqué car déplacé dans le panel Eclipse */
.timezone-toggle {
    display: none;
}

.timezone-toggle:hover {
    background: #e8e8e8;
}

.timezone-toggle .tz-option {
    padding: 3px 6px;
    border-radius: 3px;
    color: #888;
    transition: all 0.2s;
}

.timezone-toggle .tz-option.active {
    background: #4A90D9;
    color: white;
}

.timezone-toggle .tz-separator {
    color: #ccc;
    font-weight: normal;
}

/* Toggle UTC/Local dans le panel Eclipse */
.eclipse-tz-toggle {
    background: #f5f5f5;
    border: 1px solid #ccc;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    transition: all 0.2s;
}

.eclipse-tz-toggle:hover {
    background: #e8e8e8;
}

.eclipse-tz-toggle .etz-option {
    padding: 2px 4px;
    border-radius: 2px;
    color: #888;
    transition: all 0.2s;
}

.eclipse-tz-toggle .etz-option.active {
    background: #4A90D9;
    color: white;
}

.eclipse-tz-toggle .etz-separator {
    color: #ccc;
    font-weight: normal;
}

/* Bouton Eclipsefan */
.eclipsefan-control {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.eclipsefan-btn {
    background: #800080;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.eclipsefan-btn:hover {
    background: #660066;
}

.eclipsefan-btn svg {
    width: 14px;
    height: 14px;
}

/* Modal dialog */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    min-width: 320px;
    max-width: 90%;
}

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

.modal-header h3 {
    margin: 0;
    font-size: var(--text-md);
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-xl);
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-field {
    margin-bottom: 16px;
}

.modal-field label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.modal-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: var(--text-base);
    box-sizing: border-box;
}

.modal-field input:focus {
    outline: none;
    border-color: #800080;
    box-shadow: 0 0 0 2px rgba(128,0,128,0.1);
}

.modal-field .field-hint {
    font-size: var(--text-xs);
    color: #888;
    margin-top: 4px;
}

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

.modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn-cancel {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
}

.modal-btn-cancel:hover {
    background: #e5e5e5;
}

.modal-btn-ok {
    background: #800080;
    border: none;
    color: white;
}

.modal-btn-ok:hover {
    background: #660066;
}

.modal-btn-ok:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.modal-loading {
    display: none;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: var(--text-sm);
}

.modal-loading.active {
    display: flex;
}

.modal-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #800080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Disposition verticale des panneaux en bas à gauche */
.leaflet-bottom.leaflet-left {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 5px;
}

.leaflet-bottom.leaflet-left .leaflet-control {
    margin-left: 10px !important;
    margin-bottom: 0 !important;
}

.leaflet-bottom.leaflet-left .leaflet-control-scale {
    margin-bottom: 10px !important;
}

/* Positionner le contrôle des icônes en bas, sous la timeline */
.leaflet-bottom.leaflet-left .custom-layers-control {
    position: fixed !important;
    bottom: 30px; /* En bas, au-dessus du copyright */
    left: 50%;
    transform: translateX(-50%);
    margin: 0 !important;
    z-index: 999;
}

/* Marqueur de sélection (icône personnalisée via Leaflet DivIcon) */
.selection-marker-icon {
    width: 24px;
    height: 24px;
    position: relative;
}
.selection-marker-icon::before,
.selection-marker-icon::after {
    content: '';
    position: absolute;
    background-color: #e74c3c;
    border-radius: 1px;
}
/* Ligne horizontale */
.selection-marker-icon::before {
    width: 24px;
    height: 3px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}
/* Ligne verticale */
.selection-marker-icon::after {
    width: 3px;
    height: 24px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}
/* Cercle central */
.selection-marker-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #e74c3c;
    border: 2px solid white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Position personnalisée pour les contrôles en bas au centre */
.leaflet-bottom.leaflet-center {
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-end;
    pointer-events: none;
}

.leaflet-bottom.leaflet-center > * {
    pointer-events: auto;
}

/* Sur mobile, empiler verticalement */
@media (max-width: 900px) {
    .leaflet-bottom.leaflet-center {
        flex-direction: column;
        align-items: center;
    }
}

/* Sur mobile, adapter les panels de gauche */
@media (max-width: 767px) {
    .leaflet-bottom.leaflet-left .leaflet-control {
        max-width: calc(100vw - 20px);
    }

    /* Réduire la taille des panels sur mobile */
    .legend, .eclipse-calc-box, .time-control,
    .weather-history-control, .skyline-control-v2 {
        min-width: 200px !important;
        max-width: 260px !important;
        font-size: var(--text-xs) !important;
    }

    /* Boutons d'action plus compacts sur mobile */
    .action-buttons-control {
        gap: 5px;
    }
    .share-btn, .eclipsefan-btn {
        padding: 6px 10px !important;
        font-size: var(--text-xs) !important;
    }
    .share-btn span, .eclipsefan-btn span {
        display: none;
    }

    /* Contrôle des icônes en bas sur mobile, sous la timeline */
    .leaflet-bottom.leaflet-left .custom-layers-control {
        bottom: 100px; /* Au-dessus du bottom sheet fermé */
        bottom: calc(100px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%);
        width: 260px; /* Même largeur que timeline-datetime sur mobile */
    }

    /* Panneaux s'ouvrent vers le haut sur mobile, bas aligné avec bas de la timeline */
    .custom-layers-control .control-panel {
        bottom: 50px; /* Bas du panel aligné avec bas de la timeline (150px - 100px) */
        width: 260px; /* Même largeur que la barre d'icônes sur mobile */
        max-width: calc(100vw - 24px);
        max-height: 40vh;
    }
}
