/**
 * AI Traffic Tracker - Frontend Styles
 * Badges, TOP 10 widgets, and counters.
 */

.ai-traffic-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 4px 10px;
    border-radius: 9999px;
    margin: 8px 0 16px 0;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.ai-traffic-badge:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.ai-badge-icon {
    display: inline-flex;
    align-items: center;
    color: #3b82f6;
}

.ai-badge-views strong,
.ai-badge-reads strong {
    color: #0f172a;
    font-weight: 600;
}

.ai-badge-sep {
    color: #94a3b8;
    margin: 0 2px;
}

/* TOP Articles Widget */
.ai-traffic-top-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.ai-widget-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.ai-widget-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-widget-icon {
    font-size: 1.25rem;
}

/* List layout */
.ai-top-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-top-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
}

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

.ai-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    flex-shrink: 0;
}

.ai-rank-badge.ai-rank-1 {
    background: linear-gradient(135deg, #fef08a, #eab308);
    color: #854d0e;
    box-shadow: 0 2px 4px rgba(234, 179, 8, 0.3);
}

.ai-rank-badge.ai-rank-2 {
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    color: #334155;
}

.ai-rank-badge.ai-rank-3 {
    background: linear-gradient(135deg, #fed7aa, #f97316);
    color: #9a3412;
}

.ai-top-item-content {
    flex: 1;
    min-width: 0;
}

.ai-article-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    line-height: 1.4;
    display: block;
    transition: color 0.15s ease;
}

.ai-article-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.ai-top-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.775rem;
    color: #64748b;
}

.ai-stat-sep {
    color: #cbd5e1;
}

/* Table layout */
.ai-widget-table-wrap {
    overflow-x: auto;
}

.ai-widget-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.ai-widget-table th {
    padding: 10px 12px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.ai-widget-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.ai-rate-badge {
    color: #10b981;
    font-weight: 600;
    margin-left: 4px;
}
