/* ParseHub · Liquid Glass design system */

:root {
  --bg-0: #05060f;
  --bg-1: #0a0e22;
  --ink: #eef2ff;
  --muted: #9aa6c9;
  --faint: #6b7699;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --accent-a: #7c5cff;
  --accent-b: #22d3ee;
  --accent-c: #f472b6;
  --danger: #ff7285;
  --ok: #4ade80;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-deep: 0 24px 70px rgba(2, 4, 18, 0.55);
  --glass-fill: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045) 42%, rgba(255, 255, 255, 0.02));
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 90% at 80% -10%, #171d43 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(124, 92, 255, 0.45); }

#aurora {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

#root, .page-flow { position: relative; z-index: 1; }

.shell {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- glass surfaces ---------- */

.glass-panel, .glass-card {
  position: relative;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.glass-panel::before, .glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 12% 0%, rgba(255, 255, 255, 0.14) 0%, transparent 45%),
    radial-gradient(80% 40% at 88% 100%, rgba(124, 92, 255, 0.10) 0%, transparent 55%);
}

/* WebGL LiquidGlass took over: hand the surface to the shader */
.lg-active {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.lg-active::before { display: none; }

.glass-card { border-radius: var(--radius-md); }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding: 14px 20px;
  border-radius: 999px;
}

.brand { display: flex; align-items: center; gap: 13px; }

.brand .mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.brand h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }

/* ---------- hero ---------- */

.hero { padding: 72px 4px 30px; max-width: 800px; }

.hero h2 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5.4vw, 58px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -1.2px;
}

.hero .grad {
  background: linear-gradient(92deg, var(--accent-b) 0%, var(--accent-a) 45%, var(--accent-c) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---------- composer ---------- */

.composer { padding: 18px; }

.composer textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: 16px/1.6 var(--font);
  outline: none;
}

.composer textarea::placeholder { color: var(--faint); }

.composer .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.hint { color: var(--faint); font-size: 12.5px; }

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

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font: 600 14px var(--font);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

.btn.primary {
  border: 0;
  padding: 11px 22px;
  color: #fff;
  background: linear-gradient(120deg, var(--accent-a), #5b7cfa 55%, var(--accent-b));
  box-shadow: 0 10px 30px rgba(101, 100, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn.primary:hover { box-shadow: 0 14px 36px rgba(101, 100, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35); }

.btn.danger { color: #ffb4bd; border-color: rgba(255, 114, 133, 0.35); background: rgba(255, 114, 133, 0.12); }
.btn.danger:hover { background: rgba(255, 114, 133, 0.22); }

.btn.small { padding: 7px 13px; font-size: 13px; }

/* ---------- result area ---------- */

.result { padding: 34px 0 90px; }
.result[hidden] { display: none; }

.post-card {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
}

.platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent-b);
}

.platform-tag::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.post-card h3 { margin: 8px 0 10px; font-size: 25px; font-weight: 750; letter-spacing: -0.4px; }

.post-content {
  white-space: pre-wrap;
  color: var(--muted);
  max-height: 190px;
  overflow: auto;
  font-size: 14.5px;
}

.post-tools { display: flex; gap: 9px; align-items: flex-start; flex-wrap: wrap; }

.media-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 30px 2px 14px;
}

.media-head h3 { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -0.3px; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.media-card { overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.media-card:hover { transform: translateY(-3px); }

.media-card .preview {
  aspect-ratio: 4 / 3;
  background: rgba(4, 7, 18, 0.75);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.media-card .preview img,
.media-card .preview video { width: 100%; height: 100%; object-fit: contain; }
.media-card .preview a { color: var(--accent-b); font-weight: 600; }

.media-card .meta {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.meta-left { display: flex; align-items: center; gap: 11px; min-width: 0; }

.kind { font-weight: 650; font-size: 14px; }
.dimensions { font-size: 12px; color: var(--faint); }

/* custom checkbox */
.check {
  appearance: none;
  -webkit-appearance: none;
  width: 21px; height: 21px;
  flex: none;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.check:checked {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
}

.check:checked::after {
  content: "";
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

select {
  max-width: 150px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  color: var(--ink);
  font: 500 13px var(--font);
  outline: none;
}

select option { background: #10142b; }

/* download bar */
.download-bar {
  position: sticky;
  bottom: 18px;
  margin-top: 26px;
  padding: 13px 16px;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 5;
}

.download-bar .group { display: flex; gap: 9px; flex-wrap: wrap; }

.empty, .error-box {
  padding: 30px;
  text-align: center;
  border-radius: var(--radius-md);
  color: var(--muted);
}

.error-box { color: #ffaeb9; border: 1px solid rgba(255, 114, 133, 0.3); background: rgba(255, 80, 100, 0.08); }

/* skeleton shimmer while parsing */
.skeleton {
  height: 130px;
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, rgba(255,255,255,0.05) 38%, rgba(255,255,255,0.13) 50%, rgba(255,255,255,0.05) 62%);
  background-size: 240% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer { to { background-position: -140% 0; } }

/* ---------- dialogs ---------- */

dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  width: min(480px, 92vw);
  color: var(--ink);
  background: linear-gradient(150deg, rgba(30, 36, 66, 0.92), rgba(14, 18, 38, 0.94));
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

dialog::backdrop { background: rgba(3, 5, 16, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog h3 { margin: 0 0 8px; font-size: 21px; font-weight: 750; }
dialog .row { display: flex; gap: 10px; margin-top: 18px; }

input[type="password"], input[type="text"], input[type="number"], textarea.field {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 9, 22, 0.6);
  color: var(--ink);
  font: 14.5px var(--font);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea.field:focus {
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.22);
}

.remember { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 12px; }
.remember input { width: auto; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(22, 27, 52, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-deep);
  font-weight: 600;
  z-index: 30;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show { opacity: 1; transform: none; }

.loader {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.foot { padding: 40px 0 46px; text-align: center; color: var(--faint); font-size: 13px; }

/* ---------- admin specifics ---------- */

.login-card { width: min(460px, calc(100% - 40px)); margin: 13vh auto 0; padding: 30px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card p { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 20px;
  padding-bottom: 80px;
}

.admin-grid .wide { grid-column: 1 / -1; }
.card-pad { padding: 22px; }
.card-pad h2 { margin: 0 0 15px; font-size: 16.5px; font-weight: 700; }

.toolbar { display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; margin-bottom: 13px; }

.list { display: grid; gap: 10px; }

.item {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.item .name { font-weight: 650; }
.muted { color: var(--muted); }

.pill {
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  vertical-align: 1px;
}

.pill.on { background: rgba(74, 222, 128, 0.16); color: var(--ok); }

.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }

.platform-card {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 14px;
}

.platform-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.status { font-size: 12px; color: var(--faint); }
.status.ok { color: var(--ok); }

.secret {
  word-break: break-all;
  background: rgba(5, 8, 20, 0.7);
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(124, 92, 255, 0.6);
  margin: 14px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

label.lbl { display: block; margin: 13px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .topbar { margin-top: 16px; }
  .hero { padding-top: 44px; }
  .post-card { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .download-bar { flex-wrap: wrap; }
  .download-bar .group { width: 100%; }
  .download-bar .group .btn { flex: 1; }
  .admin-grid { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .composer .actions { flex-direction: column; align-items: stretch; }
  .composer .actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- theme toggle button ---------- */

.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
  border-radius: 999px;
}

/* ---------- light (day) theme ---------- */

:root[data-theme="light"] {
  --bg-0: #e9edf7;
  --bg-1: #f4f6fc;
  --ink: #17203a;
  --muted: #55608a;
  --faint: #8b93b5;
  --line: rgba(20, 28, 55, 0.14);
  --line-soft: rgba(20, 28, 55, 0.08);
  --shadow-deep: 0 20px 55px rgba(40, 55, 110, 0.18);
  --glass-fill: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.58) 42%, rgba(255, 255, 255, 0.44));
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="light"] body {
  background: radial-gradient(120% 90% at 80% -10%, #dfe6fb 0%, var(--bg-1) 45%, var(--bg-0) 100%);
}
:root[data-theme="light"] ::selection { background: rgba(124, 92, 255, 0.25); }

:root[data-theme="light"] .glass-panel,
:root[data-theme="light"] .glass-card {
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(20, 28, 55, 0.04);
}
:root[data-theme="light"] .glass-panel::before,
:root[data-theme="light"] .glass-card::before {
  background:
    radial-gradient(120% 60% at 12% 0%, rgba(255, 255, 255, 0.5) 0%, transparent 45%),
    radial-gradient(80% 40% at 88% 100%, rgba(124, 92, 255, 0.08) 0%, transparent 55%);
}

:root[data-theme="light"] .btn {
  background: rgba(20, 28, 55, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
:root[data-theme="light"] .btn:hover { background: rgba(20, 28, 55, 0.1); }
:root[data-theme="light"] .btn.primary {
  background: linear-gradient(120deg, #6d4bf0, #4f6ef0 55%, #3b82f6);
  box-shadow: 0 10px 26px rgba(79, 110, 240, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
:root[data-theme="light"] .btn.primary:hover { box-shadow: 0 14px 32px rgba(79, 110, 240, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
:root[data-theme="light"] .btn.danger { color: #c0304a; border-color: rgba(255, 114, 133, 0.4); background: rgba(255, 80, 100, 0.1); }
:root[data-theme="light"] .btn.danger:hover { background: rgba(255, 80, 100, 0.18); }

:root[data-theme="light"] .check { background: rgba(20, 28, 55, 0.05); }
:root[data-theme="light"] select { background: rgba(20, 28, 55, 0.05); }
:root[data-theme="light"] select option { background: #fff; }

:root[data-theme="light"] input[type="password"],
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] textarea.field {
  background: rgba(255, 255, 255, 0.75);
}

:root[data-theme="light"] dialog {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(244, 246, 252, 0.97));
}
:root[data-theme="light"] dialog::backdrop { background: rgba(20, 28, 55, 0.32); }

:root[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.92); }

:root[data-theme="light"] .item,
:root[data-theme="light"] .platform-card { background: rgba(20, 28, 55, 0.035); }
:root[data-theme="light"] .pill { background: rgba(20, 28, 55, 0.08); }
:root[data-theme="light"] .pill.on { background: rgba(22, 163, 74, 0.16); color: #15803d; }
:root[data-theme="light"] .status.ok { color: #15803d; }

:root[data-theme="light"] .secret { background: rgba(20, 28, 55, 0.05); }
:root[data-theme="light"] .media-card .preview { background: rgba(20, 28, 55, 0.06); }
:root[data-theme="light"] .error-box { color: #b02a4a; background: rgba(255, 80, 100, 0.08); border-color: rgba(255, 114, 133, 0.35); }

:root[data-theme="light"] .skeleton {
  background: linear-gradient(100deg, rgba(20, 28, 55, 0.05) 38%, rgba(20, 28, 55, 0.12) 50%, rgba(20, 28, 55, 0.05) 62%);
  background-size: 240% 100%;
}
