/* ========================================
   जनताको मूल्याङ्कन — People's Assessment
   Theme aligned with Pratipakchya main page
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800;900&family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Devanagari:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Same warm paper palette as main page */
  --bg-white: #FEFCF8;
  --bg-snow: #FAF7F2;
  --bg-ghost: #F3EFE8;
  --bg-mist: #ECE8E0;

  /* Text — same as main */
  --text-ink: #1A1A1A;
  --text-charcoal: #333333;
  --text-slate: #666666;
  --text-muted: #999999;
  --text-light: #BBBBBB;

  /* Nepal Accents */
  --nepal-red: #DC143C;
  --nepal-blue: #003893;
  --nepal-red-soft: rgba(220, 20, 60, 0.08);
  --nepal-blue-soft: rgba(0, 56, 147, 0.06);

  /* Vote colors */
  --up-color: #10B981;
  --up-bg: rgba(16, 185, 129, 0.08);
  --up-border: rgba(16, 185, 129, 0.3);
  --down-color: #EF4444;
  --down-bg: rgba(239, 68, 68, 0.08);
  --down-border: rgba(239, 68, 68, 0.3);

  /* Typography — same as main */
  --font-primary: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
  --font-nepali: 'Noto Sans Devanagari', 'Inter', sans-serif;
  --font-headline: 'Playfair Display', 'Noto Sans Devanagari', Georgia, serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-nepali);
  background: var(--bg-white);
  color: var(--text-ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* === HEADER === */
.mulyankan-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--bg-mist);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(254, 252, 248, 0.92);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-link {
  color: var(--text-slate);
  text-decoration: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-mist);
  transition: all 0.2s;
  font-family: var(--font-primary);
}

.back-link:hover {
  color: var(--nepal-red);
  border-color: var(--nepal-red);
  background: var(--nepal-red-soft);
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--nepal-red);
  font-family: var(--font-nepali);
}

.lang-toggle {
  background: var(--bg-snow);
  border: 1px solid var(--bg-mist);
  color: var(--text-slate);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-primary);
  transition: all 0.2s;
}

.lang-toggle:hover {
  border-color: var(--nepal-blue);
  color: var(--nepal-blue);
}

/* === HERO === */
.mulyankan-hero {
  text-align: center;
  padding: 50px 20px 36px;
  background: linear-gradient(180deg, var(--bg-snow) 0%, var(--bg-white) 100%);
  border-bottom: 1px solid var(--bg-ghost);
}

.hero-emoji {
  font-size: 42px;
  margin-bottom: 12px;
  display: block;
}

.hero-title {
  font-size: 34px;
  font-weight: 900;
  font-family: var(--font-headline);
  color: var(--text-ink);
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-slate);
  max-width: 550px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.hero-question {
  display: inline-block;
  background: var(--bg-white);
  border: 1px solid var(--bg-mist);
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 14px;
  color: var(--text-charcoal);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* === STATS BAR === */
.stats-bar {
  max-width: 900px;
  margin: -20px auto 28px;
  padding: 0 20px;
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 10;
}

.stat-pill {
  background: var(--bg-white);
  border: 1px solid var(--bg-mist);
  padding: 14px 18px;
  border-radius: var(--radius);
  flex: 1;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-pill-number {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-primary);
  color: var(--text-ink);
}

.stat-pill-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-pill.up .stat-pill-number { color: var(--up-color); }
.stat-pill.down .stat-pill-number { color: var(--down-color); }

/* === ACTIVITY FEED === */
.feed-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.feed-count {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-primary);
}

/* === ACTIVITY CARD === */
.activity-card {
  background: var(--bg-white);
  border: 1px solid var(--bg-mist);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.activity-card:hover {
  border-color: #d0cdc5;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Card meta row */
.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 0;
  font-size: 13px;
}

.card-date {
  color: var(--text-muted);
  font-family: var(--font-primary);
  font-size: 12px;
}

.card-category-badge {
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.card-linked-promise {
  margin-left: auto;
  font-size: 11px;
  color: var(--nepal-blue);
  cursor: pointer;
  font-family: var(--font-primary);
  text-decoration: none;
  font-weight: 500;
}

.card-linked-promise:hover {
  text-decoration: underline;
  color: var(--nepal-red);
}

/* Card body */
.card-body {
  padding: 10px 18px 14px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 6px;
  color: var(--text-ink);
}

.card-description {
  font-size: 14px;
  color: var(--text-slate);
  line-height: 1.7;
  margin-bottom: 10px;
}

.card-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--nepal-blue);
  text-decoration: none;
  transition: color 0.2s;
  font-family: var(--font-primary);
  font-weight: 500;
}

.card-source:hover {
  color: var(--nepal-red);
  text-decoration: underline;
}

.card-source::before {
  content: "📰";
}

/* === VOTE SECTION === */
.card-vote {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--bg-ghost);
  background: var(--bg-snow);
}

.vote-question {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: auto;
  flex-shrink: 1;
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-mist);
  background: var(--bg-white);
  color: var(--text-slate);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-nepali);
  font-weight: 500;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.vote-btn:hover:not(.voted):not(.disabled) {
  transform: scale(1.03);
}

.vote-btn.up:hover:not(.voted):not(.disabled) {
  border-color: var(--up-color);
  color: var(--up-color);
  background: var(--up-bg);
}

.vote-btn.down:hover:not(.voted):not(.disabled) {
  border-color: var(--down-color);
  color: var(--down-color);
  background: var(--down-bg);
}

/* Voted state */
.vote-btn.up.voted {
  border-color: var(--up-border);
  color: var(--up-color);
  background: var(--up-bg);
  font-weight: 700;
}

.vote-btn.down.voted {
  border-color: var(--down-border);
  color: var(--down-color);
  background: var(--down-bg);
  font-weight: 700;
}

.vote-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.vote-btn .vote-count {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 13px;
  min-width: 18px;
  text-align: center;
}

/* Vote result bar */
.vote-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 12px;
  background: var(--bg-snow);
}

.vote-bar-container {
  flex: 1;
  height: 6px;
  background: var(--bg-mist);
  border-radius: 3px;
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--up-color), #34d399);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
}

.vote-pct {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-primary);
  min-width: 50px;
  text-align: right;
}

.vote-pct.positive { color: var(--up-color); }
.vote-pct.negative { color: var(--down-color); }
.vote-pct.neutral { color: var(--text-muted); }

.vote-total {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-primary);
}

/* === PROCESSING OVERLAY === */
.vote-processing {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--nepal-red);
}

.vote-processing.active { display: flex; }

.vote-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--nepal-red);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === FOOTER === */
.mulyankan-footer {
  text-align: center;
  padding: 36px 20px;
  border-top: 1px solid var(--bg-mist);
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-snow);
}

.mulyankan-footer a {
  color: var(--nepal-red);
  text-decoration: none;
  font-weight: 500;
}

.mulyankan-footer a:hover { text-decoration: underline; }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .hero-title { font-size: 24px; }
  .hero-subtitle { font-size: 14px; }
  .stats-bar { flex-wrap: wrap; margin-top: -12px; }
  .stat-pill { flex: 1 1 45%; }

  .card-vote {
    flex-wrap: wrap;
    gap: 8px;
  }
  .vote-question {
    width: 100%;
    margin-right: 0;
    margin-bottom: 4px;
  }
  .vote-btn { flex: 1; justify-content: center; }

  .header-title { font-size: 14px; }
  .card-title { font-size: 15px; }
  .card-description { font-size: 13px; }
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-white);
  border: 1px solid var(--bg-mist);
  color: var(--text-ink);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error { border-color: var(--down-color); }
.toast.success { border-color: var(--up-color); }

/* === POW INDICATOR === */
.pow-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 18px 10px;
  background: var(--bg-snow);
}

.pow-indicator.active { display: flex; }
