:root {
    --primary: #2a7de1;
    --secondary: #4caf50;
}

.top-bar * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.top-bar {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 8px 0;
    font-size: 14px;
    text-align: center;
    transform: translateY(-100%);
    animation: slideDownInfo 0.8s ease forwards 0.1s;
/*    position: sticky;   */
    top: 0;
    z-index: 1001;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

@keyframes slideDownInfo {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

.ticker-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.left-section {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 15px;
    white-space: nowrap;
    flex-shrink: 0;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
    to { box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); }
}

.live-indicator .pulse {
    width: 8px;
    height: 8px;
    background-color: #ff4444;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.2);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

.ticker-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    height: 22px;
    min-width: 0;
}

.ticker-content {
    position: absolute;
    white-space: nowrap;
    display: flex;
    align-items: center;
    animation: ticker-scroll 120s linear infinite;
}

@keyframes ticker-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.news-item {
    display: inline-flex;
    align-items: center;
    margin-right: 30px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.news-item:hover {
    transform: translateY(-2px);
}

.source-label {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.7rem;
    margin-right: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.source-label:hover {
    transform: scale(1.05);
}

.bbc-label {
    background-color: rgba(187, 25, 25, 0.8);
}

.cnn-label {
    background-color: rgba(204, 0, 0, 0.8);
}

.who-label {
    background-color: rgba(0, 147, 213, 0.8);
}

.news-text {
    color: #f0f0f0;
    white-space: nowrap;
}

.breaking-tag {
    color: #ffcc00;
    font-weight: 700;
    margin-right: 5px;
    font-size: 0.8rem;
    animation: blink 2s infinite;
    flex-shrink: 0;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

.separator {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 8px;
    flex-shrink: 0;
}

.right-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.news-source-logos {
    display: flex;
    align-items: center;
    gap: 15px;
}

.source-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0.9;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 24px;
    padding: 0 8px;
    border-radius: 3px;
    flex-shrink: 0;
}

.source-logo:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
}

.bbc-logo {
    background-color: #BB1919;
    color: white;
    font-family: 'Helvetica', sans-serif;
    font-weight: bold;
}

.cnn-logo {
    background-color: #CC0000;
    color: white;
    font-family: 'Helvetica', sans-serif;
    font-weight: bold;
}

.who-logo {
    background-color: #0093D5;
    color: white;
    font-family: 'Helvetica', sans-serif;
    font-weight: bold;
}

.datetime-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.75rem;
    color: #e0e0e0;
    flex-shrink: 0;
}

.date-display {
    font-weight: 500;
}

.time-display {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #fff;
}

.update-indicator {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 0 0 0 4px;
    font-size: 0.7rem;
    color: #ffcc00;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 10;
}

.update-indicator.show {
    opacity: 1;
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ticker-container {
        padding: 0 15px;
    }
}

@media (max-width: 992px) {
    .news-item {
        font-size: 0.85rem;
    }
    
    .news-text {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 768px) {
    .ticker-container {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .left-section {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .live-indicator {
        margin-right: 10px;
    }
    
    .ticker-wrapper {
        width: 100%;
    }
    
    .right-section {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        align-self: center;
        flex-direction: row;
        gap: 15px;
        justify-content: space-between;
        width: 100%;
    }
    
    .news-source-logos {
        gap: 10px;
    }
    
    .news-item {
        font-size: 0.8rem;
    }
    
    .news-text {
        max-width: 150px;
    }
}

@media (max-width: 576px) {
    .ticker-container {
        padding: 0 10px;
        gap: 8px;
    }
    
    .left-section {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .live-indicator {
        align-self: flex-start;
        margin-right: 0;
    }
    
    .ticker-wrapper {
        height: 40px;
        width: 100%;
    }
    
    .ticker-content {
        flex-wrap: wrap;
        height: 40px;
        align-content: center;
    }
    
    .news-item {
        margin-right: 15px;
        font-size: 0.75rem;
    }
    
    .news-text {
        max-width: 120px;
    }
    
    .separator {
        margin: 0 4px;
    }
    
    .right-section {
        flex-direction: column;
        gap: 8px;
    }
    
    .news-source-logos {
        justify-content: center;
        width: 100%;
    }
    
    .datetime-display {
        align-items: center;
    }
    
    .source-logo {
        font-size: 0.8rem;
        height: 20px;
        padding: 0 6px;
    }
    
    .datetime-display {
        font-size: 0.7rem;
    }
}

@media (max-width: 400px) {
    .news-item {
        font-size: 0.7rem;
        margin-right: 10px;
    }
    
    .news-text {
        max-width: 100px;
    }
    
    .separator {
        margin: 0 3px;
    }
    
    .source-label {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    
    .breaking-tag {
        font-size: 0.7rem;
    }
}