/* Shared dark theme, matched to impact.seedsindia.org's design language:
   near-black background, off-white text, rounded pill accent buttons in
   amber/orange, dark card surfaces, Inter typeface. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #121212;
  --surface: #1c1c1c;
  --surface-alt: #232323;
  --border: #2e2e2e;
  --text: #f0f0f0;
  --text-muted: #9c9c9c;
  --accent: #f0a533;
  --accent-contrast: #121212;
  --danger: #e5484d;
  --success: #3cc47c;
  --info: #4ea8de;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  margin: 0;
}

/* Safety net: nothing on these pages should intentionally be wider than the
   viewport (wide tables scroll within their own .table-scroll wrapper
   instead) — this just stops a future layout slip from reintroducing a
   page-wide horizontal scrollbar. */
body { overflow-x: hidden; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { text-decoration: underline; }

/* ---------- Animation system ---------- */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-in-up { animation: fadeInUp .45s cubic-bezier(.16,1,.3,1) both; }
.fade-in { animation: fadeIn .35s ease both; }
.scale-in { animation: scaleIn .3s cubic-bezier(.16,1,.3,1) both; }

/* Apply to a list of siblings and give each one an index-based delay via
   inline `style="animation-delay:..."` (set from the server/template loop,
   or from JS for dynamically-rendered elements) for a staggered entrance. */
.stagger { animation: fadeInUp .45s cubic-bezier(.16,1,.3,1) both; }

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
  opacity: .8;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

.navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  row-gap: 10px;
  padding: 14px 28px;
  background: #0d0d0d;
  border-bottom: 1px solid var(--border);
}
.navbar .brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.navbar .brand-logo {
  height: 28px;
  width: auto;
  display: block;
}
.navbar .brand .mark { color: var(--accent); }
.navbar .nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.navbar .user-email { color: var(--text-muted); font-size: 13px; margin-right: 6px; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn-accent { background: var(--accent); color: var(--accent-contrast); }
.btn-accent:hover { background: #ffb64d; text-decoration: none; box-shadow: 0 4px 16px rgba(240,165,51,.25); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 480px; margin: 0 auto; padding: 0 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color .2s ease, transform .15s ease;
}
.stat-card:hover { border-color: #3a3a3a; transform: translateY(-1px); }
.stat-card .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-card .value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 2px;
  animation: fadeInUp .4s cubic-bezier(.16,1,.3,1) both;
}

.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

h1, h2, h3, h4, h5, h6 { font-weight: 600; margin: 0 0 8px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }

.form-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,165,51,.15); }
select.form-control { appearance: auto; }
.form-row { display: flex; gap: 12px; }
.form-row > div { flex: 1; }
.form-group { margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }
table th, table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}
table th { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
table tr td { transition: background-color .15s ease; }
table tr:hover td { background: var(--surface-alt); }
table tbody tr { animation: fadeInUp .35s cubic-bezier(.16,1,.3,1) both; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  transition: background-color .2s ease, color .2s ease;
}
.badge-pending { background: #4a3a14; color: #f0b33a; animation: softPulse 1.6s ease-in-out infinite; }
.badge-running { background: #16324a; color: #4ea8de; animation: softPulse 1.6s ease-in-out infinite; }
.badge-complete { background: #163a26; color: var(--success); }
.badge-failed { background: #3a1616; color: var(--danger); }

.alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  animation: fadeInUp .35s cubic-bezier(.16,1,.3,1) both;
}
.alert-warning { background: #3a2e12; color: #f0b33a; border: 1px solid #5a4a1e; }
.alert-danger { background: #3a1616; color: #ff8a8a; border: 1px solid #5a2222; }
.alert-success { background: #123a22; color: #6adf9c; border: 1px solid #1e5a36; }

.page-header { padding: 32px 0 20px; animation: fadeInUp .5s cubic-bezier(.16,1,.3,1) both; }
.page-header h1 { font-size: 28px; }

.navbar { animation: fadeIn .4s ease both; }
