/* ════════════════════════════════════════════════════════════════════════
   TransLog — Route Maps   (round 66)
   ────────────────────────────────────────────────────────────────────────
   Extends tlmap.css with the route + truck-pin + click-to-pick styles.
   ════════════════════════════════════════════════════════════════════════ */


/* ── Route map container ─────────────────────────────────────── */
.tlmap-route {
    width: 100%;
    min-height: 380px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);
    background: #f1f5f9;
    position: relative;
    z-index: 0;
}

/* ── Truck pin — animated pulse ──────────────────────────────── */
.tlmap-truck-pin {
    position: relative;
    width: 44px;
    height: 44px;
    pointer-events: auto;
}
.tlmap-truck-pin-inner {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #E8A317;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
    z-index: 2;
}
.tlmap-truck-pin-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(232, 163, 23, 0.4);
    animation: tlmap-truck-pulse 2s ease-out infinite;
    z-index: 1;
}
@keyframes tlmap-truck-pulse {
    0%   { transform: scale(0.85); opacity: 0.7; }
    70%  { transform: scale(1.55); opacity: 0;   }
    100% { transform: scale(1.55); opacity: 0;   }
}


/* ── Admin: click-to-pick map ─────────────────────────────────── */
.tlmap-pick {
    width: 100%;
    height: 320px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    cursor: crosshair;
}
.tlmap-pick-wrap {
    margin: 8px 0 16px;
}
.tlmap-pick-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.tlmap-pick-coords {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    color: #0B1D3A;
}
.tlmap-pick-coords:empty::before {
    content: 'Klicken Sie auf die Karte, um eine Position auszuwählen';
    color: #94a3b8;
    font-style: italic;
    font-family: inherit;
}
.tlmap-pick-btn {
    padding: 7px 14px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0B1D3A;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
.tlmap-pick-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}
.tlmap-pick-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.tlmap-pick-btn-clear {
    color: #b91c1c;
    border-color: #fca5a5;
}
.tlmap-pick-btn-clear:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #ef4444;
}

/* The little title strip above each pick map */
.tlmap-pick-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 8px;
    color: #0B1D3A;
    font-size: 0.95rem;
    font-weight: 700;
}
.tlmap-pick-title-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
}
.tlmap-pick-title-color.is-sender   { background: #E8A317; }
.tlmap-pick-title-color.is-receiver { background: #0B1D3A; box-shadow: 0 0 0 2px #E8A317; }
.tlmap-pick-title-color.is-truck    { background: #fff; box-shadow: inset 0 0 0 3px #E8A317, 0 0 0 1px #cbd5e1; }


/* ── Section + heading on admin form ─────────────────────────── */
.tlmap-admin-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    margin: 20px 0;
}
.tlmap-admin-section h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: #0B1D3A;
}
.tlmap-admin-section p.tlmap-admin-help {
    margin: 0 0 16px;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.55;
}

/* Admin: truck info card showing last update */
.tlmap-truck-info {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: #fef9e6;
    border-left: 4px solid #E8A317;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 0.86rem;
}
.tlmap-truck-info-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}
.tlmap-truck-info strong {
    display: block;
    color: #0B1D3A;
    margin-bottom: 2px;
}
.tlmap-truck-info span {
    color: #64748b;
}

/* Sync-from-event button */
.tlmap-sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #0B1D3A;
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
.tlmap-sync-btn:hover { background: #1e3a5f; }
.tlmap-sync-btn:disabled { opacity: 0.5; cursor: wait; }


/* ── Public tracking — route info bar above the map ──────────── */
.tlmap-route-info {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 14px 18px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}
.tlmap-route-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tlmap-route-info-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}
.tlmap-route-info-value {
    font-weight: 700;
    color: #0B1D3A;
}


/* ── Mobile polish ───────────────────────────────────────────── */
@media (max-width: 720px) {
    .tlmap-route { min-height: 300px; }
    .tlmap-pick  { height: 280px; }
    .tlmap-route-info {
        gap: 14px;
        padding: 10px 12px;
    }
    .tlmap-pick-row {
        flex-direction: column;
        align-items: stretch;
    }
    .tlmap-pick-coords {
        width: 100%;
    }
}


/* ════════════════════════════════════════════════════════════════════════
   Round 67 — auto-movement status panel (admin)
   ════════════════════════════════════════════════════════════════════════ */

.auto-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.auto-status-cell {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}
.auto-status-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 4px;
}
.auto-status-value {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: #0B1D3A;
}
.auto-status-pill {
    display: inline-block;
    padding: 4px 10px;
    color: #fff;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Progress bar */
.auto-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0 16px;
}
.auto-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E8A317 0%, #d4940a 100%);
    transition: width 0.3s ease;
}

/* Action button row */
.auto-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.btn-auto {
    padding: 9px 16px;
    border: 0;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}
.btn-auto:disabled { opacity: 0.5; cursor: wait; }
.btn-auto-start { background: #10b981; color: #fff; }
.btn-auto-start:hover:not(:disabled) { background: #059669; }
.btn-auto-tick  { background: #E8A317; color: #0B1D3A; }
.btn-auto-tick:hover:not(:disabled)  { background: #d4940a; }
.btn-auto-stop  { background: #6b7280; color: #fff; }
.btn-auto-stop:hover:not(:disabled)  { background: #4b5563; }
.btn-auto-reset { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.btn-auto-reset:hover:not(:disabled) { background: #fecaca; }


/* ════════════════════════════════════════════════════════════════════════
   Round 66/67 admin-fix: persistent alert classes
   The admin layout has JS that auto-hides any .alert element after 5s.
   We use these classes for warnings that MUST stay visible (e.g. "Set
   coordinates first").
   ════════════════════════════════════════════════════════════════════════ */

.tlmap-persistent-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 0.92rem;
    line-height: 1.55;
}
.tlmap-persistent-alert strong { display: inline; }
.tlmap-persistent-alert a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}
.tlmap-alert-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #78350f;
}
.tlmap-alert-info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e3a8a;
}


/* ════════════════════════════════════════════════════════════════════════
   Round 68 — ETA card (public tracking page)
   ════════════════════════════════════════════════════════════════════════ */

.eta-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-left: 5px solid #E8A317;
    border-radius: 12px;
    padding: 18px 22px;
    margin: 16px 0 20px;
    box-shadow: 0 4px 12px rgba(232, 163, 23, 0.12);
}
.eta-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}
.eta-card-body {
    flex: 1;
    min-width: 0;
}
.eta-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #78350f;
    font-weight: 700;
    margin-bottom: 4px;
}
.eta-card-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0B1D3A;
    line-height: 1.2;
}
.eta-card-rel {
    font-size: 0.95rem;
    color: #78350f;
    font-weight: 600;
    margin-top: 2px;
}
.eta-card-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #57370b;
}
.eta-card-disclaimer-icon {
    flex-shrink: 0;
    font-size: 1rem;
    margin-top: 1px;
}

@media (max-width: 720px) {
    .eta-card { padding: 14px 16px; gap: 12px; }
    .eta-card-icon { font-size: 1.6rem; }
    .eta-card-value { font-size: 1.15rem; }
    .eta-card-rel { font-size: 0.86rem; }
    .eta-card-disclaimer { font-size: 0.8rem; }
}
