/* ============================================================================
   poi.css — the user's own points on a map (assets/js/poi.js)

   Self-contained: the values are assets/css/tokens.css's, written out, because
   Cykelruter and Syd for Solen do not load tokens.css. Motion follows the
   shared vocabulary: the needle drops in with the spring, the editor rises.
   ========================================================================== */

/* ── Needle ─────────────────────────────────────────────────────────────── */
.poi-needle-wrap { background: none; border: none; }
.poi-needle {
    width: 28px;
    height: 40px;
    filter: drop-shadow(0 3px 4px rgba(31, 61, 43, .35));
    transform-origin: 50% 100%;
    transition: transform 280ms cubic-bezier(.34, 1.4, .64, 1);
    cursor: pointer;
}
.poi-needle svg { display: block; }
.poi-needle-wrap:hover .poi-needle,
.poi-needle-wrap:focus-visible .poi-needle { transform: scale(1.12); }
.leaflet-dragging .poi-needle-wrap .poi-needle,
.poi-needle-wrap.leaflet-drag-target .poi-needle { transform: translateY(-6px) scale(1.12); }

@keyframes poi-drop {
    0%   { opacity: 0; transform: translateY(-26px); }
    70%  { opacity: 1; }
}
.poi-drop {
    animation: poi-drop 280ms cubic-bezier(.34, 1.4, .64, 1) backwards;
    animation-delay: calc(var(--i, 0) * 40ms);
}
.poi-leaving .poi-needle { transition: transform 180ms ease, opacity 180ms ease; transform: scale(.4); opacity: 0; }

/* ── Editor popup ───────────────────────────────────────────────────────── */
.poi-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(31, 61, 43, .18);
    border: 1px solid #DED7C7;
    animation: poi-rise 240ms cubic-bezier(.2, .8, .2, 1) backwards;
}
.poi-popup .leaflet-popup-content { margin: 0; width: auto !important; min-width: 260px; }
.poi-popup .leaflet-popup-tip { border: 1px solid #DED7C7; box-shadow: none; }
.poi-popup a.leaflet-popup-close-button { top: 8px; right: 8px; width: 28px; height: 28px; font-size: 18px; line-height: 26px; color: #4C7A5A; }
@keyframes poi-rise { from { opacity: 0; transform: translateY(8px); } }

.poi-editor {
    padding: 14px 16px 14px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1F3D2B;
    font-size: 13px;
}
.poi-head { display: flex; align-items: center; gap: 8px; margin: 0 28px 10px 0; }
.poi-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--poi, #D96C3F); transition: background 120ms ease; }
.poi-micro {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #4C7A5A;
}

.poi-table { width: 100%; border-collapse: collapse; }
.poi-table th {
    width: 72px;
    padding: 6px 10px 6px 0;
    text-align: left;
    vertical-align: top;
    font-weight: 500;
    font-size: 12px;
    color: #4C7A5A;
    white-space: nowrap;
    line-height: 30px;
}
.poi-table td { padding: 4px 0; }
.poi-table tr + tr th, .poi-table tr + tr td { border-top: 1px solid #E6E0D2; }

.poi-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid #DED7C7;
    border-radius: 9px;
    background: #fff;
    color: #1F3D2B;
    font: inherit;
    font-size: 13px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea.poi-input { resize: vertical; min-height: 48px; line-height: 1.45; }
.poi-input:focus { outline: none; border-color: #F2C14E; box-shadow: 0 0 0 3px rgba(242, 193, 78, .35); }
.poi-pos {
    display: block;
    padding: 7px 0 6px;
    line-height: 1.5;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: .04em;
    color: #1F3D2B;
    white-space: pre-line;
}

.poi-status { margin: 6px 0 0; min-height: 0; font-size: 12px; color: #B9552C; }
.poi-status:empty { display: none; }

.poi-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.poi-btn {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 11px;
    font: 500 13px 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.poi-btn:active { transform: translateY(.5px) scale(.985); }
.poi-btn:disabled { opacity: .55; cursor: default; }
.poi-btn--primary { border: 0; background: #F2C14E; color: #1F3D2B; font-weight: 600; }
.poi-btn--primary:hover:not(:disabled) { background: #F6CF6E; }
.poi-btn--ghost { border: 1px solid #DED7C7; background: #fff; color: #1F3D2B; }
.poi-btn--ghost:hover:not(:disabled) { border-color: #B9AF98; background: #F4F1EA; }

/* ── "Mine punkter" chip ────────────────────────────────────────────────── */
.poi-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.poi-chip__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 12px 0 10px;
    border: 1px solid #DED7C7;
    border-radius: 10px;
    background: rgba(255, 255, 255, .94);
    color: #1F3D2B;
    font: 500 12px 'Inter', system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(31, 61, 43, .08);
    transition: background 120ms ease, opacity 120ms ease;
}
.poi-chip__btn:hover { background: #fff; }
.poi-chip__btn[aria-pressed="false"] { opacity: .6; }
.poi-chip__icon {
    width: 10px; height: 14px;
    background: #D96C3F;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
}
.poi-chip__count {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 100px;
    background: #FCF2DC;
    color: #8A6510;
}
.poi-chip__tip {
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(31, 61, 43, .88);
    color: #F4F1EA;
    font: 400 11px 'Inter', system-ui, sans-serif;
    white-space: nowrap;
    transition: opacity 240ms ease, transform 240ms ease;
}
.poi-chip.is-used .poi-chip__tip { opacity: 0; transform: translateY(4px); pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
    .poi-drop, .poi-popup .leaflet-popup-content-wrapper { animation: none; }
    .poi-needle, .poi-chip__tip { transition: none; }
}
