/* 비정상 궤적 모니터링 전용 스타일 */

/* 레이아웃 */
.left-panel {
    width: 450px;
}

/* 필터 섹션 */
.filter-section {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

/* 선박 목록 */
.vessel-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.vessel-group {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.vessel-header {
    background: #f8f9fa;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.vessel-header:hover {
    background: #e9ecef;
}

.vessel-header.active {
    background: #007bff;
    color: white;
}

.vessel-info {
    flex: 1;
}

.vessel-id {
    font-weight: 600;
    font-size: 0.95em;
}

.vessel-stats {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 2px;
}

.vessel-header.active .vessel-stats {
    color: rgba(255, 255, 255, 0.9);
}

.vessel-count {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.vessel-tracks {
    max-height: 200px;
    overflow-y: auto;
    background: #f8f9fa;
    display: none;
}

/* 트랙 아이템 */
.track-item {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

.track-item:hover {
    background: #e9ecef;
}

.track-item.selected {
    background: #cfe2ff;
    border-left: 4px solid #007bff;
    font-weight: 500;
}

.track-checkbox {
    margin-right: 8px;
}

/* 사용자 정의 검출 패널 */
.custom-detection-panel {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    background: #f0f8ff;
    flex-shrink: 0;
}

/* 지도 */
#map {
    width: 100%;
    height: 100%;
}

/* 통계 카드 위치 */
.stat-cards {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 15px;
}

.stat-card {
    min-width: 140px;
}

/* 비정상 유형 배지 */
.abnormal-type-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    color: white;
    display: inline-block;
}

.type-extreme_speed {
    background-color: #e74c3c;
}

.type-extreme_distance {
    background-color: #f39c12;
}

.type-extreme_transition {
    background-color: #9b59b6;
}

.type-extreme_avg_speed_5min {
    background-color: #3498db;
}

.type-impossible_transition {
    background-color: #c0392b;
}

.type-user_detected {
    background-color: #95a5a6;
}

/* 범례 위치 */
.legend-panel {
    bottom: 20px;
    right: 20px;
    min-width: 200px;
}

.legend-label {
    flex: 1;
}

.legend-count {
    color: #6c757d;
    font-size: 0.8em;
    margin-left: 8px;
}

/* 빠른 날짜 선택 버튼 */
.date-range-buttons {
    margin-top: 8px;
}

.date-range-buttons .btn-group {
    width: 100%;
}

/* 정렬 옵션 */
.sort-section {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

/* 모달 스타일 */
.modal-content {
    border-radius: 8px;
}

.form-check.border {
    transition: background-color 0.2s;
}

.form-check.border:hover {
    background-color: #f8f9fa;
}

.form-check-input:checked + .form-check-label {
    color: #007bff;
}

/* 액션 버튼 */
#actionButtons {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

#moveToAbnormalBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 백 버튼 */
#backToAutoBtn {
    font-size: 0.85em;
}

/* 통계 카드 애니메이션 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.stat-card.updating {
    animation: pulse 0.5s ease-in-out;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .left-panel {
        width: 400px;
    }
    
    .stat-cards {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        max-height: 50vh;
    }
    
    .stat-cards {
        position: relative;
        top: auto;
        right: auto;
        flex-direction: row;
        margin-bottom: 10px;
    }
}