/* Gosscard — Trasy. Reuse bottom-sheet (.gc-mtg-*) + design tokeny (gosscard-theme.css). */

/* --- FAB „Naplánovat trasu" --- */
/* Sjednoceno se stylem chat/foto FAB (.gosscard-map-fab): solidní modrá + bílá ikona. */
.gc-route-fab {
    width: 52px; height: 52px; border-radius: 50% !important;
    background: var(--gc-primary-strong, #0069d9);
    color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28) !important;
    font-size: 22px; line-height: 1; transition: transform .15s ease, box-shadow .2s ease;
}
.gc-route-fab:hover { transform: scale(1.05); box-shadow: 0 6px 18px rgba(0, 0, 0, .32) !important; }
.gc-route-fab:active { transform: scale(.94); }
.gc-route-fab i { pointer-events: none; }

/* --- Číslovaný marker zastávky --- */
.gc-route-stop-marker { background: none; border: none; }
.gc-route-stop-pin {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--gc-primary-grad-strong);
    color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.gc-route-stop-pin--draft { background: linear-gradient(135deg, #f59e0b, #fbbf24); cursor: grab; } /* dočasný stav při kreslení */
.gc-route-stop-pin { position: relative; }
.gc-route-stop-badge {
    position: absolute; top: -7px; right: -7px;
    background: var(--gc-danger-strong); color: #fff; font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 8px; padding: 0 3px;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}

/* --- Panel při kreslení trasy --- */
.gc-route-draw {
    position: fixed; left: 50%; bottom: calc(20px + var(--gc-safe-bottom, 0px)); transform: translateX(-50%);
    z-index: 10040; width: calc(100% - 32px); max-width: 440px;
    background: var(--gc-surface); border-radius: var(--gc-radius-lg); box-shadow: 0 10px 34px rgba(0, 0, 0, .25);
    padding: 14px 16px;
}
.gc-route-draw__title { font-size: 15px; font-weight: 700; color: var(--gc-text); margin: 0 0 2px; display: flex; align-items: center; gap: 6px; }
.gc-route-draw__hint { font-size: 13px; color: var(--gc-text-muted); margin: 0 0 10px; }
.gc-route-draw__count { font-weight: 700; color: var(--gc-primary); }
.gc-route-draw__actions { display: flex; gap: 10px; }

/* --- Seznam zastávek v detailu --- */
.gc-route-stops-list { margin: 4px 0 16px; padding: 0; list-style: none; }
.gc-route-stops-list li {
    display: flex; align-items: center; gap: 10px; padding: 7px 0;
    border-bottom: 1px solid #f1f5f9; font-size: 14px; color: #334155;
}
.gc-route-stops-list li:last-child { border-bottom: none; }
.gc-route-stops-list .gc-route-num {
    flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--gc-primary-soft); color: var(--gc-primary-strong); font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.gc-route-chip-teal { background: var(--gc-primary-soft) !important; color: var(--gc-primary-strong) !important; }

/* --- Interaktivní zastávka (join po zastávkách) --- */
.gc-route-stop-row { flex-wrap: wrap; }
.gc-route-stop-name { flex: 1; min-width: 0; }
.gc-route-stop-count { color: var(--gc-join); font-weight: 600; font-size: 12px; margin-left: 4px; }
.gc-route-stop-avs { display: inline-flex; align-items: center; }
.gc-route-stop-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin-left: -6px; border: 2px solid #fff; }
.gc-route-stop-av:first-child { margin-left: 0; }
.gc-route-stop-btn {
    flex: 0 0 auto; border: 1.5px solid var(--gc-primary); background: #fff; color: var(--gc-primary);
    border-radius: var(--gc-radius-pill); padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all .15s ease;
}
.gc-route-stop-btn:hover { background: var(--gc-primary-soft); }
.gc-route-stop-btn:active { transform: scale(.95); }
.gc-route-stop-btn.is-joined { background: var(--gc-join-strong); color: #fff; border-color: var(--gc-join-strong); }
.gc-route-stop-btn:disabled { opacity: .5; }

/* --- Sdílená stránka /route/{hash} --- */
.gc-route-page { max-width: 720px; margin: 0 auto; padding: 0 0 48px; }
.gc-route-page__map { width: 100%; height: 300px; background: var(--gc-bg-soft); position: relative; }
.gc-route-page #routeMap { position: absolute; inset: 0; }
.gc-route-page__panel { padding: 20px 18px 8px; }
.gc-route-page__panel h1 { font-size: 22px; font-weight: 700; color: var(--gc-text); margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.gc-route-page__owner { font-size: 14px; color: var(--gc-text-muted); margin: 0 0 14px; }
.gc-route-page__share { display: flex; gap: 10px; margin: 6px 0 18px; }
.gc-route-page--error { text-align: center; padding: 64px 24px; max-width: 480px; margin: 0 auto; }
.gc-route-page--error h2 { font-size: 22px; color: var(--gc-text); margin: 0 0 8px; }
.gc-route-page--error p { color: var(--gc-text-muted); margin: 0 0 20px; }
.gc-route-page--error .gc-mtg-btn { display: inline-block; text-decoration: none; text-align: center; }

/* ===================================================================
   Detail trasy (/route/{hash}) — vypiplaný detail (hero, statistiky,
   timeline zastávek, účastníci, sticky akce). Sladěno s --gc-* tokeny.
   =================================================================== */
.gc-route-detail { max-width: 760px; margin: 0 auto; padding: 0 0 12px; background: var(--gc-surface); }
@media (min-width: 780px) {
    .gc-route-detail { margin: 18px auto; border: 1px solid var(--gc-border); border-radius: var(--gc-radius-lg); overflow: hidden; box-shadow: var(--gc-shadow-md); }
}

/* HERO */
.gc-route-detail__hero { display: flex; align-items: center; gap: 14px; padding: 20px 56px 18px 20px; background: var(--gc-primary-grad-strong); color: #fff; position: relative; }
.gc-route-detail__hero-icon { flex: none; width: 52px; height: 52px; display: grid; place-items: center; font-size: 26px; background: rgba(255,255,255,.18); border-radius: var(--gc-radius); }
.gc-route-detail__hero-main { flex: 1; min-width: 0; }
.gc-route-detail__title { font-size: 22px; line-height: 1.25; font-weight: 700; margin: 0 0 6px; color: #fff; overflow-wrap: anywhere; }
.gc-route-detail__owner { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: rgba(255,255,255,.92); }
.gc-route-detail__owner-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.6); flex: none; background: rgba(255,255,255,.25); }
.gc-route-detail__owner strong { font-weight: 600; }
.gc-route-detail__badge { position: absolute; top: 14px; right: 16px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--gc-radius-pill); white-space: nowrap; }
.gc-route-detail__badge--joined { background: rgba(255,255,255,.95); color: var(--gc-join-strong); }
.gc-route-detail__badge--cancelled { background: var(--gc-danger-strong); color: #fff; }

/* MAPA */
.gc-route-detail__map { width: 100%; height: 300px; background: var(--gc-bg-soft); position: relative; }
/* `#meetingMap` je stejny kontejner na strance setkani. Bez teto radky
   nedostal zadnou vysku a Leaflet kreslil do 0 px — z mapy zbyl sedy pas. */
.gc-route-detail__map #routeMap,
.gc-route-detail__map #meetingMap { position: absolute; inset: 0; }

/* STATISTIKY */
.gc-route-detail__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--gc-border); border-bottom: 1px solid var(--gc-border); }
.gc-route-stat { background: var(--gc-surface); padding: 14px 8px; text-align: center; }
.gc-route-stat__num { display: block; font-size: 22px; font-weight: 700; color: var(--gc-primary-strong); line-height: 1.1; }
.gc-route-stat__label { display: block; font-size: 12px; color: var(--gc-text-muted); margin-top: 2px; }

/* TĚLO + sekce */
.gc-route-detail__body { padding: 18px 20px 8px; }
.gc-route-detail__section { margin-bottom: 22px; }
.gc-route-detail__section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--gc-text); margin: 0 0 12px; }
.gc-route-detail__count { font-size: 12px; font-weight: 700; color: var(--gc-primary-strong); background: var(--gc-primary-soft); border-radius: var(--gc-radius-pill); padding: 1px 9px; }
.gc-route-detail__note { font-size: 14.5px; line-height: 1.6; color: var(--gc-text); background: var(--gc-bg-soft); border-left: 3px solid var(--gc-primary); border-radius: 0 var(--gc-radius) var(--gc-radius) 0; padding: 12px 14px; margin: 0; overflow-wrap: anywhere; }
.gc-route-detail__empty { color: var(--gc-text-faint); font-size: 13px; }

/* TIMELINE zastávek */
.gc-route-timeline { list-style: none; margin: 0; padding: 0; }
.gc-route-tl-item { position: relative; display: flex; gap: 14px; padding: 0 0 16px; }
.gc-route-tl-item:last-child { padding-bottom: 0; }
.gc-route-tl-node { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--gc-primary-grad-strong); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; box-shadow: var(--gc-shadow-sm); z-index: 1; }
.gc-route-tl-item:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--gc-border); }
.gc-route-tl-card { flex: 1; min-width: 0; background: var(--gc-surface); border: 1px solid var(--gc-border); border-radius: var(--gc-radius); padding: 10px 12px; }
.gc-route-tl-head { display: flex; align-items: center; gap: 10px; }
.gc-route-tl-label { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; color: var(--gc-text); overflow-wrap: anywhere; }
.gc-route-tl-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.gc-route-tl-going { font-size: 12.5px; font-weight: 600; color: var(--gc-join); display: inline-flex; align-items: center; gap: 5px; }

/* AKCE (sticky na mobilu) */
/* `z-index` je povinný: bez něj (auto) se přisátá lišta kreslila POD vším, co má
   vlastní z-index — hlavně pod `.gc-route-tl-node { z-index: 1 }`, takže čísla
   zastávek prosvítala přes tlačítka. 3 stačí (víc než 1) a zůstává pod dialogy. */
.gc-route-detail__actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 20px; position: sticky; bottom: 0; z-index: 3; background: #fff; border-top: 1px solid var(--gc-border); }
.gc-route-detail__actions .gc-mtg-btn { flex: 1 1 100px; min-width: 100px; padding: 11px 8px; font-size: 13.5px; line-height: 1.25; }
.gc-route-detail__map-link { text-decoration: none; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
@media (min-width: 780px) {
    .gc-route-detail__actions { position: static; background: none; }
}

/* Proklik ze zastávky na detail trasy */
.gc-route-stop-detaillink { flex: none; color: var(--gc-text-faint); font-size: 15px; padding: 4px 7px; text-decoration: none; border-radius: 8px; margin-left: 2px; line-height: 1; }
.gc-route-stop-detaillink:hover { color: var(--gc-primary); background: var(--gc-primary-soft); }
/* Výrazné CTA „Detail trasy" v panelu trasy / detailu zastávky (mimo řadu akcí, ať se nepřeplácne) */
.gc-route-sheet-detailcta {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; box-sizing: border-box; margin: 2px 0 14px; padding: 11px 12px;
    background: var(--gc-primary-soft); color: var(--gc-primary-strong);
    border: 1px solid #cfe2ff; border-radius: var(--gc-radius);
    font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s ease;
}
.gc-route-sheet-detailcta:hover { background: #e2edff; }

/* Přepínač „Povolit připojení" ve formuláři tvorby trasy */
.gc-route-joinfield { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 14px; padding: 12px; background: var(--gc-bg-soft); border: 1px solid var(--gc-border); border-radius: var(--gc-radius); cursor: pointer; }
.gc-route-joinfield input[type="checkbox"] { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gc-primary); flex: none; cursor: pointer; }
.gc-route-joinfield__text { display: flex; flex-direction: column; gap: 2px; }
.gc-route-joinfield__title { font-size: 14px; font-weight: 600; color: var(--gc-text); }
/* `font-weight` musí být explicitní: obal je `<label>` a bootstrapové
   `label { font-weight: 700 }` se dědilo dovnitř — vysvětlivka se tiskla stejně
   tučně jako název volby a obojí se pralo o pozornost (naměřeno 2026-08-19). */
.gc-route-joinfield__hint { font-size: 12.5px; line-height: 1.4; font-weight: 400; color: var(--gc-text-muted); }

/* Štítek „Jen k prohlédnutí" (panel i detail stránka) */
.gc-route-viewonly { display: flex; align-items: center; gap: 8px; padding: 11px 14px; margin: 4px 0 14px; background: var(--gc-primary-soft); color: var(--gc-primary-strong); border-radius: var(--gc-radius); font-size: 13.5px; font-weight: 600; }

/* === Pozvání uživatelů k bodu / trase (box + dialog) — sdílené point/route === */
.gc-invite-section { }
.gc-invite-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.gc-invite-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; background: var(--gc-bg-soft); border: 1px solid var(--gc-border); border-radius: var(--gc-radius); }
.gc-invite-av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--gc-primary-soft); }
.gc-invite-name { font-size: 14px; font-weight: 600; color: var(--gc-text); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-invite-badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; flex: none; }
.gc-invite-badge.is-ok { background: #e6f7ec; color: #1a7f37; }
.gc-invite-badge.is-no { background: #fdeaea; color: #c02626; }
.gc-invite-badge.is-wait { background: var(--gc-primary-soft); color: var(--gc-primary-strong); }
.gc-invite-badge.is-host { background: #fff3cd; color: #8a6100; }
.gc-invite-remove { flex: none; width: 26px; height: 26px; border: none; border-radius: 50%; background: transparent; color: var(--gc-text-muted); font-size: 20px; line-height: 1; cursor: pointer; }
.gc-invite-remove:hover { background: #fdeaea; color: #c02626; }
.gc-invite-item .gc-invite-accept, .gc-invite-item .gc-invite-decline { flex: none; padding: 5px 12px; font-size: 12.5px; }

/* Dialog výběru sledujících */
.gc-invite-overlay { position: fixed; inset: 0; z-index: 12000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.45); }
.gc-invite-overlay[hidden] { display: none; }
.gc-invite-modal { width: 100%; max-width: 420px; max-height: 80vh; display: flex; flex-direction: column; background: var(--gc-surface, #fff); border-radius: var(--gc-radius); overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.gc-invite-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; font-size: 16px; font-weight: 700; color: var(--gc-text); border-bottom: 1px solid var(--gc-border); }
.gc-invite-modal__close { border: none; background: transparent; font-size: 26px; line-height: 1; color: var(--gc-text-muted); cursor: pointer; }
.gc-invite-modal__body { padding: 10px 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.gc-invite-cand { display: flex; align-items: center; gap: 9px; padding: 6px 4px; }
.gc-invite-cand .gc-invite-do { flex: none; padding: 5px 14px; font-size: 13px; }
.gc-invite-done { flex: none; font-size: 13px; font-weight: 600; color: #1a7f37; }

/* Po odeslání pozvánky se tlačítko schovává atributem `hidden`. Jenže
   `.btnSet { display: inline-block }` je specifičtější než `[hidden]` z
   prohlížeče, takže tlačítko zůstávalo vidět a u jména svítilo „Pozvat"
   i „✓ Pozváno" naráz. Tohle tomu dá přednost zpět. */
.gc-invite-cand [hidden],
.gc-invite-item [hidden],
.gc-invite-section [hidden],
.btnSet[hidden] { display: none !important; }

/* „+" v tlačítku Pozvat uživatele — dědí barvu textu tlačítka (bílá na modrém), ne emoji */
.gc-invite-plus { font-weight: 700; color: inherit; line-height: 1; }

/* === Připojení k bodu (join) — reuse .gc-invite-* pro box, tady jen navíc === */
.gc-join-mode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 12px; }
.gc-join-mode__label { font-size: 13px; font-weight: 600; color: var(--gc-text-muted); }
.gc-join-mode select { max-width: 220px; }
.gc-join-action { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.gc-join-action .btnSet { flex: none; }
/* „+" u tlačítka Připojit se — text (dědí bílou barvu tlačítka), ne barevný emoji. */
.gc-join-btn__plus { display: inline-block; margin-right: 6px; font-weight: 700; font-size: 1.05em; line-height: 1; }
.gc-invite-item.gc-join-pending { background: var(--gc-primary-soft); }
