/* ===============================================
   NEWS TICKER STYLES
   Бегущая строка новостей
   =============================================== */

.news-ticker {
  background: #142da1;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 0;
  overflow: hidden;
  width: 100%;
  z-index: calc(var(--z-fixed) + 2);
  height: 44px;
  position: relative;
  will-change: auto;
}

/* Сдвигаем main content вниз на высоту news ticker */
body:has(.news-ticker) .main-content {
  padding-top: calc(var(--header-height) + 44px);
}

.news-ticker-container {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 0 20px;
}

.news-ticker-label {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.news-ticker-label::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #37bed3;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.news-ticker-label-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #37bed3;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.news-ticker-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  backface-visibility: hidden;
}

.news-ticker-scroll {
  display: flex;
  gap: 60px;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  --scroll-distance: -100%;
}

.news-ticker-item {
  white-space: nowrap;
  font-size: 0.95rem;
  color: var(--color-light);
  font-weight: 400;
  padding: 0 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.news-ticker-item::before {
  content: '•';
  margin-right: 15px;
  color: #37bed3;
  font-weight: 700;
}

/* Градиент для плавного исчезновения текста по краям */
.news-ticker-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  background: linear-gradient(90deg, rgb(20, 45, 161), transparent);
  z-index: 1;
  pointer-events: none;
}

.news-ticker-content::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  background: linear-gradient(270deg, rgb(20, 45, 161), transparent);
  z-index: 1;
  pointer-events: none;
}

/* Анимация прокрутки - infinite без видимого скачка */
@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--scroll-distance, -100%));
  }
}

/* Responsive */
@media (max-width: 768px) {
  .news-ticker {
    padding: 6px 0;
    height: 38px;
  }
  
  body:has(.news-ticker) .main-content {
    padding-top: calc(var(--header-height) + 38px);
  }

  .news-ticker-container {
    padding: 0 15px;
    gap: 30px;
  }

  .news-ticker-label-text {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
  }

  .news-ticker-item {
    font-size: 0.85rem;
    padding: 0 15px;
  }

  .news-ticker-content::before,
  .news-ticker-content::after {
    width: 30px;
  }
}

@media (max-width: 480px) {
  .news-ticker {
    padding: 4px 0;
    height: 34px;
  }
  
  body:has(.news-ticker) .main-content {
    padding-top: calc(var(--header-height) + 34px);
  }

  .news-ticker-container {
    padding: 0 10px;
    gap: 20px;
  }

  .news-ticker-label-text {
    font-size: 0.7rem;
  }

  .news-ticker-item {
    font-size: 0.8rem;
    padding: 0 10px;
  }
}

/* Скрытие тикера если отключен */
.news-ticker.disabled {
  display: none;
}
