/**
 * Admin styles for Aegilock WooCommerce
 */

/* Dashboard Widget Styles */
.aegilock-dashboard-widget {
    font-size: 13px;
}

.aegilock-stats-section {
    margin-bottom: 20px;
}

.aegilock-stats-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.aegilock-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.aegilock-stat-card {
    text-align: center;
    padding: 10px;
    background: #f9f9f9;
}

.aegilock-stat-card.checked .stat-number { color: #0073aa; }
.aegilock-stat-card.blocked .stat-number { color: #dc3545; }
.aegilock-stat-card.held .stat-number { color: #ffc107; }
.aegilock-stat-card.score .stat-number { color: #28a745; }

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

/* API Usage Styles */
.aegilock-api-usage {
    background: #f9f9f9;
    padding: 15px;
}

.api-plan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.plan-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.plan-badge.free {
    background: #e0e0e0;
    color: #666;
}

.plan-badge.premium {
    background: #28a745;
    color: white;
}

.upgrade-link {
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
}

.upgrade-link:hover {
    text-decoration: underline;
}

.progress-bar {
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 70%, #dc3545 100%);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 11px;
    color: #666;
}

.api-warning {
    margin-top: 10px;
    color: #dc3545;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Quick Actions */
.aegilock-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.aegilock-quick-actions .button {
    font-size: 12px;
    padding: 4px 8px;
    height: auto;
}

/* Recent Alerts */
.aegilock-recent-alerts {
    max-height: 150px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-info a {
    text-decoration: none;
    font-weight: 600;
}

.alert-time {
    font-size: 11px;
    color: #666;
}

.fraud-score {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.fraud-score.risk-low {
    background: #d4edda;
    color: #155724;
}

.fraud-score.risk-medium {
    background: #fff3cd;
    color: #856404;
}

.fraud-score.risk-high {
    background: #f8d7da;
    color: #721c24;
}

/* Disabled State */
.aegilock-disabled-state {
    text-align: center;
    padding: 20px;
}

.aegilock-disabled-state h4 {
    margin-bottom: 10px;
}

.aegilock-disabled-state p {
    color: #666;
    margin-bottom: 15px;
}

/* Order Admin Styles */
.aegilock-fraud-info {
    background: #f9f9f9;
    padding: 15px;
    margin: 15px 0;
}

.aegilock-fraud-info h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
}

.fraud-score-low { color: #28a745; font-weight: bold; }
.fraud-score-medium { color: #ffc107; font-weight: bold; }
.fraud-score-high { color: #dc3545; font-weight: bold; }

.recommendation-allow { color: #28a745; font-weight: bold; }
.recommendation-hold { color: #ffc107; font-weight: bold; }
.recommendation-block { color: #dc3545; font-weight: bold; }

/* Orders Table */
.column-fraud_score {
    width: 10%;
}

.widefat .fraud-score {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

/* Admin Settings */
.aegilock-api-test-result {
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
}

.aegilock-api-test-result.success {
    background: #d4edda;
    color: #155724;
}

.aegilock-api-test-result.error {
    background: #f8d7da;
    color: #721c24;
}

.aegilock-account-info {
    background: #f9f9f9;
    padding: 15px;
    margin: 10px 0;
}

.account-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.account-info-item {
    text-align: center;
}

.account-info-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
}

.account-info-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Fraud Logs Page */
.aegilock-logs-page .tablenav {
    margin: 10px 0;
}

.action-allow { color: #28a745; font-weight: bold; }
.action-hold { color: #ffc107; font-weight: bold; }
.action-block { color: #dc3545; font-weight: bold; }

/* Responsive Design */
@media (max-width: 768px) {
    .aegilock-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aegilock-quick-actions {
        flex-direction: column;
    }
    
    .alert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .account-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .aegilock-stats-grid {
        grid-template-columns: 1fr;
    }
}