/* Enhanced Critical News Ticker Animation System */

/* Core Animation Keyframes */
@-webkit-keyframes ticker-scroll {
    0% { 
        transform: translateX(100%); 
        -webkit-transform: translateX(100%); 
    }
    100% { 
        transform: translateX(-100%); 
        -webkit-transform: translateX(-100%); 
    }
}

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

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 5px #FFD700;
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 15px #FFD700, 0 0 25px rgba(255, 215, 0, 0.3);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    60% {
        opacity: 1;
        transform: scale(1.05) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Critical News Ticker Container */
.tcl-critical-ticker {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff6b35 100%);
    color: white;
    padding: 0.75rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
    border-bottom: 3px solid #e55a2b;
    animation: fadeInUp 0.6s ease-out;
}

.tcl-critical-ticker::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

/* Ticker Content */
.tcl-ticker-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.tcl-ticker-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-right: 1rem;
    animation: slideInFromLeft 0.8s ease-out;
}

.tcl-ticker-label i {
    color: #FFD700;
    animation: iconPulse 2s infinite;
}

/* Ticker List */
.tcl-ticker-list {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 1.5rem;
    display: flex;
    align-items: center;
}

.tcl-ticker-item {
    white-space: nowrap;
    padding: 0 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(50px);
    animation: slideInFromRight 0.6s ease-out forwards;
    animation-delay: 0.3s;
}

.tcl-ticker-item.active {
    opacity: 1;
    transform: translateX(0);
}

/* Ticker Controls */
.tcl-ticker-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.tcl-ticker-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
}

.tcl-ticker-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.tcl-ticker-btn:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

.tcl-ticker-btn.active {
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
    animation: pulseGlow 2s infinite;
}

/* View All Link */
.tcl-ticker-viewall {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    margin-left: 1rem;
    white-space: nowrap;
    animation: bounceIn 0.8s ease-out;
    animation-delay: 0.5s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.tcl-ticker-viewall:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tcl-ticker-viewall:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tcl-ticker-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
    
    .tcl-ticker-label {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .tcl-ticker-controls {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .tcl-ticker-viewall {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .tcl-critical-ticker {
        padding: 0.5rem 0;
    }
    
    .tcl-ticker-label {
        font-size: 0.8rem;
    }
    
    .tcl-ticker-item {
        font-size: 0.85rem;
    }
    
    .tcl-ticker-viewall {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: more) {
    .tcl-critical-ticker {
        background: #000;
        border-bottom: 3px solid #fff;
    }
    
    .tcl-ticker-btn {
        background: #fff;
        color: #000;
        border-color: #000;
    }
    
    .tcl-ticker-viewall {
        background: #fff;
        color: #000;
        border-color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .tcl-critical-ticker::before {
        animation: none;
    }
    
    .tcl-ticker-label i {
        animation: none;
    }
    
    .tcl-ticker-item {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .tcl-ticker-btn:hover {
        transform: none;
    }
    
    .tcl-ticker-viewall {
        animation: none;
        opacity: 1;
    }
    
    .tcl-ticker-viewall:hover {
        transform: none;
    }
    
    .tcl-ticker-btn.active {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .tcl-critical-ticker {
        display: none;
    }
}

/* Animation control classes */
.tcl-ticker-list.tcl-animate {
    animation: ticker-scroll var(--scroll-duration, 30s) linear infinite;
}

.tcl-ticker-list.tcl-paused {
    animation-play-state: paused !important;
    -webkit-animation-play-state: paused !important;
}

/* Dynamic styles for specific ticker instances */
.tcl-ticker-list.tcl-paused {
    animation-play-state: paused !important;
    -webkit-animation-play-state: paused !important;
} 