/**
 * Visualiseur de trace GPX — extension
 *
 * Styles isolés, chargés seulement quand l'extension est active sur le
 * produit : les fondre dans la feuille du module les imposerait à
 * toutes les fiches.
 */

.gpx-viewer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
}

/* Statistiques : elles confirment que le bon fichier a été lu. */
.gpx-viewer__stats {
    flex: 1;
    text-align: right;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.gpx-viewer__map {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bg-surface-secondary);
}

.gpx-viewer__empty {
    margin: 0;
    padding: var(--space-lg);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

/* ── Affichage dans la page ── */

.gpx-viewer--inline {
    margin-top: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    overflow: hidden;
}

.gpx-viewer--inline[hidden] { display: none; }

/* ── Affichage en fenêtre ── */

.gpx-viewer--modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.5);
}

.gpx-viewer--modal[hidden] { display: none; }

.gpx-viewer__box {
    width: 100%;
    max-width: 560px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.gpx-viewer__close {
    border: 0;
    background: none;
    color: var(--text-tertiary);
    font-size: var(--font-size-xl);
    line-height: 1;
    cursor: pointer;
}

.gpx-viewer__close:hover { color: var(--text-primary); }

/* ── Déclencheurs ── */

/* Vignette de galerie : désactivée tant qu'aucune trace n'est déposée,
   plutôt qu'absente — sa présence annonce la fonction. */
.gpx-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: var(--font-size-lg);
}

.gpx-thumb:disabled,
.gpx-open:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.gpx-thumb:not(:disabled) { color: var(--primary-500); }

.gpx-open { margin-bottom: var(--space-md); }
