/* ============================================
   effects.css — Animații avansate & Efecte vizuale
   Parallax, Glitch, Stagger, Shimmer, Scanlines
   ============================================ */

/* ==========================================
   HERO BACKGROUND IMAGE SUPPORT
   ========================================== */

/* Overlay peste imaginea de fundal
   IMPORTANT: z-index sub hero-content (z-index:2) */
.hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;          /* sub content, peste imagine */
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.55)   0%,
    rgba(13,17,23,0.5) 40%,
    rgba(13,17,23,0.8) 80%,
    rgba(13,17,23,1)   100%
  );
}

/* Fundal cu imagine — JS adaugă .has-image + style inline */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg.has-image {
  /* background-image setat inline din JS */
  background-size:     cover;
  background-position: center center;
  background-repeat:   no-repeat;
  /* NU folosim background-attachment:fixed — e broken pe multe browsere */
}

/* Scanlines — z-index 2 (același cu overlay, deasupra imaginii) */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* ==========================================
   LOGO SUPPORT
   ========================================== */
.logo-img {
  height: 36px;
  width: auto;
  image-rendering: pixelated;
  object-fit: contain;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.6));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.logo-img:hover {
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.6)) brightness(1.15);
  transform: scale(1.05);
}

/* Fallback text dacă nu există logo img */
.logo-text-fallback {
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  color: var(--green-light);
  letter-spacing: 1px;
  text-shadow: var(--pixel-shadow);
}

/* ==========================================
   GLITCH EFFECT — Logo / Titlu
   ========================================== */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font: inherit;
  color: inherit;
}

.glitch::before {
  color: var(--red);
  clip-path: polygon(0 20%, 100% 20%, 100% 35%, 0 35%);
  animation: glitch-top 3s infinite steps(1);
  left: -2px;
}

.glitch::after {
  color: var(--diamond);
  clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
  animation: glitch-bot 3s infinite steps(1);
  left: 2px;
}

@keyframes glitch-top {
  0%, 90%, 100% { transform: none; opacity: 0; }
  92%           { transform: translateX(-4px); opacity: 0.8; }
  94%           { transform: translateX(4px);  opacity: 0.8; }
  96%           { transform: none; opacity: 0; }
}

@keyframes glitch-bot {
  0%, 88%, 100% { transform: none; opacity: 0; }
  90%           { transform: translateX(4px);  opacity: 0.8; }
  93%           { transform: translateX(-4px); opacity: 0.8; }
  95%           { transform: none; opacity: 0; }
}

/* ==========================================
   SECTION ENTRANCE — fade + slide
   ========================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* Stagger delays pentru grile de carduri */
.reveal-stagger > *:nth-child(1) { transition-delay: 0.0s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.3s; }

/* ==========================================
   RANK CARD SHIMMER
   ========================================== */
.rank-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.04) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  background-position: -100% 0;
  transition: background-position 0.6s ease;
  pointer-events: none;
}

.rank-card:hover::after {
  background-position: 200% 0;
}

/* ==========================================
   PIXEL BORDER ANIMATION (carduri active)
   ========================================== */
@keyframes pixel-border-march {
  0%   { background-position: 0 0, 100% 0, 100% 100%, 0 100%; }
  100% { background-position: 100% 0, 100% 100%, 0 100%, 0 0; }
}

.active-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background:
    linear-gradient(90deg,  var(--green) 50%, transparent 50%) top    / 8px 2px repeat-x,
    linear-gradient(180deg, var(--green) 50%, transparent 50%) right  / 2px 8px repeat-y,
    linear-gradient(90deg,  var(--green) 50%, transparent 50%) bottom / 8px 2px repeat-x,
    linear-gradient(180deg, var(--green) 50%, transparent 50%) left   / 2px 8px repeat-y;
  animation: pixel-border-march 1.5s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* ==========================================
   TYPEWRITER CURSOR (hero subtitle)
   ========================================== */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--green);
  width: 0;
  animation:
    typing 2s steps(40, end) 0.5s forwards,
    cursor-blink-line 0.8s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes cursor-blink-line {
  0%, 100% { border-color: var(--green); }
  50%       { border-color: transparent; }
}

/* ==========================================
   FLOATING ICONS (hero decoration)
   ========================================== */
.float-icon {
  position: absolute;
  opacity: 0.15;
  animation: float-drift ease-in-out infinite;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  font-size: 2rem;
  image-rendering: pixelated;
}

.float-icon:nth-child(1) { top: 20%; left: 5%;   animation-duration: 6s;  animation-delay: 0s;  }
.float-icon:nth-child(2) { top: 30%; right: 8%;  animation-duration: 8s;  animation-delay: -2s; }
.float-icon:nth-child(3) { top: 60%; left: 10%;  animation-duration: 7s;  animation-delay: -4s; }
.float-icon:nth-child(4) { top: 50%; right: 5%;  animation-duration: 9s;  animation-delay: -1s; }
.float-icon:nth-child(5) { top: 15%; right: 20%; animation-duration: 5s;  animation-delay: -3s; }
.float-icon:nth-child(6) { top: 70%; right: 15%; animation-duration: 10s; animation-delay: -5s; }

@keyframes float-drift {
  0%, 100% { transform: translateY(0)    rotate(0deg);  }
  33%       { transform: translateY(-20px) rotate(5deg); }
  66%       { transform: translateY(10px)  rotate(-3deg);}
}

/* ==========================================
   SVG ICON STYLES
   ========================================== */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon svg {
  display: block;
  fill: currentColor;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

/* Social icon buttons */
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.social-btn .icon svg { width: 16px; height: 16px; }

/* Nav icon support */
.nav-links li a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-links li a .icon svg { width: 12px; height: 12px; opacity: 0.7; }
.nav-links li a:hover .icon svg { opacity: 1; }

/* Feature list icons */
.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-list li .icon { color: var(--green-light); }
.feature-list li .icon svg { width: 14px; height: 14px; }

/* ==========================================
   COUNTER ANIMATION
   ========================================== */
.stat-value.counting {
  animation: count-pop 0.3s ease;
}

@keyframes count-pop {
  0%   { transform: scale(1.3); color: var(--gold); }
  100% { transform: scale(1);   color: var(--green-light); }
}

/* ==========================================
   NEON GLOW PULSE (status dot online)
   ========================================== */
.status-dot.online {
  animation: neon-pulse 2s ease-in-out infinite;
}

@keyframes neon-pulse {
  0%, 100% { box-shadow: 0 0 6px var(--green),  0 0 12px var(--green); }
  50%       { box-shadow: 0 0 10px var(--green), 0 0 20px var(--green), 0 0 30px rgba(90,175,58,0.4); }
}

/* ==========================================
   VOTE CARD HOVER GLOW
   ========================================== */
.vote-card:hover {
  box-shadow: 0 0 20px rgba(90,175,58,0.15), 4px 4px 0 var(--green-dark);
}

/* ==========================================
   PIXEL PROGRESS BAR (uptime)
   ========================================== */
.pixel-bar {
  height: 8px;
  background: var(--night-4);
  border: 1px solid var(--border);
  overflow: hidden;
  image-rendering: pixelated;
  margin-top: 0.5rem;
}

.pixel-bar-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--green) 0px, var(--green) 6px,
    var(--green-dark) 6px, var(--green-dark) 8px
  );
  transition: width 1.5s ease;
  width: 0;
}

/* ==========================================
   RESPONSIVE — effects
   ========================================== */
@media (max-width: 700px) {
  .hero-bg.has-image {
    background-attachment: scroll; /* parallax off pe mobil */
  }
  .glitch::before, .glitch::after { display: none; }
  .float-icon { display: none; }
}
