/* ===================================================================
   Kriptoen News Ticker — Frontend
   =================================================================== */

/* ── CSS varijable (prepisuju se inline stilom iz PHP-a) ─────── */
:root {
  --kt-bar-bg: #ffffff;
  --kt-bar-height: 50px;
  --kt-bar-text: #333333;
  --kt-bar-hover: #c80000;
  --kt-label-bg: #dddddd;
  --kt-label-color: #333333;
  --kt-dot-color: #c80000;
  --kt-glow-color: #f7931a;
}

/* ── Traka ───────────────────────────────────────────────────── */
.kriptoen-ticker-bar {
  display: flex;
  align-items: stretch;
  background: var(--kt-bar-bg);
  height: var(--kt-bar-height);
  width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 9990;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Label ───────────────────────────────────────────────────── */
.kriptoen-ticker-label {
  background: var(--kt-label-bg);
  color: var(--kt-label-color);
  display: flex;
  align-items: center;
  padding: 10px 0 10px 35px;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  min-width: 120px;
}

/* Kosy desni rub — identičan originalnoj temi */
.kriptoen-ticker-label::after {
  content: "";
  position: absolute;
  top: 0;
  right: -19%;
  width: 39%;
  height: 100%;
  background: var(--kt-label-bg);
  transform: skew(20deg);
  z-index: -1;
}

/* ── Overflow kontejner (klipping) ─────────────────────────── */
.kriptoen-ticker-overflow {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
}

/* ── Animacijska traka ──────────────────────────────────────── */
.kriptoen-ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  /* JS kontrolira animaciju - početna pozicija */
  transform: translateX(0);
}

/* ── Jedna stavka ───────────────────────────────────────────── */
.kriptoen-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Link ────────────────────────────────────────────────────── */
.kriptoen-ticker-link {
  color: var(--kt-bar-text) !important;
  text-decoration: none !important;
  font-size: 0.83rem;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}
.kriptoen-ticker-link:hover {
  color: var(--kt-bar-hover) !important;
  text-decoration: underline !important;
}

/* ── Separator ───────────────────────────────────────────────── */
.kriptoen-ticker-sep {
  color: rgba(255, 255, 255, 0.25);
  margin: 0 4px;
  font-size: 0.75rem;
}

/* ── Badge-ovi ───────────────────────────────────────────────── */
.kt-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.kt-badge-breaking {
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: 1px solid rgba(239, 68, 68, 0.8);
}
.kt-badge-breaking.kt-blink {
  animation: kt-badge-blink 1s ease-in-out infinite;
}
@keyframes kt-badge-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.kt-badge-editor {
  background: rgba(234, 179, 8, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.kt-badge-popular {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.kt-badge-product {
  background: rgba(14, 165, 233, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

/* ── Kategorija badge ────────────────────────────────────────── */
.kt-cat-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Glow efekti na posebnim stavkama ────────────────────────── */
.kt-editors-pick .kriptoen-ticker-link {
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.7);
  color: #fde68a !important;
}
.kt-editors-pick .kriptoen-ticker-link:hover {
  color: #fbbf24 !important;
}

.kt-popular .kriptoen-ticker-link {
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.7);
  color: #d8b4fe !important;
}
.kt-popular .kriptoen-ticker-link:hover {
  color: #c084fc !important;
}

.kt-breaking .kriptoen-ticker-link {
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  color: #fca5a5 !important;
}
.kt-breaking {
  animation: kt-breaking-pulse 2s ease-in-out infinite;
}
@keyframes kt-breaking-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.kt-product .kriptoen-ticker-link {
  color: #7dd3fc !important;
}

.kt-ai .kriptoen-ticker-link {
  color: #86efac !important;
}

/* ── Thumbnail ───────────────────────────────────────────────── */
.kt-thumb {
  width: 24px;
  height: 24px;
  object-fit: cover;
  vertical-align: middle;
  flex-shrink: 0;
}
.kt-thumb-rounded {
  border-radius: 50%;
}

/* ── Paused state ────────────────────────────────────────────── */
.kriptoen-ticker-bar.kt-paused .kriptoen-ticker-track {
  animation-play-state: paused;
}

/* ── Skrivanje tema tickera ──────────────────────────────────── */
/* (dodan dinamički u PHP inline CSS samo kad je ticker aktivan) */

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .kriptoen-ticker-label {
    font-size: 0.7rem;
    padding: 0 14px 0 10px;
    padding-right: 22px;
  }
  .kriptoen-ticker-link {
    font-size: 0.78rem;
  }
}

/* ===================================================================
   PULSIRAJU TOČKA — identična originalnoj temi
   =================================================================== */
.kt-dot {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
}
.kt-dot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--kt-dot-color);
}
.kt-dot-ring-a {
  animation: kt-dot-a 2s ease-out infinite;
}
.kt-dot-ring-b {
  animation: kt-dot-b 2s ease-out infinite;
  animation-delay: 1s;
}
@keyframes kt-dot-a {
  0% {
    transform: scale(1, 1);
    opacity: 1;
  }
  100% {
    transform: scale(3, 3);
    opacity: 0;
  }
}
@keyframes kt-dot-b {
  0% {
    transform: scale(1, 1);
    opacity: 1;
  }
  100% {
    transform: scale(3, 3);
    opacity: 0;
  }
}

/* ===================================================================
   FADE OVERLAY — desni rub (identičan originalnoj temi)
   =================================================================== */
.kt-fade-overlay {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0),
    var(--kt-bar-bg)
  );
  pointer-events: none;
  z-index: 10;
}

/* ===================================================================
   MODE: TYPEWRITER
   =================================================================== */
.kt-typewriter-text {
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: 20px;
  overflow: hidden;
  white-space: nowrap;
}
.kt-typewriter-text .kriptoen-ticker-link {
  font-size: 0.9rem;
  font-weight: 600;
}
.kt-tw-cursor {
  display: inline-block;
  color: var(--kt-bar-hover);
  font-weight: 400;
  animation: kt-cursor-blink 0.7s step-start infinite;
  margin-left: 1px;
}
@keyframes kt-cursor-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ===================================================================
   MODE: FADE
   =================================================================== */
.kt-fade-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: 20px;
  overflow: hidden;
  white-space: nowrap;
}
.kt-fade-item {
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
}

/* ===================================================================
   MODE: BLINK (scroll + flash)
   =================================================================== */
@keyframes kt-blink-flash {
  0% {
    opacity: 1;
  }
  25% {
    opacity: 0.1;
  }
  50% {
    opacity: 1;
  }
  75% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}
.kt-blink-flash {
  animation: kt-blink-flash 0.6s ease-in-out !important;
}

/* ===================================================================
   MODE: GLOW SCROLL — lijepi golden glow efekt
   =================================================================== */
.kt-mode-glow_scroll .kriptoen-ticker-link {
  transition: text-shadow 0.1s ease;
}
.kt-mode-glow_scroll .kriptoen-ticker-bar {
  border-top: 1px solid rgba(247, 147, 26, 0.2);
  border-bottom: 1px solid rgba(247, 147, 26, 0.2);
}

/* ===================================================================
   Separator — tamnija boja za light temu
   =================================================================== */
.kriptoen-ticker-sep {
  color: rgba(0, 0, 0, 0.2);
}
