/* =====================================================
   checkpoint-panel.css — Spodní panel s checkpointy
   Minimalizovaný: max-height ~35dvh, scrollable
   ===================================================== */

/* ─── Panel ───────────────────────────────────────── */

.checkpoint-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 500;
    max-height: 42dvh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-radius: 14px 14px 0 0;
    padding: 8px 10px 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .12);
    transition: max-height .3s ease, padding .3s ease, border-color .3s ease;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar miniaturní */
.checkpoint-panel::-webkit-scrollbar {
    width: 4px;
}

.checkpoint-panel::-webkit-scrollbar-track {
    background: transparent;
}

.checkpoint-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Collapsed stav */
.checkpoint-panel.collapsed {
    max-height: 0;
    padding: 0;
    border-top-color: transparent;
    overflow: hidden;
}

/* ─── Checkpoint item ─────────────────────────────── */

.checkpoint-item {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 11px;
    margin-bottom: 7px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    user-select: none;
}

.checkpoint-item:last-child {
    margin-bottom: 0;
}

.checkpoint-item:hover {
    border-color: #94a3b8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.checkpoint-item:active {
    opacity: .9;
}

/* Stav: dokončeno */
.checkpoint-item.completed {
    background: #f0fdf4;
    border-color: #86efac;
}

/* Stav: aktivní */
.checkpoint-item.active {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(147, 197, 253, .4);
}

/* Stav: zamčeno */
.checkpoint-item.locked {
    background: #f8fafc;
    border-color: #e2e8f0;
    opacity: .7;
}

/* ─── Checkpoint header row ───────────────────────── */

.cp-header {
    display: flex;
    align-items: center;
    gap: 7px;
}

.cp-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.cp-icon--completed {
    background: #22c55e;
    color: #fff;
}

.cp-icon--active {
    background: #3b82f6;
    color: #fff;
}

.cp-icon--locked {
    background: #e2e8f0;
    color: #94a3b8;
    font-size: 10px;
}

.cp-name {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-distance {
    font-size: 11px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ─── Sloupcové rozložení checkpoint karty ───────────────── */

.cp-layout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cp-main {
    flex: 1;
    min-width: 0;
}

.cp-layout--active .cp-side-actions {
    width: 148px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.btn-verify {
    width: 100%;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
}

/* ─── Popis / success text ────────────────────────── */

.checkpoint-description,
.checkpoint-success {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.55;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
    display: none;
}

.checkpoint-description.show,
.checkpoint-success.show {
    display: block;
}

.checkpoint-success {
    color: #166534;
    font-weight: 500;
    border-top-color: #bbf7d0;
}

/* ─── Akce – tlačítka ─────────────────────────────── */

.cp-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.cp-actions .btn {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}

/* ─── Bypass kód ──────────────────────────────────── */

.bypass-details {
    margin-top: 0;
    border: 1px dashed #fde68a;
    border-radius: 8px;
    padding: 5px 7px 7px;
    background: #fffbeb;
}

.bypass-details summary {
    font-size: 11px;
    font-weight: 600;
    color: #b45309;
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 1px 0;
}

.bypass-details summary::-webkit-details-marker {
    display: none;
}

.bypass-details summary::before {
    content: '▶ ';
    font-size: 9px;
}

.bypass-details[open] summary::before {
    content: '▼ ';
    font-size: 9px;
}

.bypass-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: stretch;
}

.bypass-note {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.4;
    color: #92400e;
}

.bypass-code-input {
    width: 100%;
    padding: 6px 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}

.bypass-code-input:focus {
    border-color: #93c5fd;
}

.btn-bypass {
    background: #f59e0b;
    border: none;
    color: #fff;
    padding: 6px 9px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}

.btn-bypass:hover {
    background: #d97706;
}

@media (min-width: 992px) {
    .cp-layout--active .cp-side-actions {
        width: 205px;
        gap: 8px;
    }

    .btn-verify {
        font-size: 13px;
        padding: 8px 10px;
    }

    .bypass-details {
        border-radius: 10px;
        padding: 8px 10px 10px;
    }

    .bypass-details summary {
        font-size: 12px;
    }

    .bypass-note {
        font-size: 11px;
        line-height: 1.45;
    }

    .bypass-code-input {
        padding: 7px 9px;
        font-size: 12px;
    }

    .btn-bypass {
        padding: 7px 10px;
        font-size: 11px;
    }
}

/* ─── Responsive tweaky ───────────────────────────── */

@media (max-height: 600px) {
    .checkpoint-panel {
        height: clamp(80px, 28dvh, 160px);
    }
}

@media (max-width: 560px) {
    .cp-layout--active {
        flex-direction: column;
        gap: 8px;
    }

    .cp-layout--active .cp-side-actions {
        width: 100%;
    }
}

@media (min-height: 900px) {
    .checkpoint-panel {
        height: clamp(160px, 30dvh, 320px);
    }
}

/* ─── Location toast (modální informace o ověření polohy) ── */

.location-toast-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: lt-fade-in .18s ease;
}

.location-toast-backdrop.lt-hiding {
    animation: lt-fade-out .22s ease forwards;
}

.location-toast-card {
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 22px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    animation: lt-slide-up .22s ease;
}

.lt-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.lt-icon--success {
    background: #dcfce7;
}

.lt-icon--warning {
    background: #fef9c3;
}

.lt-icon--error {
    background: #fee2e2;
}

.lt-icon--info {
    background: #dbeafe;
}

.lt-message {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.45;
}

.lt-dismiss {
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
}

@keyframes lt-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes lt-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes lt-slide-up {
    from {
        transform: translateY(16px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}