/* YAYNOW! -- shared stylesheet, ported from the Claude Design mockups
   (Login.dc.html / Discover.dc.html / Create.dc.html). Visual only --
   all interactivity here is real Flask/Jinja, not the design tool's
   DCLogic runtime. */

:root {
  --bg: #F5F5F7;
  --card-bg: #ffffff;
  --text: #1D1D1F;
  --text-secondary: #3A3A3C;
  --muted: #6E6E73;
  --muted-2: #8E8E93;
  --border: #E5E5EA;
  --border-input: #D2D2D7;
  --field-bg: #FAFAFA;
  --accent: #9B26B6;
  --accent-hover: #88209F;
  --accent-bg: #F3E6F7;
  --success: #2E7D32;
  --danger: #C0392B;
  --danger-bg: #FFF1F0;
  --danger-border: #FFD6D3;
  --danger-icon: #E5484D;
  --chip-bg: #F0F0F2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "SF Pro Text", Inter, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(155, 38, 182, .18);
}
textarea { resize: vertical; font-family: inherit; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px 24px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.brand span { font-weight: 700; font-size: 17px; letter-spacing: -.2px; }

.header-right { display: flex; align-items: center; gap: 12px 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }
.engine-summary strong { color: var(--text); }
.channel-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 999px; background: var(--channel-bg); color: var(--channel-color);
  font-size: 12px; font-weight: 800; letter-spacing: .2px;
}

.auto-toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.auto-toggle-label span.label-text { color: var(--text); font-weight: 500; }

.toggle-track {
  width: 38px; height: 22px; border-radius: 11px;
  position: relative; transition: background .2s; display: inline-block; flex-shrink: 0;
  border: none; padding: 0; cursor: pointer;
}
.toggle-track.on { background: var(--accent); }
.toggle-track.off { background: var(--border-input); }
.toggle-knob {
  position: absolute; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s;
}
.toggle-track.on .toggle-knob { left: 18px; }
.toggle-track.off .toggle-knob { left: 2px; }
.toggle-form { display: inline; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); text-decoration: none;
}
.main-nav a:hover { background: var(--chip-bg); text-decoration: none; }
.main-nav a.active { font-weight: 600; color: var(--accent); background: var(--accent-bg); }

.logout-form { display: inline; }
.logout-btn {
  padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); background: none; border: none; font-family: inherit; cursor: pointer;
}
.logout-btn:hover { background: var(--chip-bg); }

/* ---------- layout ---------- */
main.page { max-width: 1100px; margin: 0 auto; padding: 40px 24px 80px; display: flex; flex-direction: column; gap: 28px; }

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-heading h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -.6px; }
.page-heading p { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- flash messages ---------- */
.flash { padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 0.5rem; font-size: 14px; font-weight: 500; }
.flash.success { background: #E3F5E5; color: var(--success); }
.flash.info { background: #EFEAFB; color: #4C2A85; }

/* ---------- buttons ---------- */
.btn {
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border-radius: 10px; border: none; transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn-primary { height: 44px; padding: 0 20px; background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-outline {
  height: 44px; padding: 0 20px; background: #fff; color: var(--text);
  border: 1px solid var(--border-input); font-size: 14px; font-weight: 600;
}
.btn-outline:hover { background: var(--chip-bg); }
.btn-small { height: 34px; padding: 0 14px; background: #fff; color: var(--text); border: 1px solid var(--border-input); font-size: 13px; font-weight: 600; border-radius: 8px; }
.btn-small:hover { background: var(--chip-bg); }
.btn-reject { color: var(--danger); }
.btn-icon {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: none;
  color: var(--muted-2); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--chip-bg); color: var(--text); }

/* ---------- cards ---------- */
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.hub-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; color: var(--text); text-decoration: none; }
.hub-card:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.hub-card h2 { margin: 0; font-size: 24px; }
.hub-card p { margin: 0; color: var(--muted); line-height: 1.5; }

/* ---------- badges ---------- */
.badge-category {
  font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-bg);
  border-radius: 999px; padding: 4px 10px; letter-spacing: .3px; display: inline-block;
}
.badge-count { background: var(--chip-bg); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.badge-source-type {
  font-size: 11px; font-weight: 700; color: var(--text-secondary); background: var(--chip-bg);
  border-radius: 6px; padding: 3px 7px; letter-spacing: .3px; white-space: nowrap; flex-shrink: 0;
}

/* ---------- form fields ---------- */
label.field-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; }
input[type=text], input[type=password], textarea {
  border: 1px solid var(--border-input); border-radius: 10px; padding: 12px 14px;
  font-size: 15px; line-height: 1.5; background: var(--field-bg); width: 100%;
}
input[type=text].compact, input[type=password].compact { height: 42px; padding: 0 14px; }
select {
  min-height: 38px; border: 1px solid var(--border-input); border-radius: 9px;
  padding: 0 34px 0 12px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text); background: var(--field-bg); cursor: pointer;
}
select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 38, 182, .18);
}

/* ---------- Bronnen (sources) ---------- */
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
details[open] .chevron { transform: rotate(0deg); }
details:not([open]) .chevron { transform: rotate(-90deg); }

.sources-toggle-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; background: none; border: none; font-family: inherit; cursor: pointer; text-align: left;
}
.sources-toggle-btn .title-row { display: flex; align-items: center; gap: 10px; }
.sources-toggle-btn .title-row span.title { font-size: 17px; font-weight: 600; color: var(--text); }
.chevron { color: var(--muted-2); font-size: 13px; display: inline-block; transition: transform .2s; }
.sources-body { border-top: 1px solid var(--chip-bg); padding: 8px 22px 20px; display: flex; flex-direction: column; }
.source-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--chip-bg);
}
.source-row:last-child { border-bottom: none; }
.source-row-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.source-row-name-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.source-row-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row-name.disabled { color: var(--muted-2); }
.source-row-detail { font-size: 12px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row-actions { display: flex; align-items: center; gap: 14px; }
.add-source-form { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.add-source-form input[type=text] { flex: 1; min-width: 200px; height: 42px; padding: 0 14px; }
.sources-hint { margin: 14px 0 0; font-size: 12px; color: var(--muted-2); line-height: 1.5; }

/* ---------- empty state ---------- */
.empty-state {
  background: var(--card-bg); border: 1px dashed var(--border-input); border-radius: 14px;
  padding: 64px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.empty-state .icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.empty-state p { margin: 0; }
.empty-state p.title { font-size: 17px; font-weight: 600; }
.empty-state p.subtitle { font-size: 14px; color: var(--muted); }

/* ---------- Discover items ---------- */
.section-label {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .6px;
}
.queue-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sort-control { display: flex; align-items: center; gap: 8px; }
.sort-control label { font-size: 12px; font-weight: 600; color: var(--muted); }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.item-card {
  padding: 22px; display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow .2s, transform .2s;
}
.item-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-1px); }
.item-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.item-card-meta { font-size: 13px; color: var(--muted-2); }
.date-stack { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.date-primary { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.date-primary.estimated,
.date-primary.unknown { color: var(--muted); }
.date-secondary { font-size: 12px; color: var(--muted-2); }
.item-card h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.3px; line-height: 1.25; }
.item-card p.summary { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-secondary); flex: 1; }
.item-card .source-link { font-size: 14px; font-weight: 500; }
.sources-list {
  display: flex; flex-direction: column; gap: 5px; padding: 10px 0 0;
  border-top: 1px solid var(--chip-bg);
}
.sources-list-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.sources-list-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sources-list-links a,
.sources-list-links span {
  font-size: 13px; font-weight: 600; background: var(--field-bg);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 9px;
}
.sources-list-links a:hover { background: var(--accent-bg); text-decoration: none; }
.item-card-actions { display: flex; gap: 10px; padding-top: 6px; border-top: 1px solid var(--chip-bg); }
.item-card-actions form { flex: 1; }
.item-card-actions .btn { width: 100%; height: 42px; font-size: 14px; }

.hiphop-card-image {
  display: flex; flex-direction: column; gap: 6px;
}
.hiphop-card-image img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
}
.image-placeholder {
  width: 100%; min-height: 160px; border-radius: 10px;
  border: 1px dashed var(--border-input); background: var(--field-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); font-size: 13px; font-weight: 600;
}
.image-placeholder.large { min-height: 280px; }
.image-status {
  align-self: flex-start; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .4px;
  border-radius: 999px; padding: 4px 8px;
  color: var(--success); background: #E3F5E5;
}
.image-status.too_small { color: #9A5B00; background: #FFF4D6; }
.image-status.none { color: var(--danger); background: var(--danger-bg); }

/* ---------- Create page ---------- */
.create-item {
  overflow: hidden;
}
.create-item-header { padding: 24px 28px; border-bottom: 1px solid var(--chip-bg); display: flex; flex-direction: column; gap: 10px; }
.create-item-header .tags-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.create-item-header .person-name { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.create-item-header .source-name { font-size: 13px; color: var(--muted-2); }
.create-item-header h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.4px; line-height: 1.2; }

.create-item-body { padding: 24px 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px 32px; }
.hiphop-create-body { align-items: start; }
.hiphop-create-image {
  width: 100%; max-height: 520px; object-fit: contain;
  border-radius: 12px; border: 1px solid var(--border); background: var(--field-bg);
}
.hiphop-render-preview {
  width: 100%; max-width: 420px; aspect-ratio: 4 / 5; object-fit: contain;
  border-radius: 12px; border: 1px solid var(--border); background: #111;
}
.field-block { display: flex; flex-direction: column; gap: 8px; }
.field-block-footer { display: flex; justify-content: flex-end; align-items: center; }
.field-block-footer.spread { justify-content: space-between; }
.field-hint { font-size: 12px; color: var(--muted-2); }

.dropzone {
  border: 1.5px dashed #C7C7CC; border-radius: 12px; padding: 28px 20px; text-align: center;
  background: var(--field-bg); cursor: pointer; display: flex; flex-direction: column; align-items: center;
  gap: 6px; transition: border-color .15s, background .15s; position: relative;
}
.dropzone:hover { border-color: var(--accent); background: #FBF6FD; }
.dropzone.small { padding: 20px; gap: 4px; }
.dropzone .dz-icon { font-size: 22px; color: var(--accent); }
.dropzone .dz-title { font-size: 14px; font-weight: 600; }
.dropzone .dz-sub { font-size: 12px; color: var(--muted-2); }
.dropzone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.clip-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.clip-thumb { width: 64px; }
.clip-thumb img { width: 64px; height: 114px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.clip-thumb-missing {
  width: 64px; height: 114px; border-radius: 8px; border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 0.6rem; color: var(--muted-2); padding: 0.2rem;
}
.check-ok { color: var(--success); font-weight: 600; }

.create-item-footer {
  padding: 24px 28px; background: var(--field-bg); border-top: 1px solid var(--chip-bg);
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; align-items: start;
}
@media (max-width: 640px) { .create-item-footer { grid-template-columns: 1fr; } }
.render-status-row { display: flex; justify-content: space-between; font-size: 13px; }
.render-status-row .status-label { font-weight: 600; }
.render-status-row .status-label.rendering { color: var(--accent); }
.render-status-row .status-label.done { color: var(--success); }
.render-bar-track { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin: 10px 0; }
.render-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.render-status-detail { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.render-error-text { color: var(--danger); font-size: 13px; }

.phone-frame {
  width: 150px; aspect-ratio: 9/16; border-radius: 14px;
  background: linear-gradient(180deg, #2C2C2E, #1C1C1E); border: 1px solid #3A3A3C;
  position: relative; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.phone-frame .phone-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 12px; color: rgba(255,255,255,.55); font-size: 11px;
  line-height: 1.4; letter-spacing: .2px;
}
.phone-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Login page ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 400px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.06); padding: 40px 36px;
  display: flex; flex-direction: column; gap: 24px;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.login-brand img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 14px rgba(155,38,182,.3); }
.login-brand h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.4px; }
.login-brand p { margin: 0; font-size: 15px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-error {
  display: flex; align-items: center; gap: 8px; background: var(--danger-bg); border: 1px solid var(--danger-border);
  color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 500;
}
.login-error .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--danger-icon); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.remember-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.remember-row input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.login-submit { height: 46px; margin-top: 4px; }
.setup-note {
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 0.9rem 1rem;
  font-size: 0.85rem; color: #9a3412; line-height: 1.5;
}
.setup-note code { background: #ffedd5; padding: 0.1rem 0.35rem; border-radius: 4px; }
