/*
 * Mamba Performance - Metrics Dashboard Styles
 * Unified with main admin theme
 */

/* Performance Metrics Dashboard */
.mamba-metrics-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Metric Cards */
.mamba-metric-card {
    background: var(--mamba-card);
    border-radius: var(--mamba-radius);
    padding: 18px 20px;
    box-shadow: var(--mamba-shadow);
    border: 1px solid var(--mamba-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mamba-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--mamba-btn-gradient);
    opacity: 0.8;
}

.mamba-metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mamba-shadow-lg);
    border-color: var(--mamba-primary);
}

.mamba-metric-card .metric-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--mamba-primary);
    font-size: 24px;
    opacity: 0.15;
}

.mamba-metric-card .metric-title {
    font-family: var(--mamba-font-primary);
    font-size: 11px;
    font-weight: 600;
    color: var(--mamba-text-muted);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mamba-metric-card .metric-value {
    font-family: var(--mamba-font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--mamba-text-main);
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.mamba-metric-card .metric-trend {
    font-family: var(--mamba-font-primary);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-weight: 500;
}

.mamba-metric-card .metric-trend.positive {
    color: var(--mamba-primary);
}

.mamba-metric-card .metric-trend.negative {
    color: var(--mamba-danger);
}

.mamba-metric-card .metric-trend.neutral {
    color: var(--mamba-text-muted);
}

.mamba-metric-card .metric-trend.excellent {
    color: var(--mamba-primary);
}

.mamba-metric-card .metric-trend.good {
    color: var(--mamba-primary);
}

.mamba-metric-card .metric-trend.average {
    color: var(--mamba-warning);
}

.mamba-metric-card .metric-trend.poor {
    color: var(--mamba-danger);
}

.mamba-metric-card .metric-note {
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--mamba-text-muted);
}

.mamba-metric-card .metric-note small {
    font-size: 11px;
}

/* Efficiency Score Card */
.mamba-metric-card.efficiency-score {
    position: relative;
}

.mamba-metric-card .score-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    font-family: var(--mamba-font-mono);
    color: #ffffff;
    background: var(--mamba-btn-gradient);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.mamba-metric-card .score-badge.excellent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.mamba-metric-card .score-badge.good {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.mamba-metric-card .score-badge.average {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
}

.mamba-metric-card .score-badge.poor {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

[data-mamba-theme="dark"] .mamba-metric-card .score-badge {
    box-shadow: 0 0 20px var(--mamba-primary-glow);
}

/* Cache Status Indicator */
.mamba-cache-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
    background: var(--mamba-primary-glow);
    border-radius: var(--mamba-radius);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.mamba-cache-status .status-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--mamba-primary);
    box-shadow: 0 0 10px var(--mamba-primary);
    animation: pulse-status 2s infinite;
}

.mamba-cache-status .status-text {
    font-family: var(--mamba-font-primary);
    font-size: 14px;
    font-weight: 600;
    color: var(--mamba-primary);
    letter-spacing: 0.3px;
}

.mamba-cache-status.inactive {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.mamba-cache-status.inactive .status-icon {
    background: var(--mamba-danger);
    box-shadow: 0 0 10px var(--mamba-danger);
    animation: none;
}

.mamba-cache-status.inactive .status-text {
    color: var(--mamba-danger);
}

@keyframes pulse-status {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

/* System Health */
.mamba-system-health {
    margin: 32px 0;
}

.mamba-system-health h3 {
    font-family: var(--mamba-font-primary);
    font-size: 14px;
    font-weight: 700;
    color: var(--mamba-text-main);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mamba-border);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mamba-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.mamba-health-card {
    background: var(--mamba-card);
    border-radius: var(--mamba-radius);
    padding: 20px;
    border: 1px solid var(--mamba-border);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.25s ease;
}

.mamba-health-card:hover {
    border-color: var(--mamba-primary);
    transform: translateY(-2px);
    box-shadow: var(--mamba-shadow);
}

.health-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--mamba-radius-sm);
    background: var(--mamba-primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mamba-primary);
    flex-shrink: 0;
}

.mamba-health-card.healthy .health-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--mamba-primary);
}

.mamba-health-card.needs-attention .health-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--mamba-warning);
}

.mamba-health-card.info .health-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--mamba-info);
}

.health-content h4 {
    font-family: var(--mamba-font-primary);
    font-size: 14px;
    font-weight: 600;
    color: var(--mamba-text-main);
    margin: 0 0 6px 0;
}

.health-content p {
    font-family: var(--mamba-font-primary);
    font-size: 13px;
    color: var(--mamba-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Action Cards */
.mamba-action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.mamba-action-card {
    background: var(--mamba-card);
    border-radius: var(--mamba-radius);
    padding: 24px;
    border: 1px solid var(--mamba-border);
    transition: all 0.25s ease;
}

.mamba-action-card:hover {
    border-color: var(--mamba-primary);
    box-shadow: var(--mamba-shadow);
}

.mamba-action-card h4 {
    font-family: var(--mamba-font-primary);
    color: var(--mamba-text-main);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mamba-action-card h4 .dashicons {
    color: var(--mamba-primary);
}

.mamba-action-card p {
    font-family: var(--mamba-font-primary);
    color: var(--mamba-text-muted);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Stats Table */
.mamba-stats-table {
    border: 1px solid var(--mamba-border);
    border-radius: var(--mamba-radius);
    background: var(--mamba-card);
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.mamba-stats-table th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--mamba-text-muted);
    font-family: var(--mamba-font-primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--mamba-border);
    text-align: left;
}

[data-mamba-theme="dark"] .mamba-stats-table th {
    background: rgba(255, 255, 255, 0.03);
}

.mamba-stats-table td {
    font-family: var(--mamba-font-primary);
    padding: 14px 18px;
    color: var(--mamba-text-main);
    border-bottom: 1px solid var(--mamba-border);
    font-size: 14px;
}

.mamba-stats-table tr:last-child td {
    border-bottom: none;
}

.mamba-stats-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

[data-mamba-theme="dark"] .mamba-stats-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.mamba-stats-table code {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--mamba-primary);
    font-family: var(--mamba-font-mono);
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
}

.status-indicator.success {
    background: var(--mamba-primary);
    box-shadow: 0 0 6px var(--mamba-primary);
}

.status-indicator.warning {
    background: var(--mamba-warning);
}

.status-indicator.error {
    background: var(--mamba-danger);
}

/* Admin Wrap */
.mamba-admin-wrap {
    font-family: var(--mamba-font-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .mamba-metrics-dashboard {
        grid-template-columns: 1fr;
    }

    .mamba-action-cards {
        grid-template-columns: 1fr;
    }

    .mamba-health-grid {
        grid-template-columns: 1fr;
    }
}