/* =============================================
   Tamil Nadu Election Countdown 2026
   style.css — Main Stylesheet
   Theme: Premium Political + Digital Neon
   ============================================= */

/* --- CSS Variables --- */
:root {
  --primary:    #0d0101;
  --secondary:  #FFFFFF;
  --accent:     #FFD700;
  --accent-dim: rgba(255, 215, 0, 0.4);
  --black:      #000000;
  --glass-bg:   rgba(0, 0, 0, 0.60);
  --glass-border: rgba(255, 215, 0, 0.35);
  --neon-glow:  0 0 12px #FFD700, 0 0 28px #FFD700, 0 0 55px rgba(255,215,0,0.5);
  --ticker-h:   60px;
  --font-tamil: 'Noto Sans Tamil', sans-serif;
  --font-timer: 'Orbitron', monospace;
  --font-body:  'Poppins', sans-serif;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;           /* No scroll — fixed TV layout */
  font-family: var(--font-body);
  background: #0a0000;
  color: var(--secondary);
}

/* =============================================
   BACKGROUND — Temple image + gradient overlay
   ============================================= */
.bg-wrapper {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.7) brightness(0.45);
}

/* Deep gradient overlay — darkens edges, keeps center readable */
.bg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%,
      rgba(82, 16, 16, 0.55) 0%,
      rgba(0, 0, 0, 0.80) 100%),
    linear-gradient(180deg,
      rgba(0,0,0,0.70) 0%,
      rgba(82,16,16,0.30) 45%,
      rgba(0,0,0,0.90) 100%);
}

/* Decorative grid lines for "digital" feel */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,215,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,215,0,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* =============================================
   MAIN PAGE WRAPPER
   ============================================= */
#page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding-bottom: var(--ticker-h);   /* Clear the fixed ticker */
  padding-top: 20px;
  gap: 0;

  /* Page load animation */
  animation: pageReveal 1.2s ease forwards;
}

@keyframes pageReveal {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* =============================================
   LOGO
   ============================================= */
.logo-wrap {
  margin-bottom: 18px;
  animation: fadeDown 0.9s 0.2s ease both;
}

.site-logo {
  height: 90px;
  width: auto;
  filter: drop-shadow(0 0 18px rgba(255,215,0,0.6));
  transition: transform var(--transition), filter var(--transition);
}

.site-logo:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 30px rgba(255,215,0,0.9));
}

/* Fallback text logo when image missing */
.logo-text-fallback {
  font-family: var(--font-timer);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-shadow: var(--neon-glow);
}

/* =============================================
   QUOTE
   ============================================= */
.quote-line {
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  font-weight: 300;
  color: rgba(255,255,255,0.70);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  animation: fadeDown 0.9s 0.35s ease both;
}

.quote-line i {
  color: var(--accent);
  font-size: 0.75rem;
  vertical-align: middle;
  margin: 0 6px;
}

/* =============================================
   MAIN HEADING (Tamil)
   ============================================= */
.main-heading {
  font-family: var(--font-tamil);
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 900;
  color: var(--accent);
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 10px rgba(255,215,0,0.6),
    0 0 30px rgba(255,215,0,0.3),
    2px 2px 0px rgba(82,16,16,0.8);
  margin-bottom: 8px;
  animation: fadeDown 0.9s 0.5s ease both;
}

.sub-heading {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.2vw, 1.1rem);
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 32px;
  animation: fadeDown 0.9s 0.65s ease both;
}

/* =============================================
   COUNTDOWN CARD — Glassmorphism wrapper
   ============================================= */
.countdown-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 36px 50px;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow:
    0 8px 40px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,215,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.08);
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: center;

  animation: fadeUp 1s 0.8s ease both;
  transition: box-shadow var(--transition);
}

.countdown-card:hover {
  box-shadow:
    0 12px 60px rgba(0,0,0,0.8),
    0 0 0 1px rgba(255,215,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

/* Separator dots between boxes */
.timer-sep {
  font-family: var(--font-timer);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: var(--neon-glow);
  line-height: 1;
  padding-bottom: 28px; /* Align with digit, not label */
  animation: sepBlink 1.2s step-start infinite;
  user-select: none;
}

@keyframes sepBlink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

/* =============================================
   INDIVIDUAL TIMER BOX
   ============================================= */
.timer-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.timer-digit-wrap {
  background: #050505;
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 18px 28px;
  width: 150px;
  text-align: center;
  box-shadow:
    0 0 18px rgba(255,215,0,0.4),
    0 0 4px rgba(255,215,0,0.9) inset,
    0 4px 20px rgba(0,0,0,0.8);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition);

  /* Glow pulse animation */
  animation: glowPulse 2.5s ease-in-out infinite;
}

.timer-digit-wrap::before {
  /* Top reflective highlight */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,215,0,0.07) 0%, transparent 100%);
  border-radius: 14px 14px 0 0;
  pointer-events: none;
}

/* Flip animation trigger class (added via JS) */
.timer-digit-wrap.flip .timer-digit {
  animation: digitFlip 0.35s ease;
}

@keyframes digitFlip {
  0%   { transform: translateY(-12px); opacity: 0.3; }
  60%  { transform: translateY(4px);   opacity: 1; }
  100% { transform: translateY(0);     opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow:
      0 0 18px rgba(255,215,0,0.4),
      0 0 4px rgba(255,215,0,0.9) inset,
      0 4px 20px rgba(0,0,0,0.8);
  }
  50% {
    box-shadow:
      0 0 35px rgba(255,215,0,0.7),
      0 0 8px rgba(255,215,0,1) inset,
      0 4px 24px rgba(0,0,0,0.9);
  }
}

.timer-digit {
  font-family: var(--font-timer);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 700;
  color: var(--accent);
  text-shadow: var(--neon-glow);
  line-height: 1;
  display: block;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.timer-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.18em;
  line-height: 1.5;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
}

.timer-label .label-tamil {
  display: block;
  font-family: var(--font-tamil);
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,215,0,0.85);
  letter-spacing: 0.05em;
  text-transform: none;
}

/* =============================================
   ELECTION DATE BADGE
   ============================================= */
.date-badge {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(82,16,16,0.55);
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 50px;
  padding: 8px 26px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(82,16,16,0.6);

  animation: fadeUp 1s 1s ease both;
}

.date-badge i {
  font-size: 1rem;
  color: var(--accent);
}

/* =============================================
   NEWS TICKER — Fixed bottom bar
   ============================================= */
.news-ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--ticker-h);
  background: #000000;
  border-top: 2px solid var(--accent);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 -4px 24px rgba(255,215,0,0.2);
}

/* Ticker label badge */
.ticker-label {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  background: var(--primary);
  border-right: 2px solid var(--accent);
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-label i {
  font-size: 1rem;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Scrolling ticker track */
.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  /* JS controls animation via CSS custom property */
  animation: tickerScroll linear infinite;
  animation-duration: var(--ticker-duration, 45s);
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }  /* -50% because we duplicate content */
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 36px;
  font-family: var(--font-tamil), var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.ticker-item .ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent);
}

/* =============================================
   KEYFRAMES — Generic
   ============================================= */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   ELECTION OVER STATE
   ============================================= */
.election-over-msg {
  font-family: var(--font-timer);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 900;
  color: var(--accent);
  text-shadow: var(--neon-glow);
  text-align: center;
  letter-spacing: 0.1em;
  animation: glowPulse 2s ease-in-out infinite;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* 1440px and below */
@media (max-width: 1440px) {
  .countdown-card { padding: 30px 38px; gap: 20px; }
  .timer-digit-wrap { min-width: 95px; padding: 14px 22px; }
}

/* 1024px and below */
@media (max-width: 1024px) {
  .main-heading { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
  .countdown-card { padding: 26px 28px; gap: 16px; }
  .timer-digit-wrap { min-width: 82px; padding: 12px 18px; }
  .timer-sep { font-size: 2rem; }
  .site-logo { height: 72px; }
}

/* 768px and below — Stack vertically */
@media (max-width: 768px) {
  html, body { overflow-y: auto; }
  #page-wrapper {
    height: auto;
    min-height: 100vh;
    padding: 30px 16px calc(var(--ticker-h) + 20px);
    justify-content: flex-start;
  }
  .countdown-card {
    flex-wrap: wrap;
    gap: 14px;
    padding: 24px 18px;
    justify-content: center;
  }
  .timer-sep { display: none; }          /* Hide colons on small screens */
  .timer-digit-wrap { min-width: 76px; }
  .main-heading { font-size: clamp(1.5rem, 6vw, 2.2rem); }
  .ticker-item { font-size: 0.9rem; padding: 0 24px; }
}