/* 问题雷达分析页面样式 */

/* ================================
   基础布局样式
================================ */

/* Logo样式 */
.logo-topbar .logo-lg img {
    height: 70px !important;
    width: auto !important;
}

.logo-topbar .logo-sm img {
    height: 60px !important;
    width: auto !important;
}

#user_avatar {
    transition: opacity 0.3s ease-in-out;
}

/* 打印样式 */
@media print {
    .print-button, .navbar-custom, .topnav, .page-title-box {
        display: none !important;
    }
}

/* ================================
   模态框样式
================================ */

.issue-devices-modal {
    z-index: 9999 !important;
}

.issue-devices-modal .swal2-html-container {
    max-height: 500px;
    overflow-y: auto;
}

/* ================================
   雷达分析样式
================================ */

.analysis-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
}

.analysis-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

/* 扫描线动画 */
@keyframes scan-line {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100vw); }
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 100vh;
    background: linear-gradient(to bottom, transparent, #4facfe, transparent);
    animation: scan-line 4s linear infinite;
    z-index: 1;
    pointer-events: none;
}

/* ================================
   卡片样式
================================ */

.modern-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ================================
   图表容器样式
================================ */

.chart-container {
    position: relative;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* ================================
   表格样式优化
================================ */

/* 修复表头层级问题 - 确保低于菜单栏的1005 */
.sticky-top {
    z-index: 990 !important;
}

/* 确保表头不会覆盖顶部菜单 */
.top-issues-container .table thead.sticky-top {
    z-index: 990 !important;
    position: sticky;
    top: calc(var(--ct-topbar-height, 70px) + var(--ct-menu-height, 60px));
    background-color: #f8f9fa !important;
}

/* 设备健康表的表头也需要相同处理 */
#deviceHealthTable thead.sticky-top {
    z-index: 990 !important;
    top: calc(var(--ct-topbar-height, 70px) + var(--ct-menu-height, 60px));
    background-color: #f8f9fa !important;
}

/* 优化表格容器层级管理 */
.top-issues-container {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.06);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* 防止表头与菜单栏重叠的附加保护 */
.top-issues-container .table-responsive {
    max-height: 500px;
    overflow-y: auto;
    position: relative;
}

/* 确保粘性表头在滚动时的正确行为 */
.top-issues-container .sticky-top,
#deviceHealthTable .sticky-top {
    background-color: #f8f9fa !important;
    backdrop-filter: blur(8px);
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ================================
   响应式设计
================================ */

@media (max-width: 768px) {
    .modern-card {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .chart-container {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .analysis-section {
        border-radius: 10px;
        margin-bottom: 1rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .chart-title {
        font-size: 1rem;
    }
}

/* ================================
   动画效果
================================ */

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ================================
   工具样式
================================ */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 数据展示样式 */
.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4facfe;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.metric-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.active {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.status-indicator.inactive {
    background: linear-gradient(45deg, #f44336, #ff9800);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}