/* ============================================================
   Lottery Sambad Results — Main Stylesheet
   Design: Editorial lottery board aesthetic
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --primary:      #c8102e;
  --primary-dark: #9b0d22;
  --accent:       #f5a623;
  --accent-dark:  #e09010;
  --gold:         #ffd700;
  --success:      #1a8a3c;
  --bg:           #f8f6f2;
  --bg-card:      #ffffff;
  --bg-nav:       #1a1a2e;
  --text:         #1c1c1e;
  --text-muted:   #6b6b6b;
  --border:       #e0ddd8;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.12);
  --radius:       12px;
  --radius-sm:    8px;
  --font-display: 'Space Mono', monospace;
  --font-body:    'Tiro Devanagari Hindi', serif;
  --font-bengali: 'Noto Serif Bengali', serif;
  --transition:   all 0.25s ease;
}

[data-theme="dark"] {
  --bg:       #0f0f1a;
  --bg-card:  #1a1a2e;
  --bg-nav:   #0a0a15;
  --text:     #e8e6e3;
  --text-muted: #9999aa;
  --border:   #2e2e4a;
  --shadow:   0 2px 12px rgba(0,0,0,0.4);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ── Navbar ── */
#mainNav {
  background: var(--bg-nav) !important;
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
#mainNav .navbar-brand { color: #fff !important; font-family: var(--font-display); font-size: 1.1rem; }
#mainNav .brand-icon { font-size: 1.4rem; }
#mainNav .nav-link { color: rgba(255,255,255,0.85) !important; font-size: 0.85rem; font-family: var(--font-display); padding: 0.4rem 0.7rem !important; border-radius: var(--radius-sm); transition: var(--transition); }
#mainNav .nav-link:hover, #mainNav .nav-link.active { color: #fff !important; background: rgba(200,16,46,0.3); }

/* ── Result Ticker ── */
.ticker-wrapper {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 36px;
  font-family: var(--font-display);
  font-size: 0.78rem;
}
.ticker-label {
  background: var(--primary-dark);
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 700;
  flex-shrink: 0;
}
.ticker-content {
  display: flex;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
.ticker-item { padding: 0 8px; }
@keyframes ticker { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }

/* ── Main Content ── */
.main-content { min-height: 60vh; padding: 2rem 0; }

/* ── Section Headers ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary);
}
.section-header h2 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--text);
}
.section-badge {
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
}
.section-badge.live-badge {
  animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
  0%, 100% { background: var(--primary); box-shadow: 0 0 0 0 rgba(200,16,46,0.4); }
  50%       { background: #e01028; box-shadow: 0 0 0 6px rgba(200,16,46,0); }
}

/* ── Result Cards ── */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
}
.result-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.result-card.just-updated {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.2);
  animation: flash-update 2s ease;
}
@keyframes flash-update {
  0%   { background: rgba(200,16,46,0.1); }
  100% { background: var(--bg-card); }
}

.result-card-header {
  background: linear-gradient(135deg, var(--bg-nav), #16213e);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.result-card-header .lottery-name {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.result-card-header .time-slot {
  background: var(--accent);
  color: #000;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.result-card-body { padding: 16px; }

.prize-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prize-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.prize-row.first {
  background: linear-gradient(135deg, #fff8e7, #fff3cc);
  border: 1px solid #ffd700;
}
[data-theme="dark"] .prize-row { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .prize-row.first { background: rgba(255,215,0,0.1); border-color: rgba(255,215,0,0.3); }
.prize-label { font-family: var(--font-display); font-size: 0.7rem; color: var(--text-muted); }
.prize-number {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.1em;
}
.prize-row.first .prize-number { color: var(--primary); font-size: 1.6rem; }
.prize-row.first .prize-label { color: var(--accent-dark); font-weight: 700; }

/* ── Time Slot Tabs ── */
.slot-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.slot-tab {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: var(--transition);
}
.slot-tab:hover { background: rgba(200,16,46,0.08); color: var(--primary); }
.slot-tab.active { background: var(--primary); color: #fff; }

/* ── Empty Result Placeholder ── */
.result-pending {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
}
.result-pending .pending-icon { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.4; }
.result-pending .countdown { font-family: var(--font-display); font-size: 1.2rem; color: var(--primary); font-weight: 700; margin-top: 8px; }

/* ── Old Results Table ── */
.results-table { font-family: var(--font-display); font-size: 0.85rem; }
.results-table thead { background: var(--bg-nav); color: #fff; }
.results-table tbody tr:hover { background: rgba(200,16,46,0.04); }

/* ── Monthly Chart ── */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.chart-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}
.chart-cell:hover { border-color: var(--primary); transform: scale(1.02); }
.chart-cell .chart-date { font-size: 0.65rem; color: var(--text-muted); }
.chart-cell .chart-number { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

/* ── Search Box ── */
.search-box {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.search-box:focus-within { border-color: var(--primary); }

/* ── Footer ── */
.site-footer {
  background: var(--bg-nav);
  color: rgba(255,255,255,0.8);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-brand { color: #fff; font-family: var(--font-display); }
.footer-desc { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.footer-heading { color: var(--accent); font-family: var(--font-display); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { color: rgba(255,255,255,0.65); text-decoration: none; font-size: 0.85rem; transition: var(--transition); }
.footer-links a:hover { color: var(--accent); padding-left: 4px; }
.footer-divider { border-color: rgba(255,255,255,0.1); margin: 2rem 0 1rem; }
.footer-copyright, .footer-disclaimer { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  margin-right: 6px;
  transition: var(--transition);
}
.social-btn.telegram { background: #0088cc; }
.social-btn.facebook { background: #1877f2; }
.social-btn.whatsapp { background: #25d366; }
.social-btn:hover { transform: translateY(-2px); opacity: 0.9; color: #fff; }

/* ── Ads ── */
.ad-header { background: var(--bg); min-height: 50px; }
.ad-footer { background: var(--bg); min-height: 50px; }
.mobile-sticky-ad {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 999; background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 4px;
  min-height: 60px;
  text-align: center;
}

/* ── Hero Banner ── */
.hero-banner {
  background: linear-gradient(135deg, var(--bg-nav) 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(200,16,46,0.2) 0%, transparent 70%);
}
.hero-title { font-family: var(--font-display); font-size: clamp(1.2rem, 4vw, 2rem); margin-bottom: 0.5rem; }
.hero-subtitle { font-size: 0.9rem; color: rgba(255,255,255,0.7); }
.hero-time-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1rem; }
.time-chip {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.time-chip:hover, .time-chip.active { background: var(--primary); border-color: var(--primary); }

/* ── Loading Spinner ── */
.spinner-result {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(200,16,46,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .main-content { padding: 1rem 0; padding-bottom: 80px; }
  .result-card { margin-bottom: 1rem; }
  .hero-banner { padding: 1.2rem; }
  .hero-title { font-size: 1.1rem; }
  .section-header h2 { font-size: 1.1rem; }
  body { font-size: 15px; }
}

/* ── Bengali Font Override ── */
:lang(bn), .bn-text {
  font-family: var(--font-bengali);
}

/* ── Print ── */
@media print {
  .ad-header, .ad-footer, .mobile-sticky-ad, #mainNav, .ticker-wrapper, .site-footer { display: none !important; }
  .result-card { break-inside: avoid; }
}
