/* Live Detections Page */

.live-page {
    min-height: 100vh;
    padding: 110px 0 60px;
    position: relative;
    z-index: 1;
}

.live-header {
    text-align: center;
    margin-bottom: 36px;
}

.live-badge-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--crimson);
    letter-spacing: 1px;
}

.pulse-dot {
    width: 8px; height: 8px;
    background: var(--crimson);
    border-radius: 50%;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); }
}

.live-ai-badge {
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--purple);
}

.live-header h1 {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin-bottom: 12px;
}

.live-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Filters */
.live-filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.filter-btn.active {
    background: rgba(212, 168, 83, 0.08);
    border-color: rgba(212, 168, 83, 0.3);
    color: var(--gold);
}

/* Stats */
.live-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.live-stat {
    text-align: center;
}

.live-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--gold);
}

.live-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Loading */
.live-loading {
    text-align: center;
    padding: 60px 0;
}

.live-loading p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 16px;
}

/* Detection Grid */
.detection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.detection-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.detection-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.detection-card.risk-high::before { background: var(--crimson); opacity: 1; }
.detection-card.risk-medium::before { background: var(--gold); opacity: 0.6; }
.detection-card.risk-low::before { background: var(--emerald); opacity: 0.4; }

.detection-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.detection-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.detection-token {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detection-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(212, 168, 83, 0.08);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    overflow: hidden;
}

.detection-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.detection-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
}

.detection-chain {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.risk-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-badge.high { background: rgba(244, 63, 94, 0.12); color: var(--crimson); }
.risk-badge.medium { background: rgba(212, 168, 83, 0.12); color: var(--gold); }
.risk-badge.low { background: rgba(52, 211, 153, 0.12); color: var(--emerald); }

/* AI Analysis */
.detection-analysis {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detection-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.detection-tag {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.detection-tag.warn { border-color: rgba(212, 168, 83, 0.2); color: var(--gold); }
.detection-tag.danger { border-color: rgba(244, 63, 94, 0.2); color: var(--crimson); }
.detection-tag.safe { border-color: rgba(52, 211, 153, 0.2); color: var(--emerald); }

/* Refresh bar */
.refresh-bar {
    height: 3px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 32px;
    overflow: hidden;
}

.refresh-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 3px;
    width: 0%;
    transition: width 1s linear;
}

.refresh-note {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Modal */
.detail-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 35, 0.92);
    backdrop-filter: blur(12px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6), 0 0 60px rgba(212, 168, 83, 0.05);
}

.modal-content::-webkit-scrollbar {
    width: 4px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    border-color: var(--crimson);
    color: var(--crimson);
    background: rgba(244, 63, 94, 0.08);
}

.modal-header {
    padding: 28px 28px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-token-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.modal-token-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: rgba(212, 168, 83, 0.08);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-token-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 11px;
}

.modal-token-info {
    flex: 1;
}

.modal-token-info h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.modal-chain-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.modal-risk-badge-lg {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.modal-risk-badge-lg.high { background: rgba(244, 63, 94, 0.1); color: var(--crimson); border: 1px solid rgba(244, 63, 94, 0.2); }
.modal-risk-badge-lg.medium { background: rgba(212, 168, 83, 0.1); color: var(--gold); border: 1px solid rgba(212, 168, 83, 0.2); }
.modal-risk-badge-lg.low { background: rgba(52, 211, 153, 0.1); color: var(--emerald); border: 1px solid rgba(52, 211, 153, 0.2); }

.modal-address {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    word-break: break-all;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.modal-body {
    padding: 24px 28px 28px;
}

/* Score Section */
.modal-score-section {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    margin-bottom: 24px;
}

.modal-score-ring {
    position: relative;
    width: 100px; height: 100px;
    flex-shrink: 0;
}

.modal-score-ring svg {
    width: 100%; height: 100%;
}

.modal-score-value {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    font-size: 1.8rem;
    font-weight: 900;
    font-family: var(--font-mono);
}

.modal-score-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, 60%);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.modal-score-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.score-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-detail-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.score-detail-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

/* Modal Sections */
.modal-section {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.modal-section-icon {
    font-size: 1rem;
}

.modal-section-header h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}

.modal-analysis-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
    padding: 14px 16px;
    background: rgba(139, 92, 246, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-radius: 12px;
}

/* Factors */
.modal-factors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-factor-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.factor-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

/* Tags */
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-tag {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid;
}

.modal-tag.safe { background: rgba(52, 211, 153, 0.06); border-color: rgba(52, 211, 153, 0.2); color: var(--emerald); }
.modal-tag.warn { background: rgba(212, 168, 83, 0.06); border-color: rgba(212, 168, 83, 0.2); color: var(--gold); }
.modal-tag.danger { background: rgba(244, 63, 94, 0.06); border-color: rgba(244, 63, 94, 0.2); color: var(--crimson); }

/* Links */
.modal-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-link-btn {
    padding: 10px 18px;
    background: rgba(212, 168, 83, 0.05);
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: 10px;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.modal-link-btn:hover {
    background: rgba(212, 168, 83, 0.1);
    border-color: rgba(212, 168, 83, 0.3);
    transform: translateY(-1px);
}

/* Actions */
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-action-primary {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #000;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.modal-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 168, 83, 0.3);
}

.modal-action-secondary {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    border: none;
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.modal-action-secondary:hover {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .detection-grid { grid-template-columns: 1fr; }
    .live-stats { gap: 20px; }
    .live-header h1 { font-size: 2rem; }
    .modal-content { padding: 20px; }
}

/* AI Analyze Button */
.ai-analyze-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(212, 168, 83, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-analyze-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(212, 168, 83, 0.15));
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.2);
}

.ai-analyze-btn:disabled {
    cursor: not-allowed;
}
