/**
 * Lokalnyheter Classified Chyron - AI-filtered news ticker
 * Shows only articles matching user-configurable concepts
 * Color-coded badges indicate which concepts matched
 */

.classified-chyron {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.chyron-inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 100vw;
    overflow: hidden;
}

/* Brand section with label and subtitle */
.chyron-brand {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 16px;
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    height: 100%;
    border-right: 1px solid rgba(0,0,0,0.2);
}

.chyron-label {
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.chyron-subtitle {
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.9;
    line-height: 1;
    margin-top: 2px;
}

/* Scroll area */
.chyron-scroll {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent 0%, black 1%, black 99%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 1%, black 99%, transparent 100%);
}

/* When legend is hidden, expand scroll area more */
.classified-chyron.no-legend .chyron-scroll {
    flex: 1 1 auto;
    margin-right: 8px;
}

.chyron-content {
    display: inline-flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    will-change: transform;
    padding-left: 20px;
}

/* Empty state */
.chyron-empty {
    color: #94a3b8;
    font-style: italic;
    padding: 0 20px;
}

/* Individual news item */
.chyron-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 32px;
    padding: 4px 0;
}

/* Concept badges - color coded */
.concept-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.concept-badge:hover {
    filter: brightness(1.1);
    cursor: help;
}

/* Time badge */
.chyron-time-badge {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.chyron-time-badge.hot {
    background: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

/* Feed name */
.chyron-feed {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: #cbd5e1;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Article title link */
.chyron-title {
    color: white;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.chyron-title:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Separator between items */
.chyron-separator {
    color: rgba(255,255,255,0.15);
    margin-right: 32px;
    font-weight: 300;
    font-size: 16px;
}

/* Meta section (legend + time) */
.chyron-meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-left: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    height: 100%;
}

/* Concept legend */
.chyron-concept-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: #94a3b8;
    max-width: 400px;
    overflow: hidden;
    flex-wrap: wrap;
    justify-content: flex-end;
    line-height: 1.4;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Update time */
.chyron-time {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

/* Filtered state */
.chyron-content.filtered .chyron-item:not(.matching-filter) {
    opacity: 0.3;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .classified-chyron {
        height: 40px;
        font-size: 12px;
    }
    
    .chyron-brand {
        padding: 0 10px;
    }
    
    .chyron-label {
        font-size: 11px;
    }
    
    .chyron-subtitle {
        display: none;
    }
    
    .concept-badge {
        padding: 1px 4px;
        font-size: 8px;
    }
    
    .chyron-feed {
        display: none;
    }
    
    .chyron-meta {
        padding: 0 8px;
    }
    
    .chyron-concept-legend {
        display: none;
    }
}

/* Compact mode variant */
.classified-chyron.compact {
    height: 36px;
    font-size: 13px;
}

.classified-chyron.compact .chyron-brand {
    padding: 0 10px;
}

.classified-chyron.compact .concept-badge {
    padding: 1px 6px;
    font-size: 9px;
}

/* Position variants */
.classified-chyron.top {
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}

/* Hover pause effect */
.classified-chyron:hover .chyron-content {
    animation-play-state: paused;
}

/* Dark mode (already dark, but for consistency) */
@media (prefers-color-scheme: light) {
    .classified-chyron {
        background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
        color: #1e293b;
        border-top-color: rgba(0,0,0,0.1);
    }
    
    .chyron-title {
        color: #1e293b;
    }
    
    .chyron-title:hover {
        color: #2563eb;
    }
    
    .chyron-time-badge {
        background: rgba(0,0,0,0.1);
        color: #64748b;
    }
    
    .chyron-feed {
        background: rgba(0,0,0,0.05);
        color: #475569;
    }
    
    .chyron-separator {
        color: rgba(0,0,0,0.15);
    }
}
