/* ============================================================
   WallMint App CSS — design dashboard
   Builds on theme.css variables. Does NOT override theme.css.
   ============================================================ */

/* ---- APP SHELL ---- */
.app-body {
  background: var(--bg);
  min-height: 100vh;
}

/* ---- NAV ---- */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.app-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow);
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--fg); background: var(--bg-elevated); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }

.nav-btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: 7px 16px;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
  margin-left: 8px;
}
.nav-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ---- MAIN ---- */
.app-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 28px 80px;
}

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 20px;
}

.page-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 6px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.page-count {
  font-size: 1rem;
  color: var(--fg-muted);
  font-weight: 400;
}

/* ---- BUTTONS ---- */
.btn-primary {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-secondary {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.btn-secondary:hover { color: var(--fg); border-color: rgba(255,255,255,0.15); }

.btn-danger {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: #ff5555;
  background: rgba(255, 85, 85, 0.1);
  border: 1px solid rgba(255, 85, 85, 0.2);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover { background: rgba(255, 85, 85, 0.18); }

.btn-ghost {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--fg); }

/* ---- STAT GRID ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 24px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s;
}
.stat-card:hover { border-color: rgba(255,255,255,0.1); }

.stat-card--accent {
  background: var(--accent-dim);
  border-color: rgba(200, 245, 66, 0.15);
}
.stat-card--accent:hover { border-color: rgba(200, 245, 66, 0.28); }

.stat-number {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--fg);
  letter-spacing: -0.03em;
}
.stat-card--accent .stat-number { color: var(--accent); }

.stat-label {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 8px;
}

.stat-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
}
.etsy-badge { background: rgba(241, 100, 30, 0.15); color: #f1641e; }
.rb-badge   { background: rgba(226, 0, 41, 0.12);   color: #e20029; }
.pf-badge   { background: rgba(35, 97, 148, 0.18);  color: #5b9bd5; }

/* ---- DASH COLUMNS ---- */
.dash-cols {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dash-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.panel-count {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.panel-link {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.panel-link:hover { opacity: 0.75; }

/* Niche bars */
.niche-bars { display: flex; flex-direction: column; gap: 14px; }

.niche-row-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 5px;
}

.niche-name { color: var(--fg); }
.niche-count { color: var(--fg-muted); font-family: var(--font-display); font-weight: 600; }

.niche-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.niche-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4px;
}

/* Recent list */
.recent-list { display: flex; flex-direction: column; gap: 4px; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.recent-item:hover { background: var(--bg-card); }

.recent-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.recent-thumb-placeholder {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.recent-info { flex: 1; min-width: 0; }
.recent-title { font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }

.niche-tag {
  font-size: 0.72rem;
  color: var(--fg-muted);
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}

.platform-dots { display: flex; gap: 4px; align-items: center; }

.pdot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.pdot-etsy   { background: #f1641e; }
.pdot-rb     { background: #e20029; }
.pdot-pf     { background: #5b9bd5; }

.recent-edit {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.recent-edit:hover { color: var(--accent); border-color: rgba(200,245,66,0.25); }

/* Platform distribution chart */
.platform-panel { margin-top: 0; }

.platform-dist {
  display: flex;
  gap: 32px;
  align-items: flex-end;
  height: 120px;
  padding-bottom: 8px;
}

.plat-item { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }

.plat-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  max-height: 80px;
}

.plat-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  min-height: 6px;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.plat-bar--etsy { background: #f1641e; opacity: 0.8; }
.plat-bar--rb   { background: #e20029; opacity: 0.8; }
.plat-bar--pf   { background: #5b9bd5; opacity: 0.8; }

.plat-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
}
.plat-count { font-size: 0.72rem; color: var(--fg-muted); }

/* ---- EMPTY STATE ---- */
.empty-hint {
  font-size: 0.875rem;
  color: var(--fg-muted);
  padding: 16px 0;
}
.empty-hint a { color: var(--accent); text-decoration: none; }
.empty-hint a:hover { text-decoration: underline; }

.empty-state {
  text-align: center;
  padding: 80px 0;
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.empty-state p { color: var(--fg-muted); margin-bottom: 24px; }

/* ---- FILTER BAR ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter-btn:hover { color: var(--fg); border-color: rgba(255,255,255,0.12); }
.filter-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(200, 245, 66, 0.2);
}

.filter-search-wrap { margin-left: auto; }
.filter-search {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  outline: none;
  width: 220px;
  transition: border-color 0.2s;
}
.filter-search::placeholder { color: var(--fg-muted); }
.filter-search:focus { border-color: rgba(200,245,66,0.3); }

/* ---- DESIGN GRID ---- */
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.design-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s;
}
.design-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.design-card-image {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-card);
  overflow: hidden;
}
.design-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.design-card:hover .design-card-image img { transform: scale(1.03); }

.no-mockup {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.no-mockup-icon { font-size: 1.8rem; opacity: 0.25; }
.no-mockup-text { font-size: 0.75rem; color: var(--fg-muted); opacity: 0.5; }

.design-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}
.design-card:hover .design-card-overlay { opacity: 1; }

.overlay-btn {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--bg);
  transition: opacity 0.15s;
}
.overlay-btn:hover { opacity: 0.85; }
.overlay-btn--danger {
  background: rgba(255, 85, 85, 0.15);
  color: #ff5555;
  border: 1px solid rgba(255, 85, 85, 0.3);
}
.overlay-btn--danger:hover { background: rgba(255, 85, 85, 0.25); }

/* Overlay buy button: muted glass style so it doesn't compete with Edit */
.overlay-btn--buy {
  background: rgba(200, 245, 66, 0.15);
  color: var(--accent);
  border: 1px solid rgba(200, 245, 66, 0.3);
}
.overlay-btn--buy:hover { background: rgba(200, 245, 66, 0.25); }

/* Overlay edit: neutral glass, distinct from buy */
.overlay-btn--edit {
  background: rgba(255,255,255,0.08);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.12);
}
.overlay-btn--edit:hover { background: rgba(255,255,255,0.14); }

/* In-card buy CTA — full-width, shown below platform chips */
.card-buy-btn {
  display: block;
  margin-top: 12px;
  padding: 9px 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--bg);
  background: var(--accent);
  border-radius: 7px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}
.card-buy-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.design-card-body { padding: 16px; }

.design-card-niche {
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}

.design-card-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.design-card-platforms { display: flex; gap: 6px; flex-wrap: wrap; }

.platform-chip {
  font-size: 0.68rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.chip-etsy { background: rgba(241,100,30,0.14); color: #f1641e; }
.chip-rb   { background: rgba(226,0,41,0.12);   color: #e20029; }
.chip-pf   { background: rgba(35,97,148,0.18);  color: #5b9bd5; }
.chip-none { background: var(--bg-card); color: var(--fg-muted); }

/* ---- FORM ---- */
.form-container {
  max-width: 720px;
}

.design-form { display: flex; flex-direction: column; gap: 24px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}
.form-group--wide { min-width: 0; }

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
}
.required { color: var(--accent); }

.form-input, .form-select, .form-textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 11px 16px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(200,245,66,0.4);
  box-shadow: 0 0 0 3px rgba(200,245,66,0.06);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--fg-muted); }
.form-select option { background: var(--bg-card); }

.form-textarea { resize: vertical; min-height: 100px; }

.form-hint { font-size: 0.78rem; color: var(--fg-muted); }

/* Mockup preview */
.mockup-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  max-width: 360px;
}
.mockup-preview img {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* Platform checkboxes */
.platform-checks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.check-label:hover { border-color: rgba(255,255,255,0.12); }
.check-label input { display: none; }
.check-label input:checked ~ .check-box { border-color: var(--accent); background: var(--accent); }
.check-label input:checked ~ .check-box::after { opacity: 1; }

.check-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  flex-shrink: 0;
}
.check-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--bg);
  border-top: none;
  border-left: none;
  transform: rotate(40deg);
  opacity: 0;
  transition: opacity 0.15s;
}

.check-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
}
.check-etsy .check-name  { color: #f1641e; }
.check-rb   .check-name  { color: #e20029; }
.check-pf   .check-name  { color: #5b9bd5; }

.check-etsy input:checked ~ .check-box { background: #f1641e; border-color: #f1641e; }
.check-rb   input:checked ~ .check-box { background: #e20029; border-color: #e20029; }
.check-pf   input:checked ~ .check-box { background: #5b9bd5; border-color: #5b9bd5; }
.check-label input:checked ~ .check-box::after { opacity: 1; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols  { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-main { padding: 24px 16px 60px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .filter-search-wrap { margin-left: 0; width: 100%; }
  .filter-search { width: 100%; }
}
