/*
 * Current Traffic - TomTom
 * Version: 1.1.5
 */

.ctt-wrapper {
    max-width: 760px;
    margin: 0 0 24px 0;
    font-family: inherit;
}

.ctt-map {
    width: 100%;
    min-height: 220px;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    border: 1px solid #d7d7d7;
    border-bottom: 0;
    background: #f1f1f1;
}

.ctt-panel {
    background: #ffffff;
    border: 1px solid #d7d7d7;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ctt-panel-head {
    display: flex;
    gap: 16px;
    align-items: baseline;
    justify-content: space-between;
}

.ctt-panel h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    line-height: 1.2;
}

.ctt-incident-count {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.ctt-last-updated {
    color: #667085;
    font-size: 13px;
    margin-bottom: 14px;
}

.ctt-incidents {
    display: grid;
    gap: 12px;
}

.ctt-incident {
    display: grid;
    grid-template-columns: 5px 34px 1fr auto;
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    min-height: 72px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.ctt-incident:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.ctt-incident-active {
    border-color: #2271b1;
    background: #eef7ff;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.16);
}

.ctt-incident-flash {
    animation: ctt-card-flash 1s ease;
}

@keyframes ctt-card-flash {
    0% { box-shadow: 0 0 0 0 rgba(34,113,177,0.45); }
    45% { box-shadow: 0 0 0 8px rgba(34,113,177,0.16); }
    100% { box-shadow: 0 0 0 0 rgba(34,113,177,0); }
}

.ctt-incident-color {
    width: 5px;
    align-self: stretch;
}

.ctt-minor .ctt-incident-color { background: #2fb344; }
.ctt-moderate .ctt-incident-color { background: #f7c948; }
.ctt-major .ctt-incident-color { background: #ff8a3d; }
.ctt-severe .ctt-incident-color { background: #e03131; }

.ctt-minor .ctt-delay { color: #2fb344; }
.ctt-moderate .ctt-delay { color: #a47f00; }
.ctt-major .ctt-delay { color: #d9480f; }
.ctt-severe .ctt-delay { color: #e03131; }

.ctt-incident-icon {
    font-size: 18px;
    text-align: center;
}

.ctt-incident-title {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.25;
    margin-bottom: 3px;
}

.ctt-incident-event {
    font-size: 14px;
    line-height: 1.3;
}

.ctt-incident-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: #667085;
    font-size: 12px;
    margin-top: 5px;
}

.ctt-delay {
    font-weight: 800;
    font-size: 14px;
    padding-right: 14px;
    white-space: nowrap;
}

.ctt-no-incidents,
.current-traffic-error {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.ctt-marker {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--ctt-marker-color, #2fb344);
    border: 3px solid #ffffff;
    box-shadow: 0 2px 7px rgba(0,0,0,0.42);
}

.ctt-marker::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 999px;
    border: 2px solid var(--ctt-marker-color, #2fb344);
    opacity: 0.45;
}

.ctt-marker-pulse .ctt-marker::after {
    animation: ctt-marker-pulse 1s ease;
}

@keyframes ctt-marker-pulse {
    0% {
        transform: scale(0.85);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.leaflet-popup-content {
    font-size: 13px;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .ctt-panel-head {
        display: block;
    }

    .ctt-incident {
        grid-template-columns: 5px 28px 1fr;
    }

    .ctt-delay {
        grid-column: 3;
        padding: 0 12px 10px 0;
    }
}


.ctt-panel-hidden {
    display: none !important;
}

.ctt-popup .leaflet-popup-content {
    margin: 12px 14px;
}

.ctt-popup-title {
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 4px;
}

.ctt-popup-event {
    font-size: 13px;
    line-height: 1.35;
    margin-bottom: 6px;
}

.ctt-popup-delay {
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 5px;
}

.ctt-popup-meta {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    color: #667085;
    font-size: 12px;
}

.ctt-popup-inner.ctt-minor .ctt-popup-delay { color: #2fb344; }
.ctt-popup-inner.ctt-moderate .ctt-popup-delay { color: #a47f00; }
.ctt-popup-inner.ctt-major .ctt-popup-delay { color: #d9480f; }
.ctt-popup-inner.ctt-severe .ctt-popup-delay { color: #e03131; }
