/* ================================================================================
   CRAWLS.CSS - Generated GF pub crawls overlay
   All selectors scoped to #crawlsOverlay
   ================================================================================ */

/* ================================
   HEADER
   ================================ */
#crawlsOverlay .crawls-header {
    padding: var(--space-xl) var(--space-lg) var(--space-md);
    background: var(--header-gradient);
    color: var(--text-white);
}

#crawlsOverlay .crawls-header-inner {
    max-width: 700px;
    margin: 0 auto;
}

#crawlsOverlay .crawls-title {
    margin: 0;
    font-size: var(--text-2xl);
}

#crawlsOverlay .crawls-subtitle {
    margin: var(--space-xs) 0 var(--space-md);
    opacity: 0.85;
    font-size: var(--text-sm);
}

/* ================================
   SEARCH BAR
   ================================ */
#crawlsOverlay .crawls-search {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

#crawlsOverlay .crawls-search-input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    font-size: var(--text-md);
}

#crawlsOverlay .crawls-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#crawlsOverlay .crawls-search-input:focus {
    outline: none;
    border-color: var(--text-white);
    background: rgba(255, 255, 255, 0.25);
}

#crawlsOverlay .crawls-search-btn {
    flex-shrink: 0;
    width: 44px;
    border: none;
    border-radius: var(--radius-circle);
    background: var(--text-white);
    cursor: pointer;
    font-size: var(--text-lg);
}

/* ================================
   CITY PILLS
   ================================ */
#crawlsOverlay .crawls-city-pills {
    display: flex;
    gap: var(--space-sm);
}

#crawlsOverlay .crawls-pills-label {
    align-self: center;
    margin-right: var(--space-xs);
    font-size: var(--text-sm);
    opacity: 0.8;
}

#crawlsOverlay .crawls-city-pill {
    padding: var(--space-xs) var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-white);
    cursor: pointer;
    font-size: var(--text-sm);
}

#crawlsOverlay .crawls-city-pill.active {
    background: var(--text-white);
    color: var(--purple);
}

/* ================================
   BODY
   ================================ */
#crawlsOverlay .crawls-body {
    padding: var(--space-lg);
}

#crawlsOverlay .crawls-loading {
    text-align: center;
    padding: var(--space-4xl) 0;
    color: var(--text-secondary);
}

/* Full-width map — edge to edge, taller. */
#crawlsOverlay .crawls-map {
    width: 100%;
    height: 30vh;
    min-height: 260px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

/* ================================
   EMPTY STATE
   ================================ */
#crawlsOverlay .crawls-empty {
    text-align: center;
    padding: var(--space-4xl) var(--space-lg);
    color: var(--text-secondary);
}

#crawlsOverlay .crawls-empty-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-md);
}

#crawlsOverlay .crawls-empty-text {
    max-width: 320px;
    margin: 0 auto;
    font-size: var(--text-md);
    line-height: 1.5;
}

/* ================================
   STOP LIST
   ================================ */
#crawlsOverlay .crawls-stop {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
}

#crawlsOverlay .crawls-stop.is-unchecked {
    opacity: 0.5;
}

#crawlsOverlay .crawls-stop.is-dragging {
    opacity: 0.6;
    box-shadow: var(--shadow-lg);
}

#crawlsOverlay .crawls-stop-handle {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 24px;
    align-self: stretch;
    color: var(--text-muted);
    font-size: var(--text-lg);
    cursor: grab;
    touch-action: none;
}

#crawlsOverlay .crawls-stop-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: var(--purple);
    color: var(--white);
    border-radius: var(--radius-circle);
    font-weight: 700;
    font-size: var(--text-sm);
}

/* Stop name — one line, ellipsis if it's long, so every pill is the same
   height regardless of name length. The body must be allowed to shrink. */
#crawlsOverlay .crawls-stop-body {
    cursor: pointer;
    flex: 1;
    min-width: 0;   /* lets the name actually truncate instead of overflowing */
}

#crawlsOverlay .crawls-stop-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#crawlsOverlay .crawls-stop-hero {
    display: inline-block;
    margin-top: var(--space-xxs);
    font-size: var(--text-xs);
    color: var(--amber);
}

#crawlsOverlay .crawls-stop-leg {
    margin-top: var(--space-xxs);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

#crawlsOverlay .crawls-stop-toggle {
    margin-left: auto;
    width: 20px;
    height: 20px;
    accent-color: var(--purple);
}

#crawlsOverlay .crawls-extra-label {
    margin: var(--space-lg) 0 var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 600;
}

/* ================================================================================
   MAP MARKERS — NOT scoped to #crawlsOverlay on purpose.
   Leaflet renders marker divIcons into the map pane, which is NOT inside the
   #crawlsOverlay DOM subtree. Scoping these would break the markers.
   ================================================================================ */
.crawl-marker-inner {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: var(--purple);
    color: #fff;
    border: 2px solid #fff;
    border-radius: var(--radius-circle);
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.crawl-marker-hero .crawl-marker-inner {
    background: var(--amber);
    font-size: 15px;
}

.crawl-you-marker img {
    width: 48px;
    height: 48px;
}

#crawlsOverlay .crawls-further-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
    cursor: pointer;
}

#crawlsOverlay .crawls-further-name {
    font-weight: 600;
    color: var(--text-primary);
}

#crawlsOverlay .crawls-further-dist {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

#crawlsOverlay .crawls-stop-view {
    flex-shrink: 0;
    align-self: center;
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--border-purple);
    border-radius: var(--radius-pill);
    background: var(--bg-purple);
    color: var(--purple);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
}

#crawlsOverlay .crawls-setup {
    padding: var(--space-sm) 0;
}

#crawlsOverlay .crawls-setup-block {
    margin-bottom: var(--space-2xl);
}

#crawlsOverlay .crawls-setup-label {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

#crawlsOverlay .crawls-icon-grid {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

#crawlsOverlay .crawls-icon-opt {
    flex: 1;
    min-width: 56px;
    padding: var(--space-sm);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition);
}

#crawlsOverlay .crawls-icon-opt img {
    width: 100%;
    height: auto;
    max-height: 56px;
}

#crawlsOverlay .crawls-icon-opt.selected {
    border-color: var(--purple);
    background: var(--bg-purple);
    transform: translateY(-2px);
}

#crawlsOverlay .crawls-setup-here {
    width: 100%;
    padding: var(--space-md);
    border: none;
    border-radius: var(--radius-lg);
    background: var(--purple);
    color: var(--white);
    font-size: var(--text-md);
    font-weight: 700;
    cursor: pointer;
}

#crawlsOverlay .crawls-setup-or {
    text-align: center;
    margin: var(--space-md) 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

#crawlsOverlay .crawls-hero-controls {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

#crawlsOverlay .crawls-hero-btn {
    padding: var(--space-xs) var(--space-lg);
    border: none;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
}

#crawlsOverlay .crawls-hero-btn.start {
    background: var(--amber);
    color: #1a1a1a;
}

#crawlsOverlay .crawls-hero-btn.finish {
    background: var(--white);
    color: var(--purple);
}

#crawlsOverlay .crawls-hero-btn.new {
    background: transparent;
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Check-in button on active-crawl stop cards */
#crawlsOverlay .crawls-stop-checkin {
    flex-shrink: 0;
    align-self: center;
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--purple);
    border-radius: var(--radius-pill);
    background: var(--purple);
    color: var(--white);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
}

#crawlsOverlay .crawls-stop-checkin.done {
    background: #1f9d55;
    border-color: #1f9d55;
}

#crawlsOverlay .crawls-stop.is-done {
    opacity: 0.7;
}

#crawlsOverlay .crawls-stop.is-done .crawls-stop-num {
    background: #1f9d55;
}

/* Whole-card tier hue — subtle wash + left accent. Uses theme tokens.
   Layered over --bg-card so it reads as a tint, not a repaint. */
#crawlsOverlay .crawls-stop.tier-diamond {
    background:
        linear-gradient(90deg, var(--bg-blue), transparent 60%),
        var(--bg-card);
    border-left: 3px solid var(--blue);
}

#crawlsOverlay .crawls-stop.tier-gold {
    background:
        linear-gradient(90deg, var(--bg-gold), transparent 60%),
        var(--bg-card);
    border-left: 3px solid var(--level-gold);
}

#crawlsOverlay .crawls-stop.tier-silver {
    background:
        linear-gradient(90deg, var(--bg-grey), transparent 60%),
        var(--bg-card);
    border-left: 3px solid var(--level-silver);
}

#crawlsOverlay .crawls-stop.tier-bronze {
    background:
        linear-gradient(90deg, var(--bg-orange), transparent 60%),
        var(--bg-card);
    border-left: 3px solid var(--level-bronze);
}

/* Done — green wash + accent, overrides any tier (set AFTER tier rules so it
   wins on source order at equal specificity). */
#crawlsOverlay .crawls-stop.is-done {
    background:
        linear-gradient(90deg, var(--bg-green), transparent 60%),
        var(--bg-card);
    border-left: 3px solid var(--green);
    opacity: 0.85;
}

#crawlsOverlay .crawls-stop-tier {
    font-size: var(--text-sm);
}

#crawlsOverlay .crawls-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

#crawlsOverlay .crawls-header-text {
    min-width: 0;   /* lets a long title wrap/ellipsis instead of shoving the button off */
}

/* Google Places autocomplete — force full width to match Near me + pills.
   The element renders its own input internally; both need width:100%. */
#crawlsOverlay .crawls-autocomplete-mount {
    width: 100%;
}

#crawlsOverlay #crawlsAutocompleteInput {
    width: 100%;
    display: block;
}

/* Google renders its input inside the custom element — reach it so the field,
   not just the wrapper, spans the full width. */
#crawlsOverlay gmp-place-autocomplete {
    width: 100%;
    display: block;
}

/* Theme the Places element to match the overlay's dark surface + rounding,
   so it reads as part of the setup screen, not a bolted-on Google box. */
#crawlsOverlay #crawlsAutocompleteInput {
    --gmp-mat-color-surface: var(--bg-input);
    --gmp-mat-color-on-surface: var(--text-primary);
    --gmp-mat-color-on-surface-variant: var(--text-muted);
    --gmp-mat-color-outline: var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#crawlsOverlay .crawls-hero-btn.edit {
    background: rgba(255, 255, 255, 0.18);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ✕ Remove — same footprint as the check-in button it replaces, red accent
   so it reads as destructive and the row height doesn't shift in edit mode. */
#crawlsOverlay .crawls-stop-remove {
    flex-shrink: 0;
    align-self: center;
    width: 36px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: transparent;
    color: #e0556b;
    font-size: var(--text-md);
    font-weight: 700;
    cursor: pointer;
}