/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
}

/* ===== Login Page ===== */
.login-bg {
  background: #0f172a;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(30,58,138,0.3) 0%, transparent 70%);
}

.login-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 40px 36px;
}

.lock-icon {
  width: 64px;
  height: 64px;
  background: #1d4ed8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.error-banner {
  background: #450a0a;
  border: 1px solid #7f1d1d;
  color: #f87171;
}

.vault-input {
  background: #0f172a;
  border: 1px solid #334155;
  outline: none;
  transition: border-color 0.15s;
}
.vault-input:focus {
  border-color: #3b82f6;
}

.login-btn {
  background: #1d4ed8;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.03em;
}
.login-btn:hover { background: #1e40af; }

/* ===== Vault Layout ===== */
.vault-bg { background: #f1f5f9; }

.vault-header {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.add-btn {
  background: #1d4ed8;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.add-btn:hover { background: #1e40af; }

.report-btn {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.report-btn:hover { color: #e2e8f0; border-color: #64748b; }

.logout-btn {
  color: #64748b;
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.15s;
}
.logout-btn:hover { color: #e2e8f0; }

/* ===== Stats Bar ===== */
.stats-bar { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }

.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
}

.stat-value {
  font-family: 'Libre Baskerville', serif;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ===== Filter Bar ===== */
.filter-bar { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }

.filter-input, .filter-select {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  outline: none;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: border-color 0.15s;
}
.filter-input:focus, .filter-select:focus { border-color: #3b82f6; }

.clear-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: color 0.15s, border-color 0.15s;
}
.clear-btn:hover { color: #0f172a; border-color: #94a3b8; }

/* ===== Evidence Grid ===== */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .evidence-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .evidence-grid { grid-template-columns: 1fr; } }

/* ===== Evidence Card ===== */
.evidence-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.evidence-card:hover { box-shadow: 0 4px 16px rgba(15,23,42,0.1); transform: translateY(-1px); }
.card-uncached { border-color: #fbbf24; }

.uncached-warning {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 5px;
  padding: 4px 8px;
  margin-bottom: 6px;
}

.cache-btn { color: #1d4ed8; }
.cache-btn:hover { color: #1e40af; background: #eff6ff; }

.card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  background: #f1f5f9;
}

.card-thumb-social {
  position: relative;
  height: 180px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.social-badge {
  color: #fff;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
}

.card-thumb-video {
  position: relative;
  height: 180px;
  background: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-thumb-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}
.play-icon {
  position: absolute;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.card-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif;
  white-space: nowrap;
}

/* LGA badges */
.lga-badge               { font-size: 10px; letter-spacing: 0.02em; }
.lga-Mopa-Amuro          { background: #f0fdf4; color: #166534; }
.lga-Yagba-West          { background: #fdf4ff; color: #6b21a8; }
.lga-Yagba-East          { background: #fff7ed; color: #9a3412; }

.badge-no_election_held  { background: #fef2f2; color: #991b1b; }
.badge-no_materials      { background: #fff7ed; color: #9a3412; }
.badge-vote_buying       { background: #fffbeb; color: #92400e; }
.badge-unsigned_sheets   { background: #fefce8; color: #854d0e; }
.badge-regrouping        { background: #faf5ff; color: #6b21a8; }
.badge-phantom_ward      { background: #fdf2f8; color: #9d174d; }
.badge-testimony         { background: #eff6ff; color: #1e40af; }
.badge-official_doc      { background: #f0fdfa; color: #134e4a; }
.badge-other             { background: #f9fafb; color: #374151; }

.card-ward { font-size: 12px; color: #64748b; }

.card-caption {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  flex: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.card-date { font-size: 11px; color: #94a3b8; }

.card-actions { display: flex; gap: 6px; }

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  color: #94a3b8;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.btn-icon:hover { color: #1e293b; background: #f1f5f9; }
.btn-icon.delete:hover { color: #dc2626; background: #fef2f2; }

/* ===== Footer ===== */
.vault-footer {
  background: #0f172a;
  color: #475569;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
}

/* ===== Modals ===== */
.modal-overlay {
  background: rgba(15,23,42,0.75);
  backdrop-filter: blur(2px);
}

.lightbox-card, .evidence-modal-card, .confirm-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.modal-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.15s;
}
.modal-close-btn:hover { color: #1e293b; }

#lightboxMedia img { max-width: 100%; border-radius: 6px; max-height: 65vh; object-fit: contain; }
#lightboxMedia video { max-width: 100%; border-radius: 6px; max-height: 65vh; }

.lightbox-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.lightbox-meta-item label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.lightbox-meta-item p {
  font-size: 14px;
  color: #1e293b;
  font-family: 'IBM Plex Sans', sans-serif;
}
.lightbox-caption {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.6;
  font-family: 'IBM Plex Sans', sans-serif;
  margin-top: 12px;
}

/* ===== Evidence Form ===== */
.tab-btn {
  padding: 10px 16px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.tab-btn.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
  font-family: 'IBM Plex Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== Upload mode toggle ===== */
.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.mode-btn:not(.active):hover { border-color: #94a3b8; color: #1e293b; }

/* ===== Bulk image thumbnail grid ===== */
.bulk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.bulk-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.bulk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bulk-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.bulk-thumb:hover .bulk-thumb-remove { opacity: 1; }

/* ===== Bulk progress bar ===== */
.bulk-progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.bulk-progress-bar {
  height: 100%;
  background: #1d4ed8;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.form-input {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.form-input.error { border-color: #dc2626; }

.drop-zone {
  border-color: #d1d5db;
  background: #f9fafb;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.fetch-btn {
  background: #0f172a;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: background 0.15s;
}
.fetch-btn:hover { background: #1e293b; }

.submit-btn {
  background: #1d4ed8;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: background 0.15s;
}
.submit-btn:hover { background: #1e40af; }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.cancel-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: color 0.15s, border-color 0.15s;
}
.cancel-btn:hover { color: #1e293b; border-color: #94a3b8; }

.delete-confirm-btn {
  background: #dc2626;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: background 0.15s;
}
.delete-confirm-btn:hover { background: #b91c1c; }

/* ===== Spinner ===== */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
.toast {
  min-width: 240px;
  max-width: 340px;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: slideIn 0.2s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-success { background: #166534; color: #dcfce7; }
.toast-error   { background: #7f1d1d; color: #fee2e2; }
.toast-info    { background: #1e3a5f; color: #dbeafe; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== Social video preview in form ===== */
.social-preview-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 8px;
}
.social-preview-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

/* ===== Social embed in lightbox ===== */
.social-embed-wrapper {
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
}
.social-open-prompt {
  padding: 24px;
  text-align: center;
}
