/* Маркеры камер на карте */
.webcam-marker { transition: transform 0.2s ease; }
.webcam-marker:hover { transform-origin: center; }
.webcam-marker:hover circle:first-child { fill-opacity: 0.3; }
.webcam-marker.highlighted circle:first-child { fill-opacity: 0.3; }

/* Пульсирующее кольцо — индикатор "live" */
.webcam-pulse {
    animation: webcam-pulse 2s ease-in-out infinite;
}
@keyframes webcam-pulse {
    0%, 100% { r: 22; fill-opacity: 0; }
    50% { r: 30; fill-opacity: 0.2; }
}

/* Мигающая красная точка REC */
.webcam-rec {
    animation: webcam-rec-blink 1.5s ease-in-out infinite;
}
@keyframes webcam-rec-blink {
    0%, 100% { fill-opacity: 1; }
    50% { fill-opacity: 0.2; }
}

/* Затемнение камер при наведении на трассу */
.kd-map-wrapper.dimmed .webcam-marker { opacity: 0.25; transition: opacity 0.2s ease; }
.kd-map-wrapper.dimmed .webcam-marker.highlighted { opacity: 1 !important; }

/* Попап камеры */
.kd-webcam-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    align-items: center;
    justify-content: center;
}
.kd-webcam-modal.visible { display: flex; }

.kd-webcam-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.kd-webcam-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90vw;
    max-width: 900px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.kd-webcam-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.kd-webcam-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.kd-webcam-modal-alt {
    font-size: 13px;
    color: #64748b;
    margin-left: 12px;
}
.kd-webcam-modal-live {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
}
.kd-webcam-modal-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.kd-webcam-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.kd-webcam-modal-close:hover { color: #1e293b; }

.kd-webcam-modal-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #0f172a;
}
.kd-webcam-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Мобилка */
@media (max-width: 768px) {
    .kd-webcam-modal-content {
        width: 100vw;
        max-width: 100%;
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    .kd-webcam-modal-player {
        flex: 1;
        padding-bottom: 0;
    }
}
