/* PHP探针小组件样式 */
/* 
 * CSS优先级说明：
 * 1. 强制浅色主题 (.light-theme + !important) - 最高优先级
 * 2. 强制暗色主题 (.dark-theme)
 * 3. 系统暗色主题 (@media prefers-color-scheme: dark + :not(.light-theme):not(.dark-theme))
 * 4. 默认浅色主题 (基础样式)
 */
.php-probe-widget-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.php-probe-widget-container.compact {
    font-size: 12px;
}

.php-probe-section {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.php-probe-section:last-child {
    border-bottom: none;
}

.php-probe-widget-container.compact .php-probe-section {
    padding: 10px;
}

.php-probe-section-title {
    margin: 0 0 10px 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid var(--divider-color, #3498db);
    padding-bottom: 5px;
}

.php-probe-widget-container.compact .php-probe-section-title {
    font-size: 13px;
    margin-bottom: 8px;
}

.php-probe-info-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.php-probe-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f8f9fa;
}

.php-probe-info-item:last-child {
    border-bottom: none;
}

.php-probe-widget-container.compact .php-probe-info-item {
    padding: 4px 0;
}

.php-probe-info-item .label {
    font-weight: 500;
    color: #666;
    flex: 1;
}

.php-probe-info-item .value {
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
    flex: 1;
}

/* 使用率进度条 */
.usage-bar {
    display: inline-block;
    width: 60px;
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    overflow: hidden;
}

.usage-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cpu-fill {
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%);
}

.memory-fill {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
}

.disk-fill {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

.usage-text {
    font-size: 11px;
    font-weight: bold;
    color: #27ae60;
}

/* 为不同类型的进度条设置相应的文字颜色 */
.cpu-usage .usage-text {
    color: #f39c12;
}

.memory-usage .usage-text {
    color: #3498db;
}

.disk-usage .usage-text {
    color: #e74c3c;
}

/* 实时更新指示器 */
.php-probe-realtime {
    margin-top: 10px;
    text-align: center;
}

.realtime-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    color: #7f8c8d;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #27ae60;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .php-probe-widget-container {
        font-size: 12px;
    }

    .php-probe-section {
        padding: 12px;
    }

    .php-probe-section-title {
        font-size: 13px;
    }

    .usage-bar {
        width: 50px;
        height: 6px;
    }
}

/* 强制浅色主题（最高优先级，覆盖所有其他主题和系统设置） */
.php-probe-widget-container.light-theme {
    background: #fff !important;
    color: #333 !important;
    border-color: #e0e0e0 !important;
}

.php-probe-widget-container.light-theme,
.php-probe-widget-container.light-theme * {
    color: inherit;
}

.php-probe-widget-container.light-theme .php-probe-section {
    background: transparent !important;
    border-bottom-color: #f0f0f0 !important;
}

.php-probe-widget-container.light-theme .php-probe-section-title {
    color: #2c3e50 !important;
    border-bottom-color: var(--divider-color, #3498db) !important;
}

.php-probe-widget-container.light-theme .php-probe-info-item {
    border-bottom-color: #f8f9fa !important;
}

.php-probe-widget-container.light-theme .php-probe-info-item .label {
    color: #666 !important;
}

.php-probe-widget-container.light-theme .php-probe-info-item .value {
    color: #2c3e50 !important;
}

.php-probe-widget-container.light-theme .usage-bar {
    background-color: #ecf0f1 !important;
}

.php-probe-widget-container.light-theme .usage-fill {
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%) !important;
}

.php-probe-widget-container.light-theme .cpu-fill {
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%) !important;
}

.php-probe-widget-container.light-theme .memory-fill {
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%) !important;
}

.php-probe-widget-container.light-theme .disk-fill {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%) !important;
}

.php-probe-widget-container.light-theme .usage-text {
    color: #27ae60 !important;
}

.php-probe-widget-container.light-theme .cpu-usage .usage-text {
    color: #f39c12 !important;
}

.php-probe-widget-container.light-theme .memory-usage .usage-text {
    color: #3498db !important;
}

.php-probe-widget-container.light-theme .disk-usage .usage-text {
    color: #e74c3c !important;
}

.php-probe-widget-container.light-theme .realtime-indicator {
    color: #7f8c8d !important;
}

.php-probe-widget-container.light-theme .status-dot {
    background-color: #27ae60 !important;
}

/* 暗色主题支持 */
.php-probe-widget-container.dark-theme {
    background: #1a1a1a;
    color: #ecf0f1;
    border-color: #333;
}

.php-probe-widget-container.dark-theme .php-probe-section {
    border-bottom-color: #333;
}

.php-probe-widget-container.dark-theme .php-probe-section-title {
    color: #ecf0f1;
    border-bottom-color: #3498db;
}

.php-probe-widget-container.dark-theme .php-probe-info-item {
    border-bottom-color: #333;
}

.php-probe-widget-container.dark-theme .php-probe-info-item .label {
    color: #ccc;
}

.php-probe-widget-container.dark-theme .php-probe-info-item .value {
    color: #ecf0f1;
}

.php-probe-widget-container.dark-theme .usage-bar {
    background-color: #333;
}

.php-probe-widget-container.dark-theme .usage-fill {
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
}

.php-probe-widget-container.dark-theme .usage-text {
    color: #2ecc71;
}

.php-probe-widget-container.dark-theme .realtime-indicator {
    color: #bdc3c7;
}

/* 系统暗色主题支持（当未手动设置时，跟随系统偏好） */
@media (prefers-color-scheme: dark) {
    /* 强制浅色主题（即使在系统暗色模式下也强制使用浅色） */
    .php-probe-widget-container.light-theme {
        background: #fff !important;
        color: #333 !important;
        border-color: #e0e0e0 !important;
    }

    .php-probe-widget-container.light-theme .php-probe-section {
        background: transparent !important;
        border-bottom-color: #f0f0f0 !important;
    }

    .php-probe-widget-container.light-theme .php-probe-section-title {
        color: #2c3e50 !important;
        border-bottom-color: var(--divider-color, #3498db) !important;
    }

    .php-probe-widget-container.light-theme .php-probe-info-item {
        border-bottom-color: #f8f9fa !important;
    }

    .php-probe-widget-container.light-theme .php-probe-info-item .label {
        color: #666 !important;
    }

    .php-probe-widget-container.light-theme .php-probe-info-item .value {
        color: #2c3e50 !important;
    }

    .php-probe-widget-container.light-theme .usage-bar {
        background-color: #ecf0f1 !important;
    }

    .php-probe-widget-container.light-theme .usage-fill {
        background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%) !important;
    }

    .php-probe-widget-container.light-theme .cpu-fill {
        background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%) !important;
    }

    .php-probe-widget-container.light-theme .memory-fill {
        background: linear-gradient(90deg, #3498db 0%, #2980b9 100%) !important;
    }

    .php-probe-widget-container.light-theme .disk-fill {
        background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%) !important;
    }

    .php-probe-widget-container.light-theme .usage-text {
        color: #27ae60 !important;
    }

    .php-probe-widget-container.light-theme .cpu-usage .usage-text {
        color: #f39c12 !important;
    }

    .php-probe-widget-container.light-theme .memory-usage .usage-text {
        color: #3498db !important;
    }

    .php-probe-widget-container.light-theme .disk-usage .usage-text {
        color: #e74c3c !important;
    }

    .php-probe-widget-container.light-theme .realtime-indicator {
        color: #7f8c8d !important;
    }

    .php-probe-widget-container.light-theme .status-dot {
        background-color: #27ae60 !important;
    }

    /* 系统自动暗色主题（仅当未手动设置时） */
    .php-probe-widget-container:not(.dark-theme):not(.light-theme) {
        background: #1a1a1a;
        color: #ecf0f1;
        border-color: #333;
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .php-probe-section {
        border-bottom-color: #333;
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .php-probe-section-title {
        color: #ecf0f1;
        border-bottom-color: #3498db;
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .php-probe-info-item {
        border-bottom-color: #333;
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .php-probe-info-item .label {
        color: #ccc;
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .php-probe-info-item .value {
        color: #ecf0f1;
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .usage-bar {
        background-color: #333;
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .usage-fill {
        background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .usage-text {
        color: #2ecc71;
    }

    .php-probe-widget-container:not(.dark-theme):not(.light-theme) .realtime-indicator {
        color: #bdc3c7;
    }
}

/* WordPress小组件特定样式 */
.widget_php_probe_widget {
    margin-bottom: 20px;
}

.widget_php_probe_widget .widget-title {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

/* 加载动画 */
.php-probe-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.php-probe-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3498db;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 状态指示器 */
.status-good {
    color: #27ae60;
}

.status-warning {
    color: #f39c12;
}

.status-error {
    color: #e74c3c;
}

.status-good::before {
    content: '✓ ';
}

.status-warning::before {
    content: '⚠ ';
}

.status-error::before {
    content: '✕ ';
}