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

:root {
  /* Higgsfield-inspired: near-black + neon lime glassmorphism */
  --bg: #0a0a0f;
  --panel: rgba(255,255,255,0.045);
  --panel-raised: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.1);
  --text: #f5f5f7;
  --muted: #8b8b96;
  --accent: #cdff4d;
  --accent-hover: #ddff7d;
  --accent-deep: #9fcc1f;
  --secondary: #8b6cff;
  --danger: #ff5c5c;
  --success: #6ee7a0;

  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --blur: blur(24px);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  background-image:
    radial-gradient(640px circle at 12% 18%, rgba(205,255,77,0.13), transparent 60%),
    radial-gradient(560px circle at 88% 78%, rgba(139,108,255,0.12), transparent 60%),
    radial-gradient(480px circle at 92% 8%, rgba(205,255,77,0.06), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,0.6);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  position: sticky;
  top: 0;
  z-index: 10;
}
nav .brand { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--text); }
nav .links { display: flex; gap: 22px; align-items: center; font-size: 14px; }
nav .links a { color: var(--text); }
nav .links a:hover { color: var(--accent); }
nav .links span { color: var(--muted); }
nav .links #navCredits { color: var(--accent); font-weight: 600; }

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 40px;
}
.card {
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.card.narrow { max-width: 420px; margin: 0 auto; }

h1 { font-size: 26px; margin: 0 0 6px; }
p.sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }

label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 500;
}
input[type="text"], input[type="password"], input[type="date"], textarea, select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 14px;
  font-family: var(--font-ui);
  margin-bottom: 16px;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 90px; font-family: var(--font-ui); line-height: 1.5; }

.row { display: flex; gap: 12px; }
.row > div { flex: 1; }

button, .btn {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  font-family: var(--font-ui);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 0 rgba(205,255,77,0);
}
button:hover:not(:disabled), .btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 24px rgba(205,255,77,0.35);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.full { width: 100%; }

.status { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; min-height: 18px; }
.status.error { color: var(--danger); }

.result { margin-top: 24px; text-align: center; }
.result img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }

.error-box {
  background: rgba(255,92,92,0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}

.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 28px; }
.filters > div { flex: 1; min-width: 140px; }
.filters label { margin-bottom: 6px; }
.filters input, .filters select { margin-bottom: 0; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gallery-item {
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.gallery-item:hover { border-color: rgba(205,255,77,0.4); }
.gallery-item img { width: 100%; display: block; aspect-ratio: 1 / 1; object-fit: cover; }
.gallery-item .meta { padding: 10px 12px; }
.gallery-item .prompt { font-size: 13px; margin: 0 0 6px; line-height: 1.3; }
.gallery-item .tags { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.badge {
  display: inline-block;
  background: var(--panel-raised);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
}
.empty-state { color: var(--muted); text-align: center; padding: 60px 20px; font-family: var(--font-display); font-size: 16px; }

/* ---- Chip-style filter selectors (style / lighting / camera angle) ---- */
.chip-group { margin-bottom: 22px; }
.chip-group-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 9px;
  font-weight: 500;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.chip:hover { border-color: var(--accent-deep); color: var(--text); }
.chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0f;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(205,255,77,0.3);
}

/* ---- Studio layout: control panel + framed canvas ---- */
.studio {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
}
.canvas-frame {
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.canvas-frame .placeholder {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 17px;
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}
.canvas-frame img {
  max-width: 100%;
  max-height: 640px;
  border-radius: 10px;
  animation: reveal 0.5s ease;
}
@keyframes reveal {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .canvas-frame img { animation: none; }
}
