/*
 * 服务器状态监控和网速显示样式
 */

/* 服务器监控容器 - 适配原有统计栏样式 */
.server-monitor {
    margin-top: 20px;
    padding: 24px;
    border-radius: 16px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.4);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.server-monitor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    z-index: 0;
}

.server-monitor:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    background: rgba(255,255,255,0.9);
}

.server-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.server-monitor-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.server-monitor-title i {
    font-style: normal;
    color: #2563eb;
    font-size: 18px;
}

/* 实时网速显示 - 右上角 */
.net-speed-display {
    text-align: right;
    font-size: 13px;
    background: rgba(255,255,255,0.8);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    backdrop-filter: blur(4px);
}

.net-speed-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 2px 0;
    gap: 6px;
    line-height: 1.4;
}

.net-speed-arrow {
    font-size: 16px;
    font-weight: bold;
    width: 18px;
    text-align: center;
    transition: transform 0.2s ease;
}

.net-speed-arrow.up {
    color: #f56c6c;
}

.net-speed-arrow.down {
    color: #2563eb;
}

.net-speed-value {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    min-width: 90px;
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* 进度条样式 - 适配页面风格 */
.monitor-item {
    margin: 16px 0;
    padding: 16px;
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.monitor-item:hover {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.monitor-label {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.monitor-label .value-text {
    color: #2563eb;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.progress-container {
    width: 100%;
    height: 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease, background-color 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 不同占用率颜色 - 适配页面主色调 */
.progress-low { background: linear-gradient(90deg, #67c23a, #85ce61); }
.progress-mid { background: linear-gradient(90deg, #e6a23c, #ebb563); }
.progress-high { background: linear-gradient(90deg, #f56c6c, #f78989); }
.progress-unknown { background: linear-gradient(90deg, #909399, #b3b6bb); }

/* 错误提示 */
.monitor-error {
    font-size: 13px;
    color: #f56c6c;
    margin-top: 12px;
    text-align: center;
    padding: 8px;
    background: rgba(245,108,108,0.1);
    border-radius: 6px;
    border: 1px solid rgba(245,108,108,0.2);
}

/* 磁盘IO样式 */
.disk-io-row {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    font-family: 'Courier New', monospace;
}

/* 网速曲线图容器 */
.net-speed-chart-container {
    margin-top: 24px;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.net-speed-chart-title {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
}

.net-speed-chart {
    width: 100%;
    height: 140px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.net-speed-chart canvas {
    width: 100%;
    height: 100%;
}

/* 图例 */
.net-chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 500;
}

.net-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    transition: all 0.2s ease;
}

.net-chart-legend-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.net-chart-legend-color {
    width: 16px;
    height: 4px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.net-chart-legend-color.upload {
    background: #f56c6c;
}

.net-chart-legend-color.download {
    background: #2563eb;
}

/* 暗黑模式适配 */
[data-theme="dark"] .server-monitor {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .server-monitor:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

[data-theme="dark"] .server-monitor-title {
    color: #f8fafc;
}

[data-theme="dark"] .net-speed-display {
    background: rgba(30,41,59,0.8);
    border-color: #334155;
}

[data-theme="dark"] .net-speed-value {
    color: #f8fafc;
}

[data-theme="dark"] .monitor-item {
    background: rgba(30,41,59,0.6);
    border-color: #334155;
}

[data-theme="dark"] .monitor-item:hover {
    background: rgba(30,41,59,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

[data-theme="dark"] .monitor-label {
    color: #94a3b8;
}

[data-theme="dark"] .progress-container {
    background: #334155;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .monitor-error {
    background: rgba(245,108,108,0.15);
    border-color: rgba(245,108,108,0.3);
}

[data-theme="dark"] .net-speed-chart-container {
    background: rgba(30,41,59,0.6);
    border-top-color: #334155;
}

[data-theme="dark"] .net-speed-chart {
    background: rgba(30,41,59,0.8);
    border-color: #334155;
}

[data-theme="dark"] .net-chart-legend-item {
    background: rgba(30,41,59,0.8);
    border-color: #334155;
}

[data-theme="dark"] .net-chart-legend-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .server-monitor {
        padding: 16px;
        margin-top: 16px;
    }

    .server-monitor-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .net-speed-display {
        width: 100%;
        text-align: left;
        order: 1;
    }

    .server-monitor-title {
        order: 2;
    }

    .net-speed-item {
        justify-content: flex-start;
    }

    .monitor-item {
        margin: 12px 0;
        padding: 10px;
    }

    .net-speed-chart {
        height: 100px;
    }

    .net-chart-legend {
        gap: 12px;
        flex-wrap: wrap;
    }

    .net-chart-legend-item {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .server-monitor {
        padding: 18px;
    }

    .net-speed-chart {
        height: 110px;
    }
}

/* 桌面端适配 - 更宽的宽度 */
@media (min-width: 1025px) {
    /* 确保服务器监控模块在任何情况下都能显示更宽 */
    .server-monitor {
        max-width: 95% !important;
        width: 95% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
    
    /* 移除hero-content对服务器监控模块的宽度限制 */
    .hero-content {
        max-width: none !important;
        width: 100% !important;
    }
    
    /* 确保hero-section容器能够容纳更宽的内容 */
    .hero-section .container {
        max-width: none !important;
        width: 100% !important;
        padding: 0 20px !important;
    }
}

/* 确保液态玻璃效果在所有浏览器中生效 */
.server-monitor {
    /* 标准语法 */
    backdrop-filter: blur(20px);
    /* Safari 浏览器兼容 */
    -webkit-backdrop-filter: blur(20px);
    /* 确保背景半透明 */
    background-color: rgba(255, 255, 255, 0.8);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.server-monitor {
    animation: fadeIn 0.5s ease-out;
}

.monitor-item {
    animation: fadeIn 0.3s ease-out;
}

.monitor-item:nth-child(2) { animation-delay: 0.1s; }
.monitor-item:nth-child(3) { animation-delay: 0.2s; }
.monitor-item:nth-child(4) { animation-delay: 0.3s; }
.net-speed-chart-container { animation-delay: 0.4s; }

/* ============================================================
   MCSManager 多节点监控面板样式（重新设计）
   ============================================================ */

/* 摘要信息 */
.monitor-nodes-summary {
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.08));
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.15);
    color: #2563eb;
    white-space: nowrap;
}

/* 节点卡片 */
.monitor-node-card {
    margin: 14px 0;
    padding: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(248,250,252,0.75));
    border-radius: 16px;
    border: 1px solid rgba(226,232,240,0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    animation: fadeIn 0.4s ease-out;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.monitor-node-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    opacity: 0.7;
}

.monitor-node-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

/* 卡片头部 */
.monitor-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(226,232,240,0.5);
}

.monitor-node-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.monitor-node-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    letter-spacing: 0.3px;
}

/* 状态指示灯 */
.monitor-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.monitor-status-dot.monitor-status-online {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.monitor-status-dot.monitor-status-online::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #22c55e;
    animation: statusPulse 2s ease-out infinite;
}

.monitor-status-dot.monitor-status-offline {
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

@keyframes statusPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

.monitor-node-meta {
    display: flex;
    gap: 8px;
}

.monitor-meta-tag {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    background: rgba(0,0,0,0.04);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

/* CPU & 内存 双列网格 */
.monitor-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.monitor-stat-box {
    padding: 14px;
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
    border: 1px solid rgba(226,232,240,0.4);
    transition: all 0.2s ease;
}

.monitor-stat-box:hover {
    background: rgba(255,255,255,0.9);
    border-color: rgba(59, 130, 246, 0.2);
}

.monitor-stat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.monitor-stat-icon {
    font-size: 16px;
    line-height: 1;
}

.monitor-stat-label {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    font-weight: 600;
}

.monitor-stat-value {
    margin-left: auto;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    font-family: 'Courier New', monospace;
    letter-spacing: -0.5px;
}

.monitor-stat-bar {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.monitor-stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.monitor-stat-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: barShine 2.5s infinite;
}

@keyframes barShine {
    0% { left: -100%; }
    60%, 100% { left: 100%; }
}

.monitor-stat-fill.progress-low { background: linear-gradient(90deg, #22c55e, #4ade80); }
.monitor-stat-fill.progress-mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.monitor-stat-fill.progress-high { background: linear-gradient(90deg, #ef4444, #f87171); }
.monitor-stat-fill.progress-unknown { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

.monitor-stat-detail {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 8px;
    font-family: 'Courier New', monospace;
}

/* 信息标签行 */
.monitor-info-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.monitor-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0,0,0,0.04);
    color: var(--text-secondary, #64748b);
    border: 1px solid rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.monitor-info-pill .pill-icon {
    font-size: 13px;
}

.monitor-info-pill.mc-pill-online {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.06));
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.2);
}

.monitor-info-pill.mc-pill-players {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.06));
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.18);
}

/* 图表区域 */
.monitor-chart-container {
    margin-top: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(248,250,252,0.4));
    border-radius: 12px;
    border: 1px solid rgba(226,232,240,0.3);
}

.monitor-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.monitor-chart-title {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    font-weight: 600;
}

.monitor-chart-legend {
    display: flex;
    gap: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    font-weight: 500;
}

.legend-dot {
    width: 10px;
    height: 3px;
    border-radius: 2px;
}

.monitor-chart {
    width: 100%;
    height: 90px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.6);
}

.monitor-chart canvas {
    width: 100%;
    height: 100%;
}

/* 暗黑模式 */
[data-theme="dark"] .monitor-nodes-summary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(139, 92, 246, 0.12));
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

[data-theme="dark"] .monitor-node-card {
    background: linear-gradient(135deg, rgba(30,41,59,0.7), rgba(15,23,42,0.5));
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .monitor-node-card::before {
    opacity: 0.9;
}

[data-theme="dark"] .monitor-node-header {
    border-bottom-color: rgba(51,65,85,0.5);
}

[data-theme="dark"] .monitor-node-name {
    color: #f1f5f9;
}

[data-theme="dark"] .monitor-meta-tag {
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
}

[data-theme="dark"] .monitor-stat-box {
    background: rgba(30,41,59,0.5);
    border-color: rgba(51,65,85,0.4);
}

[data-theme="dark"] .monitor-stat-box:hover {
    background: rgba(30,41,59,0.7);
    border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .monitor-stat-value {
    color: #f1f5f9;
}

[data-theme="dark"] .monitor-stat-bar {
    background: #334155;
}

[data-theme="dark"] .monitor-stat-detail {
    color: #64748b;
}

[data-theme="dark"] .monitor-info-pill {
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    border-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .monitor-info-pill.mc-pill-online {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08));
    color: #4ade80;
}

[data-theme="dark"] .monitor-info-pill.mc-pill-players {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.08));
    color: #60a5fa;
}

[data-theme="dark"] .monitor-chart-container {
    background: linear-gradient(135deg, rgba(30,41,59,0.4), rgba(15,23,42,0.3));
    border-color: rgba(51,65,85,0.3);
}

[data-theme="dark"] .monitor-chart {
    background: rgba(15,23,42,0.5);
}

[data-theme="dark"] .legend-item {
    color: #64748b;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .monitor-node-card {
        padding: 16px;
        margin: 10px 0;
    }

    .monitor-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .monitor-node-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .monitor-info-row {
        gap: 6px;
    }

    .monitor-info-pill {
        font-size: 11px;
        padding: 5px 11px;
    }

    .monitor-chart {
        height: 70px;
    }

    .monitor-chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .monitor-stat-value {
        font-size: 16px;
    }
}