/* ── PMR Info Trafic ────────────────────────────────────────────── */

.pmr-trafic {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.5;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Ticker ──────────────────────────────────────────────────────── */
.pmr-trafic__ticker-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    overflow: hidden;
    margin-bottom: 20px;
    min-height: 44px;
}

.pmr-trafic__ticker-label {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
    background: #ed261e;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
}

.pmr-trafic__ticker {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.pmr-trafic__ticker::before,
.pmr-trafic__ticker::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    z-index: 1;
    pointer-events: none;
}
.pmr-trafic__ticker::before { left: 0;  background: linear-gradient(to right, #111827, transparent); }
.pmr-trafic__ticker::after  { right: 0; background: linear-gradient(to left,  #111827, transparent); }

.pmr-trafic__ticker-inner {
    display: block;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.4;
    animation: pmr-ticker-scroll 60s linear infinite;
    will-change: transform;
}

.pmr-trafic__ticker-inner:hover { animation-play-state: paused; }

@keyframes pmr-ticker-scroll {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ── Split layout (all view) ─────────────────────────────────────── */
.pmr-trafic__layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: auto;
    gap: 16px;
    align-items: start;
}

.pmr-trafic__col-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.pmr-trafic__col-map {
    position: sticky;
    top: 80px;
}

/* ── List header ─────────────────────────────────────────────────── */
.pmr-trafic__list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.pmr-trafic__count {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
}

.pmr-trafic__filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pmr-trafic__filters select {
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    color: #374151;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.pmr-trafic__filters select:focus {
    outline: none;
    border-color: #ed261e;
}

/* ── Incident list ───────────────────────────────────────────────── */
.pmr-trafic__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 540px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.pmr-trafic__list::-webkit-scrollbar        { width: 4px; }
.pmr-trafic__list::-webkit-scrollbar-track  { background: transparent; }
.pmr-trafic__list::-webkit-scrollbar-thumb  { background: #d1d5db; border-radius: 4px; }

.pmr-trafic__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-left: 4px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: box-shadow .15s, transform .1s;
}

.pmr-trafic__item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    transform: translateX(2px);
}

.pmr-trafic__item--high   { border-left-color: #dc2626; }
.pmr-trafic__item--medium { border-left-color: #f59e0b; }
.pmr-trafic__item--low    { border-left-color: #84cc16; }
.pmr-trafic__item--unknown { border-left-color: #9ca3af; }

.pmr-trafic__item-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.pmr-trafic__item-body {
    flex: 1;
    min-width: 0;
}

.pmr-trafic__item-desc {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pmr-trafic__item-route {
    margin-top: 2px;
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pmr-trafic__delay {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    padding: 1px 5px;
    border-radius: 8px;
}

.pmr-trafic__item-gravity {
    flex-shrink: 0;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    margin-top: 1px;
}

.pmr-trafic__no-results {
    padding: 32px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    list-style: none;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #e5e7eb;
}

/* ── Map ─────────────────────────────────────────────────────────── */
.pmr-trafic__map {
    height: 540px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* map seule (view=map) */
[data-view="map"] .pmr-trafic__map {
    height: 500px;
}

.pmr-map-popup {
    display: flex;
    gap: 8px;
    font-size: 13px;
    max-width: 220px;
    line-height: 1.5;
}
.pmr-map-popup__icon { font-size: 20px; flex-shrink: 0; }
.pmr-map-popup__body strong { display: block; margin-bottom: 2px; }

/* ── Footer ──────────────────────────────────────────────────────── */
.pmr-trafic__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.pmr-trafic__footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pmr-trafic__updated {
    font-size: 12px;
    color: #9ca3af;
}

.pmr-trafic__status {
    font-size: 12px;
    color: #6b7280;
    min-height: 18px;
}

.pmr-trafic__geo-btns {
    display: flex;
    gap: 8px;
}

.pmr-trafic__btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    color: #374151;
    white-space: nowrap;
}

.pmr-trafic__btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pmr-trafic__btn--geo {
    border-color: #ed261e;
    color: #ed261e;
}

.pmr-trafic__btn--geo:hover {
    background: #fff5f5;
    border-color: #dc2626;
}

.pmr-trafic__btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ── Title ───────────────────────────────────────────────────────── */
.pmr-trafic__title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 700;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pmr-trafic__layout {
        grid-template-columns: 1fr;
    }

    .pmr-trafic__col-map {
        position: static;
        order: -1; /* map above list on mobile */
    }

    .pmr-trafic__map {
        height: 260px;
    }

    .pmr-trafic__list {
        max-height: 400px;
    }

    .pmr-trafic__ticker-inner {
        animation-duration: 40s;
    }
}
