/* TangBuy Callback Admin Styles */

.tangbuy-callback-admin {
    max-width: 1200px;
}

.tangbuy-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-card.pending {
    border-left: 4px solid #ffa500;
}

.stat-card.completed {
    border-left: 4px solid #28a745;
}

.stat-card.failed {
    border-left: 4px solid #dc3545;
}

.stat-card.processing {
    border-left: 4px solid #007cba;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card.pending .stat-number {
    color: #ffa500;
}

.stat-card.completed .stat-number {
    color: #28a745;
}

.stat-card.failed .stat-number {
    color: #dc3545;
}

.stat-card.processing .stat-number {
    color: #007cba;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tangbuy-callback-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tangbuy-callback-info h2 {
    margin-top: 0;
    color: #333;
}

.tangbuy-callback-info ul {
    margin: 15px 0;
    padding-left: 20px;
}

.tangbuy-callback-info li {
    margin: 8px 0;
    line-height: 1.5;
}

.tangbuy-failed-variations {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tangbuy-failed-variations h2 {
    margin-top: 0;
    color: #dc3545;
}

.no-failed-variations {
    color: #28a745;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.tangbuy-callback-actions {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.tangbuy-callback-actions button {
    margin: 0 10px 10px 0;
}

.tangbuy-callback-logs {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tangbuy-callback-logs h2 {
    margin-top: 0;
}

.logs-container {
    max-height: 400px;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
}

.log-entries {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.log-entry {
    margin: 5px 0;
    padding: 5px 10px;
    border-radius: 3px;
}

.log-entry.log-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid #dc3545;
}

.log-entry.log-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 3px solid #17a2b8;
}

.log-time {
    color: #666;
    margin-right: 10px;
}

.log-message {
    color: #333;
}

.no-logs {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* 多调度器样式 */
.tangbuy-scheduler-status {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.scheduler-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.scheduler-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.scheduler-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.scheduler-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.metric:last-child {
    border-bottom: none;
}

.metric-label {
    font-size: 0.9em;
    color: #666;
}

.metric-value {
    font-weight: bold;
    color: #333;
}

/* 调度器配置样式 */
.tangbuy-scheduler-config {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tangbuy-scheduler-config h2 {
    margin-top: 0;
    color: #333;
}

.tangbuy-scheduler-config .form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
}

.tangbuy-scheduler-config .form-table td {
    padding: 15px 10px;
}

.tangbuy-scheduler-config input[type="number"],
.tangbuy-scheduler-config select {
    width: 100px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.tangbuy-scheduler-config .description {
    margin: 5px 0 0 0;
    font-style: italic;
    color: #666;
}

/* 性能建议样式 */
.tangbuy-performance-recommendations {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tangbuy-performance-recommendations h2 {
    margin-top: 0;
    color: #856404;
}

.tangbuy-performance-recommendations ul {
    margin: 10px 0;
    padding-left: 20px;
}

.tangbuy-performance-recommendations li {
    margin: 5px 0;
    color: #856404;
}

/* 调度器状态指示器 */
.scheduler-card.load-low {
    border-left: 4px solid #28a745;
}

.scheduler-card.load-medium {
    border-left: 4px solid #ffc107;
}

.scheduler-card.load-high {
    border-left: 4px solid #dc3545;
}


/* 响应式设计 */
@media (max-width: 768px) {
    .tangbuy-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 2em;
    }
    
    .tangbuy-callback-actions button {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .tangbuy-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tangbuy-callback-info,
    .tangbuy-failed-variations,
    .tangbuy-callback-actions,
    .tangbuy-callback-logs {
        padding: 15px;
    }
}

/* 加载动画 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误消息 */
.notice {
    margin: 15px 0;
    padding: 12px;
    border-radius: 4px;
}

.notice.notice-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.notice.notice-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* 表格样式 */
.wp-list-table {
    margin-top: 15px;
}

.wp-list-table th,
.wp-list-table td {
    padding: 10px;
}

.wp-list-table .button-small {
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.4;
}

.retry-variation {
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.retry-variation:hover {
    background: #005a87;
}

.retry-variation:disabled {
    background: #ccc;
    cursor: not-allowed;
}
