/* 告警管理页面专用样式 */

/* 告警状态颜色 */
.alert-status-pending {
    background-color: #fee2e2 !important;
    border-left-color: #ef4444 !important;
}

.alert-status-verified {
    background-color: #dbeafe !important;
    border-left-color: #3b82f6 !important;
}

.alert-status-handling {
    background-color: #fef3c7 !important;
    border-left-color: #f59e0b !important;
}

.alert-status-handled {
    background-color: #d1fae5 !important;
    border-left-color: #10b981 !important;
}

.alert-status-closed {
    background-color: #f3f4f6 !important;
    border-left-color: #6b7280 !important;
}

.alert-status-false_alarm {
    background-color: #f5f5f5 !important;
    border-left-color: #9ca3af !important;
}

/* 告警等级标签 */
.alert-level-critical {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-level-warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.alert-level-info {
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* 告警类型图标容器 */
.alert-icon-container {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon-critical {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.alert-icon-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.alert-icon-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* 响应时间指示器 */
.response-time-fast {
    color: #10b981;
    font-weight: 600;
}

.response-time-medium {
    color: #f59e0b;
    font-weight: 600;
}

.response-time-slow {
    color: #ef4444;
    font-weight: 600;
}

/* 告警列表行悬停效果 */
.alert-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

/* 通知气泡 */
.notification-bubble {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* 紧急告警闪烁效果 */
.alert-critical-flashing {
    animation: critical-flash 2s infinite;
}

@keyframes critical-flash {
    0%, 100% {
        background-color: #fee2e2;
    }
    50% {
        background-color: #fecaca;
    }
}

/* 时间线样式 */
.timeline-container {
    position: relative;
    padding-left: 30px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e5e7eb;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-dot.pending {
    background-color: #ef4444;
    border: 3px solid #fee2e2;
}

.timeline-dot.verified {
    background-color: #3b82f6;
    border: 3px solid #dbeafe;
}

.timeline-dot.handling {
    background-color: #f59e0b;
    border: 3px solid #fef3c7;
}

.timeline-dot.handled {
    background-color: #10b981;
    border: 3px solid #d1fae5;
}

.timeline-dot.closed {
    background-color: #6b7280;
    border: 3px solid #f3f4f6;
}

/* 网格员状态指示器 */
.grid-worker-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.grid-worker-online {
    background-color: #10b981;
    animation: pulse 2s infinite;
}

.grid-worker-offline {
    background-color: #6b7280;
}

.grid-worker-busy {
    background-color: #f59e0b;
    animation: pulse 1s infinite;
}

/* 电话记录样式 */
.call-record {
    border-left: 4px solid #3b82f6;
    background-color: #eff6ff;
    padding: 12px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
}

.call-record.success {
    border-left-color: #10b981;
    background-color: #d1fae5;
}

.call-record.failed {
    border-left-color: #ef4444;
    background-color: #fee2e2;
}

.call-record.missed {
    border-left-color: #6b7280;
    background-color: #f3f4f6;
}

/* 地图标记样式 */
.map-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.map-marker.critical {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.map-marker.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.map-marker.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* 统计图表容器 */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 320px;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .alert-table th,
    .alert-table td {
        padding: 8px 4px;
        font-size: 13px;
    }
    
    .alert-table .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .timeline-container {
        padding-left: 20px;
    }
    
    .timeline-container::before {
        left: 6px;
    }
    
    .timeline-dot {
        left: -20px;
        width: 16px;
        height: 16px;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .alert-table {
        border-collapse: collapse;
    }
    
    .alert-table th,
    .alert-table td {
        border: 1px solid #ddd;
        padding: 8px;
    }
    
    .alert-status-pending,
    .alert-status-verified,
    .alert-status-handling,
    .alert-status-handled,
    .alert-status-closed,
    .alert-status-false_alarm {
        background-color: white !important;
        border-left: 3px solid #333 !important;
    }
}