:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --cancel: #CA1F1F;
  --cancel-dark: #A02B26;
  --accent: #10b981;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --shadow: rgba(15, 23, 42, 0.08);
  --toast-bg: var(--surface);
  --toast-text: var(--text);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-muted: #cbd5f5;
  --border: #334155;
  --shadow: rgba(15, 23, 42, 0.35);
  --toast-bg: var(--surface);
  --toast-text: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

img,
svg {
  display: block;
}

svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.site-header,
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.site-footer {
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.site-footer a {
  margin-right: 1rem;
  color: var(--text-muted);
}

.brand {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand-title {
  margin: 0;
  font-weight: 600;
}

.brand-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

button,
select,
input {
  font-family: inherit;
}

.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.primary-btn:disabled,
.primary-btn:disabled:hover {
  background: var(--primary);
  opacity: 0.6;
  cursor: not-allowed;
}

.cancel-btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  background: var(--cancel);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.cancel-btn:hover {
  background: var(--cancel-dark);
}

.ghost-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0.55rem 1.25rem;
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.lead {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.hero-highlights {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
}

.hero-media {
  display: flex;
  justify-content: center;
}

.media-frame {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px var(--shadow);
  width: min(400px, 100%);
}

.media-window {
  margin-top: 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}

.window-chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.05);
}

.window-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.window-chrome p {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.window-table {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.window-table span {
  flex: 1;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.table-head {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.table-row {
  padding: 0.45rem 0.35rem;
  border-radius: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

.window-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem 1rem;
}

.window-footer p {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.window-footer .progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}

.progress-fill {
  height: 100%;
  width: 70%;
  border-radius: 999px;
  background: var(--primary);
}

.progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0 1.5rem;
  color: var(--text-muted);
}

.progress-labels {
  display: flex;
  gap: 0.4rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.dot.active {
  background: var(--primary);
}

.workflow {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border-radius: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px var(--shadow);
}

.card header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.2rem;
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  display: grid;
  place-items: center;
  color: var(--primary);
}

.step {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
}

.dropzone label {
  color: var(--primary);
  cursor: pointer;
}

.muted {
  color: var(--text-muted);
}

.detected {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.preview-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.5rem;
}

.table-scroll {
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(37, 99, 235, 0.06);
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar {
  background: var(--bg);
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

select,
input[type="number"] {
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.summary {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cta-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cta-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.primary-btn.grow {
  transition: width .25s ease, flex-basis .25s ease;
}

.cancel-wrap {
  display: inline-flex;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width .25s ease, opacity .2s ease;
}

.cancel-wrap.show {
  max-width: 200px; /* enough space for the button */
  opacity: 1;
}

.status {
  color: var(--text-muted);
  font-size: 0.95rem;
}


.download-link {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  min-width: 0;
}

.download-link:hover {
  border-color: var(--accent);
  background: var(--bg);
}


.job-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.job-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .25s ease;
}

.job-progress.striped .job-progress-fill {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.35) 0,
    rgba(255,255,255,0.35) 10px,
    rgba(255,255,255,0.15) 10px,
    rgba(255,255,255,0.15) 20px
  );
}

.help-menu {
  position: relative;
}

.help-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 15px 35px var(--shadow);
  padding: 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.help-dropdown a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.help-dropdown.show {
  display: flex;
}

@media (max-width: 900px) {
  .preview-wrapper {
    grid-template-columns: 1fr;
  }

  .site-header,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    flex-direction: column;
  }
}


/* Remove focus outline for page-title */
.page-title:focus,
.page-title:focus-visible {
  outline: none;
  box-shadow: none; /* in case UA/theme uses box-shadow */
}


html { scroll-behavior: smooth; }

#upload { scroll-margin-top: 80px; } /* adjust as needed */

/* Toast styling (Option A: class-based) */
.blazored-toast.app-toast {
  background: var(--toast-bg);
  color: var(--toast-text);
  border-radius: 20px;
  box-shadow: 0 10px 30px var(--shadow);
  width: 24rem;
  border-top: 4px solid var(--accent);
}

.blazored-toast.app-toast .blazored-toast-close {
  color: var(--text-muted);
}

.blazored-toast.app-toast .blazored-toast-progressbar > span {
  background-color: var(--accent);
}

/* Severity accents */
.blazored-toast.app-toast-info { border-top-color: var(--accent); }
.blazored-toast.app-toast-success { border-top-color: #16a34a; }
.blazored-toast.app-toast-warning { border-top-color: #eab308; }
.blazored-toast.app-toast-error { border-top-color: #dc2626; }

#blazor-error-ui { display: none; }