/* =====================================================
   ANOMALIES SECTION STYLES
   ===================================================== */

.anomalies-section {
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.anomalies-header {
    text-align: center;
    margin-bottom: 2rem;
}

.anomalies-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.anomalies-header h2 i {
    color: #f59e0b;
    animation: pulse 2s ease-in-out infinite;
}

.anomalies-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.anomalies-loader {
    border-top-color: #f59e0b !important;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4) !important;
}

/* Summary Stats */
.anomalies-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.summary-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 140px;
    transition: all 0.3s ease;
}

.summary-stat:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.summary-stat.suspicious {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.summary-stat .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.summary-stat.suspicious .stat-number {
    color: #ef4444;
}

.summary-stat .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Anomalies Grid */
.anomalies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

/* Anomaly Card */
.anomaly-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease-out;
}

.anomaly-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.anomaly-card.verdict-suspicious {
    border-color: rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-card) 50%);
}

.anomaly-card.verdict-questionable {
    border-color: rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, var(--bg-card) 50%);
}

.anomaly-card.verdict-minor {
    border-color: rgba(107, 114, 128, 0.5);
}

/* Card Header */
.anomaly-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info > i {
    font-size: 1.5rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .display-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.user-details .username {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Verdict Badge */
.verdict-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    text-align: center;
}

.verdict-badge.verdict-suspicious {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.verdict-badge.verdict-questionable {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.verdict-badge.verdict-minor {
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(107, 114, 128, 0.4);
}

.verdict-badge .score {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.verdict-badge.verdict-suspicious .score {
    color: #ef4444;
}

.verdict-badge.verdict-questionable .score {
    color: #f59e0b;
}

.verdict-badge.verdict-minor .score {
    color: #9ca3af;
}

.verdict-badge .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* Card Body */
.anomaly-card-body {
    padding: 1rem 1.25rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Metrics Container */
.metrics-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 0.75rem;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.metric-name {
    font-weight: 600;
    color: var(--text-primary);
}

.anomaly-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

/* Anomalies List */
.anomalies-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.anomaly-item {
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.anomaly-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.anomaly-item.spike { border-left-color: #ef4444; }
.anomaly-item.unrealistic { border-left-color: #f59e0b; }
.anomaly-item.round { border-left-color: #8b5cf6; }
.anomaly-item.drop-recover { border-left-color: #3b82f6; }
.anomaly-item.stagnation { border-left-color: #6b7280; }

.anomaly-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.anomaly-item-header i {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.anomaly-type-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    flex-grow: 1;
}

.confidence-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: white;
    font-weight: 600;
}

/* Anomaly Item Details */
.anomaly-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.detail-row i {
    width: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.detail-row.dates i {
    color: var(--accent-primary);
}

.detail-row.values {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
}

.value-before {
    color: var(--text-muted);
}

.value-after {
    color: #22c55e;
    font-weight: 600;
}

.value-drop {
    color: #ef4444;
    font-weight: 600;
}

.value-stagnation {
    color: #6b7280;
}

.change-badge {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: auto;
}

.change-badge.positive {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.change-badge.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.z-score {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Card Footer */
.anomaly-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.view-details-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.view-details-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px var(--glow-primary);
}

/* Scrollbar für Card Body */
.anomaly-card-body::-webkit-scrollbar {
    width: 6px;
}

.anomaly-card-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.anomaly-card-body::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .anomalies-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }
    
    .anomalies-summary {
        gap: 1rem;
    }
    
    .summary-stat {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }
    
    .summary-stat .stat-number {
        font-size: 1.5rem;
    }
    
    .anomaly-card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .verdict-badge {
        flex-direction: row;
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    .detail-row {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .anomalies-header h2 {
        font-size: 1.4rem;
    }
    
    .anomaly-card-body {
        max-height: 300px;
    }
}
