/* GG LocalRadar — Frontend v2.1 */
.gglr-wrap {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1;
    color: #fff;
    max-width: 100%;
}
.gglr-wrap *, .gglr-wrap *::before, .gglr-wrap *::after { box-sizing: border-box; }

/* Map container */
.gglr-map-outer {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #0d1117;
}

.gglr-leaflet-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ── Loading overlay ─────────────────────────────────── */
.gglr-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(10, 14, 20, .85);
    z-index: 900;
}
.gglr-loading-overlay span { color: #8b949e; font-size: 13px; }
.gglr-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(88, 166, 255, .2);
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: gglr-spin .7s linear infinite;
}
@keyframes gglr-spin { to { transform: rotate(360deg); } }

/* ── Error overlay ───────────────────────────────────── */
.gglr-error-overlay {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(10, 14, 20, .9);
    z-index: 910;
    padding: 24px;
    text-align: center;
}
.gglr-error-icon { font-size: 32px; color: #f0883e; }
.gglr-error-msg  { color: #8b949e; font-size: 13px; line-height: 1.6; margin: 0; max-width: 340px; }

/* ══════════════════════════════════════════════════════
   CONTROL BAR — floats over bottom of map.
   Right side kept clear so it doesn't overlap anything.
   ══════════════════════════════════════════════════════ */
.gglr-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px 18px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(8, 12, 18, .55) 25%,
        rgba(8, 12, 18, .88) 100%
    );
}

/* ── Play / Pause button ─────────────────────────────── */
.gglr-play-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.4);
    background: rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s, transform .1s;
    padding: 0;
    /* Visible filled shape — no invisible-icon problem */
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.gglr-play-btn:hover {
    background: rgba(255,255,255,.28);
    border-color: rgba(255,255,255,.7);
    transform: scale(1.06);
}
.gglr-play-btn:active { transform: scale(.95); }
/* Icons are real SVG shapes — always visible */
.gglr-play-btn svg { display: block; pointer-events: none; }

/* ── Timeline ────────────────────────────────────────── */
.gglr-timeline {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gglr-ts-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.gglr-ts {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
    text-shadow: 0 1px 6px rgba(0,0,0,.8);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.gglr-live-badge {
    display: none;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    color: #fff;
    background: #e8321a;
    border-radius: 3px;
    padding: 2px 6px;
    text-transform: uppercase;
    animation: gglr-live-pulse 2s ease-in-out infinite;
}
@keyframes gglr-live-pulse { 0%,100%{opacity:1} 50%{opacity:.65} }

/* ── Scrubber ────────────────────────────────────────── */
.gglr-scrubber {
    position: relative;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.gglr-scrubber-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,.25);
    border-radius: 2px;
}
.gglr-scrubber-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: #fff;
    border-radius: 2px;
    width: 0;
    transition: width .1s linear;
}
.gglr-scrubber-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,.25), 0 2px 6px rgba(0,0,0,.5);
    left: 0;
    transition: left .1s linear;
    pointer-events: none;
}
.gglr-scrubber:hover .gglr-scrubber-thumb { transform: translate(-50%,-50%) scale(1.25); }

/* ── Time labels ─────────────────────────────────────── */
.gglr-time-labels {
    display: flex;
    justify-content: space-between;
}
.gglr-t-label {
    font-size: 11px;
    color: rgba(255,255,255,.55);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ── Attribution bar (below map, not inside it) ──────── */
.gglr-attribution {
    background: #0d1117;
    border: 1px solid #21262d;
    border-top: none;
    padding: 5px 12px;
    font-size: 11px;
    color: #484f58;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.gglr-attribution a { color: #388bfd; text-decoration: none; }
.gglr-attribution a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════
   Legend control (Leaflet overlay)
   ══════════════════════════════════════════════════════ */
.gglr-legend {
    background: rgba(13, 17, 23, .9);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    backdrop-filter: blur(8px);
    color: #c9d1d9;
    min-width: 160px;
    max-width: 210px;
    box-shadow: 0 4px 16px rgba(0,0,0,.45);
    overflow: hidden;
}
.gglr-legend-hdr {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #8b949e;
    cursor: pointer;
    user-select: none;
    transition: color .15s;
}
.gglr-legend-hdr:hover { color: #e6edf3; }
.gglr-legend-icon { flex-shrink: 0; }
.gglr-legend-body {
    padding: 2px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 300px;
    overflow: hidden;
    transition: max-height .2s ease, padding .2s ease, opacity .2s;
    opacity: 1;
}
.gglr-legend-collapsed .gglr-legend-body {
    max-height: 0;
    padding-top: 0; padding-bottom: 0;
    opacity: 0;
}
.gglr-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.gglr-legend-sw {
    width: 22px; height: 11px;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}
.gglr-legend-label { flex: 1; color: #e6edf3; }
.gglr-legend-sub   { font-size: 10px; color: #6e7681; white-space: nowrap; }

/* ── Standalone legend shortcode ─────────────────────── */
.gglr-legend-standalone {
    background: #fff;
    border: 1px solid #dcdcde;
    padding: 20px 24px;
    max-width: 700px;
    overflow-x: auto;
}
.gglr-legend-table { width:100%; border-collapse:collapse; font-size:13px; }
.gglr-legend-table th { text-align:left; padding:6px 10px; background:#f6f7f7; border-bottom:2px solid #dcdcde; font-size:11px; color:#646970; text-transform:uppercase; letter-spacing:.05em; }
.gglr-legend-table td { padding:8px 10px; border-bottom:1px solid #f0f0f1; vertical-align:middle; }
.gglr-legend-table tr:last-child td { border-bottom:none; }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .gglr-bar { padding: 10px 12px 14px; gap: 10px; }
    .gglr-play-btn { width: 36px; height: 36px; }
    .gglr-ts { font-size: 14px; }
    .gglr-t-label { font-size: 10px; }
}
