/* css/style.css
   ডিজাইন টোকেন: ইঙ্ক নেভি + পার্চমেন্ট + ব্রাস গোল্ড — একটি "রায়/ভারডিক্ট" থিম
   টাইপোগ্রাফি: Tiro Bangla (display) + Hind Siliguri (body)
   সম্পূর্ণ রিভাইজড — পরিষ্কার, রেসপনসিভ, মোবাইল+ডেস্কটপ ফ্রেন্ডলি */

:root {
  --ink: #1b2430;
  --ink-soft: #2a3645;
  --parchment: #f6f4ec;
  --parchment-deep: #ece6d6;
  --brass: #b8902f;
  --brass-soft: #d9b766;
  --guilty: #a13d3d;
  --innocent: #3d7a5c;
  --muted: #6b7280;
  --card-bg: #ffffff;
  --text: #1b2430;
  --text-soft: #4b5260;
  --border: rgba(27, 36, 48, 0.1);
  --shadow-sm: 0 4px 12px rgba(27, 36, 48, 0.06);
  --shadow: 0 12px 30px rgba(27, 36, 48, 0.08);
  --shadow-lg: 0 20px 50px rgba(27, 36, 48, 0.14);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --font-display: "Tiro Bangla", "Noto Serif Bengali", serif;
  --font-body: "Hind Siliguri", "Noto Sans Bengali", sans-serif;
  --container-w: 760px;
}

[data-theme="dark"] {
  --ink: #f6f4ec;
  --ink-soft: #d9b766;
  --parchment: #11151c;
  --parchment-deep: #0b0e13;
  --card-bg: #1c2330;
  --text: #ede9dd;
  --text-soft: #aba692;
  --border: rgba(246, 244, 236, 0.1);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ===== Reset & base ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--parchment);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
a { color: inherit; }
button { font: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.container { max-width: var(--container-w); margin: 0 auto; padding: 0 20px; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Topbar ===== */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(1.1);
}
.topbar__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__seal {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--brass-soft);
  border-radius: 50%;
  font-size: 18px;
  flex-shrink: 0;
}
.brand__text { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: 0.3px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  display: grid; place-items: center; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.icon-btn:hover { background: var(--border); }
.icon-btn:active { transform: scale(0.92); }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 56px 20px 64px;
  text-align: center;
  overflow: hidden;
  background: var(--ink);
  color: var(--parchment);
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(184,144,47,0.28), transparent 45%),
    radial-gradient(circle at 82% 75%, rgba(184,144,47,0.16), transparent 50%);
  pointer-events: none;
}
.hero__content { position: relative; max-width: 640px; margin: 0 auto; }
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: 2px; font-size: 0.74rem;
  color: var(--brass-soft); margin: 0 0 14px;
  font-weight: 600;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 1.25;
  margin: 0 0 16px;
}
.hero__sub {
  color: rgba(246,244,236,0.75);
  font-size: clamp(0.92rem, 2vw, 1.02rem);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 520px;
}

/* ===== Skeleton ===== */
#loading-skeleton { padding: 32px 20px; max-width: var(--container-w); margin: 0 auto; }
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(184,144,47,0.14) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 10px;
  margin-bottom: 14px;
}
.skeleton--title { height: 30px; width: 70%; }
.skeleton--text { height: 16px; width: 90%; }
.skeleton--image { height: 180px; width: 100%; border-radius: var(--radius); }
.skeleton--options { height: 100px; width: 100%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== Verdict Card ===== */
.verdict-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 28px;
  margin-top: -44px;
  position: relative;
  z-index: 5;
  animation: rise 0.5s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.verdict-card__label {
  text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.7rem;
  color: var(--brass); font-weight: 700; margin: 0 0 8px;
}
.verdict-card__title { font-family: var(--font-display); font-size: clamp(1.3rem, 4vw, 1.6rem); margin: 0 0 10px; line-height: 1.4; }
.verdict-card__desc { color: var(--text-soft); line-height: 1.7; margin: 0 0 18px; }
.verdict-card__image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.already-voted {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(61,122,92,0.12); color: var(--innocent);
  border: 1px solid rgba(61,122,92,0.3);
  padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; font-size: 0.92rem;
}

.options-wrap { display: grid; gap: 12px; margin-bottom: 18px; }
@media (min-width: 480px) {
  .options-wrap { grid-template-columns: 1fr 1fr; }
}
.option-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: right;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--parchment-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.02rem; font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.12s, background 0.18s, box-shadow 0.18s;
}
.option-btn:hover { border-color: var(--brass-soft); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.option-btn:active { transform: translateY(0); }
.option-btn__dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--muted);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.option-btn--selected { border-color: var(--brass); background: rgba(184,144,47,0.1); box-shadow: var(--shadow-sm); }
.option-btn--selected .option-btn__dot { background: var(--brass); border-color: var(--brass); }
.option-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== Buttons (shared) ===== */
.btn {
  font-family: var(--font-body);
  font-size: 1rem; font-weight: 700;
  border-radius: var(--radius-sm); border: none;
  padding: 14px 22px; cursor: pointer;
  transition: filter 0.15s, transform 0.1s, background 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn--block { width: 100%; }
.btn--primary { background: var(--ink); color: var(--brass-soft); }
.btn--primary:hover:not(:disabled) { filter: brightness(1.2); }
.btn--primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text-soft); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--border); }
.btn--danger { background: var(--guilty); color: #fff; }
.btn--danger:hover { filter: brightness(1.1); }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.share-btn:hover { background: var(--border); }
.share-btn:active { transform: scale(0.96); }

/* ===== Results ===== */
.results-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-top: 18px;
}
.results-card__head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 6px;
}
.results-card__head h3 { font-family: var(--font-display); margin: 0; font-size: 1.18rem; }
.results-card__head-actions { display: flex; align-items: center; gap: 10px; }
.live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; color: var(--guilty);
  text-transform: uppercase; letter-spacing: 1px;
}
.live-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--guilty); animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.results-card__total { color: var(--text-soft); margin: 0 0 20px; }
.result-row { margin-bottom: 16px; }
.result-row__head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.progress-track {
  height: 14px; border-radius: 7px; background: var(--parchment-deep);
  overflow: hidden; border: 1px solid var(--border);
}
.progress-fill { height: 100%; border-radius: 7px; transition: width 0.6s cubic-bezier(.22,.9,.3,1); }
.progress-fill--guilty { background: linear-gradient(90deg, var(--guilty), #c25656); }
.progress-fill--innocent { background: linear-gradient(90deg, var(--innocent), #4f9876); }

/* ===== Recent votes ===== */
.recent-votes { margin-top: 24px; border-top: 1px dashed var(--border); padding-top: 18px; }
.recent-votes h4 { font-family: var(--font-display); margin: 0 0 12px; font-size: 1rem; }
.recent-votes__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.recent-vote {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--parchment-deep);
  transition: background 0.2s;
}
.recent-vote__row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.recent-vote__id { font-family: monospace; color: var(--brass); font-weight: 700; }
.recent-vote__opt--option1 { color: var(--guilty); font-weight: 600; }
.recent-vote__opt--option2 { color: var(--innocent); font-weight: 600; }
.recent-vote__time { color: var(--text-soft); font-size: 0.78rem; }
.recent-vote__comment {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.5;
  padding-right: 2px;
  word-break: break-word;
}

.empty-state { text-align: center; color: var(--text-soft); padding: 24px 0; }

/* ===== Footer ===== */
.footer {
  text-align: center; padding: 40px 20px 60px; color: var(--text-soft);
  font-size: 0.85rem; max-width: 520px; margin: 0 auto; line-height: 1.7;
}
.footer__admin-link {
  display: inline-block; margin-top: 12px; color: var(--brass); font-weight: 600; text-decoration: none;
}
.footer__admin-link:hover { text-decoration: underline; }

/* ===== Dialogs / Modals ===== */
.dialog-overlay {
  position: fixed; inset: 0; background: rgba(15,18,24,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100; opacity: 0; transition: opacity 0.25s;
  backdrop-filter: blur(2px);
  padding: 0;
}
.dialog-overlay--show { opacity: 1; }
.dialog-box {
  background: var(--card-bg); color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 26px 22px 30px;
  width: 100%; max-width: 480px;
  transform: translateY(30px);
  transition: transform 0.25s;
  position: relative;
  max-height: 88vh; overflow-y: auto;
}
.dialog-overlay--show .dialog-box { transform: translateY(0); }
@media (min-width: 560px) {
  .dialog-overlay { align-items: center; padding: 20px; }
  .dialog-box { border-radius: var(--radius-lg); }
}
.dialog-box__close {
  position: absolute; top: 16px; left: 16px;
  background: var(--parchment-deep); border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; font-size: 0.95rem; color: var(--text-soft);
  display: grid; place-items: center;
  transition: background 0.15s;
}
.dialog-box__close:hover { background: var(--border); }
.dialog-box__eyebrow { text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.7rem; color: var(--brass); font-weight: 700; margin: 0 0 4px; }
.dialog-box__title { font-family: var(--font-display); margin: 0 0 18px; font-size: 1.3rem; }
.dialog-box__msg { margin: 0 0 20px; line-height: 1.6; }
.dialog-box__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.field__label em { color: var(--guilty); font-style: normal; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--parchment);
  color: var(--text); font-family: var(--font-body); font-size: 1rem;
  resize: vertical;
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--brass-soft); outline-offset: 1px; border-color: var(--brass);
}
.privacy-note { font-size: 0.8rem; color: var(--text-soft); background: var(--parchment-deep); padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 18px; line-height: 1.6; }

.dialog-box--success { text-align: center; }
.seal-stamp {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--innocent); color: #fff; font-size: 1.8rem;
  display: grid; place-items: center;
  animation: stampIn 0.4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes stampIn { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.vote-id-display {
  font-family: monospace; font-size: 1.4rem; font-weight: 700; color: var(--brass);
  background: var(--parchment-deep); padding: 10px 16px; border-radius: var(--radius-sm); display: inline-block; margin: 8px 0 22px;
  letter-spacing: 1px;
}

/* ===== Toasts ===== */
.toast-container {
  position: fixed; top: 16px; right: 16px; left: 16px; z-index: 200;
  display: grid; gap: 10px; justify-items: end;
  pointer-events: none;
}
@media (min-width: 480px) { .toast-container { left: auto; } }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--parchment);
  padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  font-size: 0.9rem; opacity: 0; transform: translateX(40px);
  transition: opacity 0.3s, transform 0.3s;
  max-width: 320px;
  pointer-events: auto;
}
.toast--show { opacity: 1; transform: translateX(0); }
.toast--success .toast__icon { color: var(--innocent); }
.toast--error .toast__icon { color: var(--guilty); }
.toast__icon { font-weight: 700; }

/* ===== Admin shared bits (used by admin.html too) ===== */
.admin-shell { min-height: 100vh; background: var(--parchment); }
.admin-nav {
  background: var(--ink); color: var(--parchment);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  position: sticky; top: 0; z-index: 20;
}
.admin-nav__brand { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm);
}
.stat-card__label { color: var(--text-soft); font-size: 0.78rem; margin: 0 0 6px; }
.stat-card__value { font-family: var(--font-display); font-size: 1.6rem; margin: 0; color: var(--brass); }

.panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 20px; }
@media (min-width: 640px) { .panel { padding: 24px; } }
.panel__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.panel__head h2 { font-family: var(--font-display); margin: 0; font-size: 1.15rem; }

/* form grid inside admin question form: stack on mobile, 2-col on desktop */
.form-grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 560px; }
th, td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-soft); font-weight: 700; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.5px; }
tbody tr:hover { background: var(--parchment-deep); }

.login-shell { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 20px; }
.login-box {
  background: var(--card-bg); padding: 36px 28px; border-radius: var(--radius-lg);
  width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-lg);
}
.login-box .brand__seal { margin: 0 auto 16px; }
.login-box h1 { font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 6px; }
.login-box p { color: var(--text-soft); margin: 0 0 24px; font-size: 0.9rem; }

/* ===== Responsive fine-tuning ===== */
@media (max-width: 600px) {
  .hero { padding: 44px 16px 52px; }
  .verdict-card, .results-card { padding: 20px; }
  .panel { padding: 16px; }
  th, td { padding: 8px; font-size: 0.78rem; }
  .stat-card__value { font-size: 1.4rem; }
  .dialog-box { padding: 22px 18px 26px; }
}

@media (min-width: 900px) {
  .container { max-width: var(--container-w); }
  .verdict-card:hover { box-shadow: var(--shadow-lg); }
}