/* =====================================================
   ANOMALIES SECTION STYLES
   Erweiterte Styles für API v2.2
   ===================================================== */

.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: 1.5rem;
    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: 120px;
    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.highly-suspicious {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.15);
}

.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.highly-suspicious .stat-number {
    color: #dc2626;
}

.summary-stat .stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Platform Overview */
.platform-overview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.platform-overview-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.platform-stats-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.platform-stat-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.platform-stat-mini.has-anomalies {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}

.platform-stat-mini i {
    font-size: 1.25rem;
}

.platform-stat-info {
    display: flex;
    flex-direction: column;
}

.platform-stat-info .platform-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.platform-stat-info .platform-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.platform-stat-info .platform-max-score {
    font-size: 0.7rem;
    color: #f59e0b;
    font-weight: 600;
}

/* Severity Breakdown */
.severity-breakdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.severity-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--bg-card);
}

.severity-item.high {
    border-left: 3px solid #ef4444;
}

.severity-item.medium {
    border-left: 3px solid #f59e0b;
}

.severity-item.low {
    border-left: 3px solid #6b7280;
}

.severity-item i {
    font-size: 1rem;
}

.severity-item.high i { color: #ef4444; }
.severity-item.medium i { color: #f59e0b; }
.severity-item.low i { color: #6b7280; }

.severity-count {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.severity-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Anomalies Grid */
.anomalies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Maximal 3 Karten nebeneinander */
@media (min-width: 1000px) {
    .anomalies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 700px) and (max-width: 999px) {
    .anomalies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 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-highly-suspicious {
    border-color: rgba(220, 38, 38, 0.6);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, var(--bg-card) 50%);
}

.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;
    border: 1px solid;
}

.verdict-badge.verdict-highly-suspicious {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4);
}

.verdict-badge.verdict-suspicious {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.verdict-badge.verdict-questionable {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
}

.verdict-badge.verdict-minor {
    background: rgba(107, 114, 128, 0.2);
    border-color: rgba(107, 114, 128, 0.4);
}

.verdict-badge .score {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.verdict-badge.verdict-highly-suspicious .score {
    color: #dc2626;
}

.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;
}

/* Compact Card Body für Startseite */
.anomaly-card-body.compact {
    padding: 0.75rem 1.25rem;
    max-height: none;
    overflow: visible;
}

/* Kompakte Anomalie-Zusammenfassung */
.anomaly-summary-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.anomaly-summary-compact .anomaly-type-badge {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.anomaly-summary-compact .anomaly-change {
    font-weight: 700;
    color: #22c55e;
    font-size: 0.95rem;
}

.anomaly-summary-compact .anomaly-percent {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Zusätzliche Info-Zeilen in den Karten */
.anomaly-metrics-affected,
.anomaly-date-range {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.anomaly-metrics-affected i,
.anomaly-date-range i {
    color: var(--text-muted);
    font-size: 0.75rem;
    width: 14px;
}

/* =====================================================
   MINOR ANOMALIES SECTION - Separate Kategorie
   ===================================================== */

.minor-anomalies-section {
    margin-top: 2.5rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.minor-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.minor-section-title i {
    color: #6b7280;
}

.minor-count {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: auto;
}

/* Grid in der Minor-Sektion */
.minor-anomalies-section .anomalies-grid {
    padding: 0;
}

/* Minor Cards etwas dezenter */
.minor-anomalies-section .anomaly-card {
    opacity: 0.85;
    border-color: var(--border-color);
}

.minor-anomalies-section .anomaly-card:hover {
    opacity: 1;
}

/* =====================================================
   CONTENT-EXPLAINED SECTION - Durch Uploads erklärt
   ===================================================== */

.content-explained-section {
    margin-top: 2.5rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.content-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.content-section-title i {
    color: #10b981;
}

.content-count {
    background: rgba(16, 185, 129, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #10b981;
    margin-left: auto;
}

.content-section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

/* Content Explained Cards - grün */
.content-explained-section .anomaly-card {
    opacity: 0.8;
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
}

.content-explained-section .anomaly-card:hover {
    opacity: 1;
    border-color: #10b981;
}

/* Verdict Badge für Content Explained */
.verdict-content-explained {
    border-color: #10b981 !important;
}

.verdict-content-explained .verdict-badge {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
}

.verdict-content-explained .verdict-badge .score,
.verdict-content-explained .verdict-badge .label {
    color: #10b981 !important;
}

/* 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 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.anomaly-total {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.view-details-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.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;
    }
}

@media (max-width: 480px) {
    .anomalies-header h2 {
        font-size: 1.4rem;
    }
}

/* =====================================================
   NEUE STYLES FÜR API v2.2
   ===================================================== */

/* Content Context Info */
.content-context-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #22c55e;
}

.content-context-info i {
    color: #22c55e;
}

.content-context-note {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #fbbf24;
}

.content-context-note i {
    color: #fbbf24;
    font-size: 0.7rem;
}

/* Content Explained State - Anomalie durch Uploads erklärt */
.anomaly-item.content-explained {
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
    opacity: 0.8;
}

.anomaly-item.content-explained .anomaly-item-header i {
    color: #22c55e;
}

.anomaly-item.content-explained .anomaly-type-label {
    color: #22c55e;
}

/* Anomaly Description */
.anomaly-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Anomaly Subtype Badge */
.anomaly-subtype {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    background: var(--bg-tertiary);
    border-radius: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Days Between */
.days-between {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Threshold Info */
.threshold-info {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-left: auto;
}

/* Anomaly Meta in Footer - entfernt, jetzt in card footer integriert */

/* Scan Info Footer */
.scan-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.scan-info i {
    color: var(--accent-primary);
}

.scan-duration {
    opacity: 0.7;
    font-size: 0.75rem;
}

/* New Anomaly Types Styles */
.anomaly-item.trend-break { border-left-color: #8b5cf6; }
.anomaly-item.purchase { border-left-color: #ec4899; }
.anomaly-item.velocity { border-left-color: #06b6d4; }

/* Z-Score Extended Info */
.z-score {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

/* =====================================================
   VIRAL / CONTENT EXPLAINED STYLES
   ===================================================== */

/* Badge für virale Anomalien */
.anomaly-type-badge.viral {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Content Info in Karten */
.anomaly-content-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #10b981;
}

.anomaly-content-info i {
    font-size: 0.7rem;
}

/* Viral class für anomaly-info-card auf Details-Seite */
.anomaly-info-card.viral {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), transparent);
}

.anomaly-info-card.viral .anomaly-score-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.anomaly-info-card.viral .verdict-label {
    color: #10b981;
}

/* Content-explained Hinweis bei Anomalie-Typen */
.content-explained-note {
    font-size: 0.7rem;
    color: #10b981;
    opacity: 0.8;
}

.anomaly-type-stat.all-explained {
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
}

.anomaly-type-stat.all-explained .type-count {
    color: #10b981;
}
