/* ---------------------------------------------------------------------------
   Image SEO Studio by NexaBlack - one stylesheet for the marketing site, the
   app and the admin console.

   The tokens are taken from thenexablack.com so the product reads as part of
   the same company: Audiowide for display type over Red Hat Display, the
   #f93c10 signature red on stacked near-black surfaces, and hairline borders
   in translucent white rather than solid grey. Dark by default; the light
   theme keeps the red.
   --------------------------------------------------------------------------- */

:root {
  --bg: #141414;
  --bg-soft: #1a1a1a;
  --panel: #1e1e1e;
  --panel-2: #242424;
  --line: #ffffff24;
  --line-soft: #ffffff12;
  --text: #ffffff;
  --muted: #ffffffb8;
  --muted-2: #909090;

  --brand: #f93c10;
  --brand-2: #f59e0b;
  --brand-soft: rgba(249, 60, 16, 0.16);
  --brand-line: rgba(249, 60, 16, 0.4);
  --brand-ink: #ff8a6b; /* brand-coloured text that stays readable on dark */
  --ok: #00c758;
  --warn: #fac800;
  --danger: #fb2c36;
  --ok-soft: rgba(0, 199, 88, 0.14);
  --warn-soft: rgba(250, 200, 0, 0.14);
  --danger-soft: rgba(251, 44, 54, 0.14);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --display: "Audiowide", "Segoe UI", Impact, sans-serif;
  --font: "Red Hat Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 1180px;
}

[data-theme="light"] {
  --bg: #f6f5f3;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1efec;
  --line: #e4e0db;
  --line-soft: #efece8;
  --text: #141414;
  --muted: #55504b;
  --muted-2: #85807a;
  --brand-ink: #c42d08;
  --shadow: 0 18px 40px rgba(20, 20, 20, 0.1);
  --shadow-sm: 0 1px 3px rgba(20, 20, 20, 0.08);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  /* thenexablack.com's backdrop: a red wash off the top-left over near-black. */
  background:
    linear-gradient(115deg, rgba(249, 60, 16, 0.09) 0%, transparent 42%) fixed,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[data-theme="light"] body { background: var(--bg); }

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 700; }
/* Audiowide is a display face: it earns its place in big headings, and turns
   into noise at card-title size, where Red Hat Display carries on. */
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); }
h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; color: var(--muted); }
small { font-size: .82rem; }
code, pre { font-family: var(--mono); font-size: .86em; }

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: .7rem; }
.row.wrap-row { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.grow { flex: 1; }
.center { text-align: center; }
.muted { color: var(--muted); }
.tiny { font-size: .8rem; }
.hide { display: none !important; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ buttons */

.btn {
  --btn-bg: var(--panel-2);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .62rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 560;
  font-size: .92rem;
  cursor: pointer;
  transition: transform .06s ease, filter .15s ease, border-color .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); border-color: var(--muted-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(249, 60, 16, .32);
}
.btn.ghost { background: transparent; }
.btn.danger { --btn-bg: var(--danger-soft); --btn-fg: #ff8a8f; border-color: rgba(251, 44, 54, .3); }
.btn.sm { padding: .38rem .7rem; font-size: .82rem; }
.btn.lg { padding: .85rem 1.6rem; font-size: 1rem; }
.btn.block { width: 100%; }

/* ------------------------------------------------------------------- panels */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card.tight { padding: .9rem; }
.card.glow { box-shadow: var(--shadow); }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .18rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.ok { background: var(--ok-soft); color: #5ee89a; border-color: rgba(0, 199, 88, .28); }
.pill.warn { background: var(--warn-soft); color: #fde047; border-color: rgba(250, 200, 0, .28); }
.pill.danger { background: var(--danger-soft); color: #ff8a8f; border-color: rgba(251, 44, 54, .28); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
[data-theme="light"] .pill.ok { color: #047a38; }
[data-theme="light"] .pill.warn { color: #8a6d00; }
[data-theme="light"] .pill.danger { color: #c01920; }
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }

/* -------------------------------------------------------------------- forms */

label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%;
  padding: .62rem .8rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: .92rem;
}
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: #fff; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { min-height: 92px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
.field { margin-bottom: .9rem; }
.field .hint { font-size: .76rem; color: var(--muted-2); margin-top: .3rem; }
fieldset { border: 0; padding: 0; margin: 0; }

.choice {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.choice:hover { border-color: var(--muted-2); }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); }
.choice strong { display: block; font-size: .92rem; }
.choice span { font-size: .78rem; color: var(--muted); }

/* ------------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-2);
  font-weight: 700;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--line);
}
td { padding: .62rem .6rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------- meters */

.meter { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width .4s ease; }
.meter.warn > i { background: linear-gradient(90deg, var(--warn), var(--danger)); }

/* ------------------------------------------------------------------- toasts */

#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .6rem; z-index: 90; }
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  box-shadow: var(--shadow);
  max-width: 22rem;
  font-size: .88rem;
  animation: slide-in .2s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes slide-in { from { opacity: 0; transform: translateY(6px); } }

/* -------------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  z-index: 80;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(100%, 620px);
  max-height: 88vh;
  overflow: auto;
  padding: 1.4rem;
}
.modal.wide { width: min(100%, 900px); }

/* ------------------------------------------------------------------ loading */

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------- header */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; }
.logo { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 400; letter-spacing: .02em; font-size: 1rem; }
.logo .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--brand);
  box-shadow: 0 0 18px rgba(249, 60, 16, .45);
  display: grid; place-items: center; color: #fff; font-size: .78rem;
}
.nav { display: flex; align-items: center; gap: 1.2rem; font-size: .9rem; color: var(--muted); }
.nav a:hover { color: var(--text); }

/* ------------------------------------------------------------------ utility */

.divider { height: 1px; background: var(--line-soft); margin: 1.1rem 0; }
.badge-count { background: var(--danger); color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 .35rem; font-weight: 700; }
.copy-btn { cursor: pointer; border: 0; background: transparent; color: var(--muted); font-size: .78rem; padding: .15rem .3rem; border-radius: 5px; }
.copy-btn:hover { color: var(--brand-ink); background: var(--panel-2); }
.scroll-x { overflow-x: auto; }

/* --------------------------------------------------------------- page tools */

.tool-search { margin-bottom: .8rem; }
.tool-results { margin-top: .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-soft); max-height: 16rem; overflow-y: auto; }
.tool-results:empty { display: none; }
.tool-result {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%;
  padding: .55rem .75rem; border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.tool-result:last-child { border-bottom: 0; }
.tool-result:hover { background: var(--panel-2); }
.tool-result > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.tool-result .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-result .mono { color: var(--brand-2); white-space: nowrap; }
.tool-result.added { opacity: .45; cursor: default; }
.tool-result.added .mono::before { content: '✓ added  '; color: var(--ok); }

.tool-convert { margin: .2rem 0 .8rem; }
.tool-convert > summary { cursor: pointer; font-size: .82rem; color: var(--brand-ink); }
.tool-formats { margin-top: .5rem; display: grid; gap: .3rem; }
.tool-format { display: grid; grid-template-columns: 11rem 1fr auto; gap: .6rem; align-items: center; padding: .35rem .6rem; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--bg-soft); }
.tool-format code { word-break: break-all; }

.tool-points { display: grid; gap: .4rem; }
.tool-point { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .4rem; align-items: center; }
.tool-point input { padding: .45rem .6rem; font-size: .86rem; }

.scan-list { display: grid; gap: .35rem; max-height: 22rem; overflow-y: auto; padding-right: .2rem; }
.scan-row {
  display: grid; grid-template-columns: auto 1fr auto 11rem; gap: .7rem; align-items: center;
  padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); margin: 0; font-weight: 400; color: var(--text); cursor: pointer;
}
.scan-row .grow { display: flex; flex-direction: column; min-width: 0; }
.scan-row select { padding: .35rem .5rem; font-size: .8rem; }

.site-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.site-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .76rem; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); }
.site-chip button { border: 0; background: transparent; color: var(--muted-2); cursor: pointer; padding: 0; font-size: .85rem; line-height: 1; }
.site-chip button:hover { color: var(--danger); }

@media (max-width: 720px) {
  .tool-point { grid-template-columns: 1fr 1fr auto; }
  .tool-point input:first-child { grid-column: 1 / -1; }
  .tool-format { grid-template-columns: 1fr auto; }
  .tool-format .tiny { grid-column: 1 / -1; }
  .scan-row { grid-template-columns: auto 1fr; }
  .scan-row select { grid-column: 1 / -1; }
}

/* Dark scrollbars, so a bright system default does not break the theme. */
* { scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; }
[data-theme="light"] * { scrollbar-color: #c9c4be transparent; }

@media (max-width: 720px) {
  .nav { display: none; }
  .card { padding: 1rem; }
}
