/* =========================================
   Breaking News Ticker - Urdu News Point
   RTL Optimized, Label on Right
   ========================================= */

.unp-breaking-news {
    width: 100%;
    background: var(--breaking-bg, #e74c3c);
    display: flex;
    flex-direction: row-reverse; /* RTL: Label on right, content on left */
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 999;
    min-height: 45px;
    direction: rtl;
}

/* Breaking Label (NOW ON RIGHT SIDE) */
.breaking-label {
    background: var(--label-bg, #c0392b);
    color: var(--text-color, #ffffff);
    padding: 0 20px;
    height: 45px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1); /* Shadow on left side now */
    flex-shrink: 0;
}

/* Pulse Dot Animation */
.pulse-dot {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Ticker Wrapper */
.breaking-ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 45px;
    direction: rtl; /* RTL for proper text display */
}

/* Ticker Container - SMOOTH AUTO-SCROLLING */
.breaking-ticker {
    display: inline-flex;
    align-items: center;
    gap: 40px;
    height: 100%;
    white-space: nowrap;
    animation: scroll-left-to-right var(--scroll-speed, 30s) linear infinite;
    will-change: transform;
    padding-right: 20px;
}



/* LEFT TO RIGHT Scroll Animation (Natural for Urdu) */
@keyframes scroll-left-to-right {
    -10% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Ticker Item */
.ticker-item {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 10px;
    direction: rtl;
}

.ticker-item a {
    color: var(--text-color, #ffffff);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-weight: 500;
    direction: rtl;
}

.ticker-item a:hover {
    color: var(--hover-color, #ffd700);
    transform: translateY(-1px);
}

/* News Icon */
.news-icon {
    font-size: 18px;
    animation: shake 2s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-5deg); }
    20%, 40% { transform: rotate(5deg); }
    50%, 60%, 70%, 80%, 90% { transform: rotate(0deg); }
}

/* News Title */
.news-title {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* News Time */
.news-time {
    font-size: 12px;
    opacity: 0.85;
    padding: 2px 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    font-weight: 400;
}

/* Gradient overlay for depth */
.breaking-ticker-wrapper::before,
.breaking-ticker-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 1;
    pointer-events: none;
}

.breaking-ticker-wrapper::before {
    right: 0; /* RTL: Fade from right */
    background: linear-gradient(to left, var(--breaking-bg, #e74c3c), transparent);
}

.breaking-ticker-wrapper::after {
    left: 0; /* RTL: Fade from left */
    background: linear-gradient(to right, var(--breaking-bg, #e74c3c), transparent);
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Tablet */
@media (max-width: 768px) {
    .unp-breaking-news {
        min-height: 42px;
    }

    .breaking-label {
        height: 42px;
        padding: 0 15px;
        font-size: 13px;
    }

    .breaking-ticker-wrapper {
        height: 42px;
    }

    .ticker-item a {
        font-size: 14px;
        gap: 8px;
    }

    .news-icon {
        font-size: 16px;
    }

    .news-time {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .unp-breaking-news {
        min-height: 40px;
    }

    .breaking-label {
        height: 40px;
        padding: 0 12px;
        font-size: 12px;
        gap: 6px;
    }

    .pulse-dot {
        width: 8px;
        height: 8px;
    }

    .breaking-ticker-wrapper {
        height: 40px;
    }

    .ticker-item {
        padding: 0 8px;
    }

    .ticker-item a {
        font-size: 13px;
        gap: 6px;
    }

    .news-icon {
        font-size: 14px;
    }

    .news-time {
        display: none; /* Hide time on very small screens */
    }
}

/* Hover effect on entire bar */
.unp-breaking-news:hover .breaking-label {
    background: var(--label-bg, #c0392b);
    box-shadow: -3px 0 8px rgba(0,0,0,0.2);
}

/* Focus visible for accessibility */
.ticker-item a:focus {
    outline: 2px solid var(--hover-color, #ffd700);
    outline-offset: 2px;
}

/* Print styles - hide breaking news when printing */
@media print {
    .unp-breaking-news {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .breaking-label {
        border: 2px solid currentColor;
    }
    
    .ticker-item a {
        font-weight: 700;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .breaking-ticker {
        animation-duration: 100s; /* Slower animation */
    }
    
    .pulse-dot,
    .news-icon {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .unp-breaking-news {
        box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    }
}
