/**
 * V2 Map - 교통정보 스타일 (라이트톤)
 */

/* ═══════════════════════════════════
   안내 배지
   ═══════════════════════════════════ */
.v2-ti-badge {
    position: absolute;
    top: 10px;
    right: 120px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    z-index: 9;
    max-width: 280px;
    animation: tiFadeIn 0.25s ease;
}

.v2-ti-badge-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #333;
    font-size: 13px;
    font-weight: 600;
}

.v2-ti-badge-close {
    margin-left: auto;
    border: none;
    background: none;
    color: #bbb;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.v2-ti-badge-close:hover { color: #e53935; }

.v2-ti-badge-desc {
    color: #777;
    font-size: 11px;
    line-height: 1.6;
}
.v2-ti-badge-desc em {
    font-style: normal;
    color: #2196F3;
    font-weight: 600;
}

.v2-ti-badge-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 11px;
    padding: 4px 0;
}

.v2-ti-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: -4px;
}

.v2-ti-badge-guide {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.v2-ti-guide-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.v2-ti-guide-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.v2-ti-icon-sample {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0;
}
.v2-ti-icon-sample em {
    font-style: normal;
    font-size: 9px;
    color: #999;
    font-weight: 500;
}

.v2-ti-guide-text {
    font-size: 10px;
    color: #888;
    line-height: 1.5;
}

@keyframes tiFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════
   돌발정보 패널
   ═══════════════════════════════════ */
.v2-ti-panel {
    position: absolute;
    bottom: 38px;
    right: 10px;
    width: 270px;
    max-height: 340px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    z-index: 9;
    animation: tiFadeIn 0.25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.v2-ti-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.v2-ti-panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #444;
    font-size: 12px;
    font-weight: 600;
}
.v2-ti-panel-title strong { color: #e65100; }

.v2-ti-panel-toggle {
    border: none;
    background: #eee;
    color: #999;
    border-radius: 4px;
    padding: 3px 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.v2-ti-panel-toggle:hover { background: #ddd; color: #555; }

.v2-ti-panel-tags {
    display: flex;
    gap: 4px;
    padding: 6px 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid #f5f5f5;
}

.v2-ti-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
}
.v2-ti-tag--acc { color: #D32F2F; background: #fce4ec; }
.v2-ti-tag--cor { color: #e65100; background: #fff3e0; }
.v2-ti-tag--wea { color: #1565C0; background: #e3f2fd; }
.v2-ti-tag--oth { color: #546E7A; background: #eceff1; }

.v2-ti-panel-list {
    overflow-y: auto;
    flex: 1;
    padding: 2px 0;
}

.v2-ti-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.12s;
    border-left: 2px solid transparent;
}
.v2-ti-item:hover { background: #f5f8ff; }

.v2-ti-item--active {
    background: #fff8e1;
    border-left-color: #e65100;
}
.v2-ti-item--active:hover { background: #fff3e0; }

.v2-ti-item-type {
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    padding: 1px 5px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.v2-ti-item-road {
    font-size: 11px;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.v2-ti-item-dir {
    font-size: 9px;
    color: #aaa;
    flex-shrink: 0;
}

/* ── 패널 로딩 마스크 ── */
.v2-ti-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    z-index: 2;
    border-radius: 8px;
}

.v2-ti-loading span {
    font-size: 11px;
    color: #999;
}

.v2-ti-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #e0e0e0;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: tiSpin 0.7s linear infinite;
}

@keyframes tiSpin { to { transform: rotate(360deg); } }

/* ── (줌 힌트는 공통 v2-zoom-hint로 통합됨) ── */

/* ═══════════════════════════════════
   하이라이트 펄스 (OL Overlay)
   ═══════════════════════════════════ */
.v2-traffic-hl {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    border: 2.5px solid transparent;
    background: transparent;
}

.v2-traffic-hl--on {
    opacity: 1;
    border-color: rgba(255, 82, 82, 0.8);
    background: rgba(255, 82, 82, 0.15);
    animation: thlPulse 1.5s ease-out infinite;
}

@keyframes thlPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.6); }
    70%  { box-shadow: 0 0 0 14px rgba(255, 82, 82, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}

/* ═══════════════════════════════════
   교통 전용 팝업 (OL Overlay, 라이트톤)
   ═══════════════════════════════════ */
.v2-tpopup {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    min-width: 230px;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    color: #444;
    font-size: 12px;
    position: relative;
    overflow: hidden;
}

.v2-tpopup::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    margin-left: -7px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #fff;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08));
}

.v2-tpopup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #bbb;
    font-size: 14px;
    cursor: pointer;
    padding: 0 3px;
    line-height: 1;
    z-index: 1;
}
.v2-tpopup-close:hover { color: #e53935; }

.v2-tpopup-content { padding: 0; }

/* ── 돌발 팝업 내부 ── */
.v2-tp { padding: 12px 14px; }

.v2-tp-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.v2-tp-type {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
}

.v2-tp-detail {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 8px;
}

.v2-tp-msg {
    padding: 8px 10px;
    background: #f8f9fa;
    border-left: 3px solid #e65100;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
}

.v2-tp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.v2-tp-table th {
    text-align: left;
    color: #999;
    font-weight: 500;
    padding: 3px 0;
    width: 40px;
    vertical-align: top;
}

.v2-tp-table td {
    padding: 3px 0;
    color: #444;
}

.v2-tp-table tr + tr th,
.v2-tp-table tr + tr td {
    border-top: 1px solid #f0f0f0;
}

.v2-tp-block {
    color: #D32F2F;
    font-weight: 600;
}

.v2-tp-date {
    margin-top: 6px;
    font-size: 10px;
    color: #aaa;
}

/* ═══════════════════════════════════
   CCTV 전체화면 모달
   ═══════════════════════════════════ */
.v2-cctv-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cctvFadeIn 0.15s ease;
}

@keyframes cctvFadeIn { from { opacity: 0; } to { opacity: 1; } }

.v2-cctv-box {
    width: 80vw; max-width: 960px; height: 75vh;
    background: #111;
    border-radius: 10px;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.v2-cctv-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: #1a1a2e;
    flex-shrink: 0;
}
.v2-cctv-name { color: #ddd; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.v2-cctv-actions { display: flex; gap: 4px; flex-shrink: 0; }

.v2-cctv-action-btn {
    background: rgba(255,255,255,0.08); border: none; color: #999;
    border-radius: 5px; padding: 5px 7px; cursor: pointer; display: flex; align-items: center;
}
.v2-cctv-action-btn:hover { color: #fff; background: rgba(255,255,255,0.15); }

.v2-cctv-box--expanded { width: 96vw; max-width: 96vw; height: 92vh; }

/* 미니 모드 */
.v2-cctv-backdrop--mini {
    background: transparent;
    pointer-events: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 10px 38px 0;
}

.v2-cctv-box--mini {
    pointer-events: auto;
    width: 320px;
    height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.v2-cctv-box--mini .v2-cctv-bottom { display: none; }
.v2-cctv-box--mini .v2-cctv-name { font-size: 11px; }
.v2-cctv-box--mini .v2-cctv-top { padding: 6px 10px; }

.v2-cctv-screen { flex: 1; position: relative; background: #000; min-height: 0; }
.v2-cctv-screen video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }

.v2-cctv-loader { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #888; font-size: 12px; }
.v2-cctv-spin { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.12); border-top-color: #2196F3; border-radius: 50%; animation: cctvSpin 0.7s linear infinite; }
@keyframes cctvSpin { to { transform: rotate(360deg); } }
.v2-cctv-fail { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: #777; font-size: 13px; }

.v2-cctv-bottom { padding: 6px 16px; background: #1a1a2e; color: #666; font-size: 10px; font-family: 'Consolas', monospace; flex-shrink: 0; }

/* ═══════════════════════════════════
   교통정보 버튼 그룹
   ═══════════════════════════════════ */
.v2-toolbar-traffic { background: none; box-shadow: none; overflow: visible; align-items: flex-end; }
.v2-toolbar-traffic .v2-toolbar-btn { box-shadow: 0 2px 8px rgba(0,0,0,0.25); min-width: 80px; justify-content: center; }

/* ═══════════════════════════════════
   VMS 도로전광표지 LED 전광판
   ═══════════════════════════════════ */
.v2-vms-board {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    min-width: 340px;
    max-width: 520px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    animation: vmsFadeIn 0.25s ease;
    font-family: 'D2Coding', 'Consolas', monospace;
}

.v2-vms-screen {
    position: relative;
    background: #0a0a00;
    padding: 16px 20px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v2-vms-text {
    margin: 0;
    color: #ffb300;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
    white-space: pre-wrap;
    word-break: keep-all;
    text-shadow: 0 0 6px rgba(255,179,0,0.6), 0 0 20px rgba(255,179,0,0.2);
    letter-spacing: 1px;
}

.v2-vms-scanline {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.15) 2px,
        rgba(0,0,0,0.15) 4px
    );
}

.v2-vms-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.v2-vms-road {
    flex: 1;
    font-size: 11px;
    color: #999;
}

.v2-vms-page {
    font-size: 10px;
    color: #666;
}

.v2-vms-close {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 0 3px;
    line-height: 1;
}
.v2-vms-close:hover { color: #ff5252; }

@keyframes vmsFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
