
/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --bg:           #020705;
  --surface:      #061009;
  --surface-2:    #09160c;
  --border:       #0f2214;
  --border-hover: #1e4028;
  --text:         #e8e0d0;
  --muted:        #7a8c80;
  --accent:       #c0392b;
  --accent-h:     #e74c3c;
  --positive:     #27ae60;
  --negative:     #c0392b;
  --neutral:      #7a8c80;
  --radius:       8px;
  --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img { display: block; max-width: 100%; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page {
  padding: 2rem 0 4rem;
  flex: 1;
}

/* ── Nav ── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); color: #fff; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--text); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--negative);
  color: var(--negative);
}
.btn-danger:hover { background: var(--negative); color: #fff; }

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.925rem;
  font-family: var(--font);
  transition: border-color 0.15s;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--text);
}

textarea { resize: vertical; min-height: 90px; }

select option { background: var(--surface); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Cards ── */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* ── Listing grid ── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.listing-card:hover { border-color: var(--border-hover); }

.listing-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--border);
}

.listing-card-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2rem;
}

.listing-card-body { padding: 1rem; flex: 1; }

.listing-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-card-artist {
  color: var(--muted);
  font-size: 0.825rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Listing card image carousel ── */
.listing-card-carousel {
  position: relative;
  overflow: hidden;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: #fff;
  width: 28px;
  height: 44px;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  z-index: 10;
  padding: 0;
}

.listing-card-carousel:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: rgba(0, 0, 0, 0.82); }
.carousel-btn-prev { left: 0; border-radius: 0 4px 4px 0; }
.carousel-btn-next { right: 0; border-radius: 4px 0 0 4px; }

.carousel-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 10;
  pointer-events: none;
}

.carousel-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.15s;
}

.carousel-dot.active { background: rgba(255, 255, 255, 0.9); }

/* Always show arrows slightly on touch devices */
@media (hover: none) {
  .carousel-btn { opacity: 0.65; }
}

/* ── Tags / badges ── */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  background: var(--border);
  color: var(--muted);
}

.tag-format { background: #1e2a1e; color: #6abf69; }
.tag-condition { background: #1e1e2a; color: #7986cb; }

.genre-tag-link { cursor: pointer; }

@keyframes genre-highlight {
  0%, 40% { background: rgba(39, 174, 96, 0.55); }
  100% { background: rgba(39, 174, 96, 0.15); }
}
.genre-picker label.genre-highlight {
  animation: genre-highlight 1s ease forwards;
}

/* ── Page headings ── */
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ── Auth pages ── */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.auth-box {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2rem;
}

.auth-logo span { color: var(--accent); }

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-footer a { color: var(--text); text-decoration: underline; }

/* ── Filters bar ── */
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filters input,
.filters select {
  width: auto;
  flex: 1;
  min-width: 140px;
}

/* ── Inbox ── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
  transition: color 0.15s;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.proposal-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.proposal-item:last-child { border-bottom: none; }

.proposal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}

.proposal-row:hover { background: var(--surface); color: var(--text); }
.proposal-row:last-child { border-bottom: none; }

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}

.status-pending         { background: #2a2000; color: #f0a500; }
.status-accepted        { background: #0d2b0d; color: #4caf50; }
.status-declined        { background: #2b0d0d; color: #e57373; }
.status-awaiting-rating { background: #1a1200; color: #ffb300; }
.status-completed       { background: #2a2a2a; color: var(--muted); }

/* ── Conversation thread ── */
.thread { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }

.thread-msg {
  max-width: 80%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.thread-msg.mine {
  align-self: flex-end;
  background: #1c1c2e;
  border: 1px solid #2d2d4e;
}

.thread-msg.theirs {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
}

.thread-msg-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* ── Multi-photo upload ── */
.photo-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
}

.photo-thumb.is-cover { border-color: var(--accent); }

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-cover-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  pointer-events: none;
}

.photo-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}

.photo-remove-btn:hover { background: var(--accent); }

/* ── Genre picker ── */
.genre-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: #888 #3a3a3a;
}
.genre-picker::-webkit-scrollbar { width: 6px; }
.genre-picker::-webkit-scrollbar-track { background: #3a3a3a; border-radius: 3px; }
.genre-picker::-webkit-scrollbar-thumb { background: #888; border-radius: 3px; }
.genre-picker::-webkit-scrollbar-thumb:hover { background: #aaa; }
.genre-picker label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.925rem;
  font-weight: 400;
  width: auto;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
}
.genre-picker label:hover { background: var(--border); }
.genre-picker label.selected {
  background: rgba(39,174,96,0.15);
}
.genre-picker label.genre-parent {
  font-weight: 700;
  font-size: 0.975rem;
  margin-top: 0.2rem;
  border-top: 1px solid var(--border);
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}
.genre-picker label.genre-parent:first-child { border-top: none; margin-top: 0; }
.genre-picker label.genre-sub { padding-left: 1.25rem; }
.genre-picker input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  min-width: 14px;
  flex: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border: 1.5px solid #4a6a54;
  border-radius: 3px;
  background: transparent;
}
.genre-picker input[type="checkbox"]:checked {
  background: #27ae60;
  border-color: #27ae60;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 7l3.5 3.5L12 4' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
}
.genre-picker input[type="checkbox"]:disabled { opacity: 0.4; cursor: not-allowed; }
.genre-picker input[type="checkbox"]:disabled + span { opacity: 0.5; }

/* ── Profile header ── */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }
.profile-info h1 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.profile-info .location { color: var(--muted); font-size: 0.875rem; }

/* ── Alerts ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-error   { background: #2b0d0d; border: 1px solid #7f2020; color: #e57373; }
.alert-success { background: #0d2b0d; border: 1px solid #206020; color: #81c784; }
.alert-info    { background: #0d1f2b; border: 1px solid #204060; color: #64b5f6; }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.empty h3 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text); }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text); }

/* ── User cards (browse page) ── */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}

.user-card:hover { border-color: var(--border-hover); }

.user-card-thumbs {
  display: grid;
  height: 110px;
  overflow: hidden;
  background: var(--border);
}

.user-card-thumbs img {
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.user-card-thumbs-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  background: var(--border);
}

.user-card-body { padding: 0.85rem 1rem; }

.user-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}

.user-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.user-card-org {
  font-size: 0.78rem;
  color: var(--muted);
}

.user-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.user-card-count {
  background: var(--border);
  color: var(--text);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Genre filter dropdown ── */
#genre-filter-panel input[type="checkbox"] {
  width: 14px;
  max-width: 14px;
  height: 14px;
  max-height: 14px;
  min-width: 14px;
  flex: none;
}

.genre-filter-wrapper {
  position: relative;
  flex: 1;
  min-width: 140px;
}

.genre-filter-btn {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.925rem;
  font-family: var(--font);
  transition: border-color 0.15s;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.genre-filter-btn:focus,
.genre-filter-btn.active {
  outline: none;
  border-color: var(--text);
}

.genre-filter-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  min-width: 220px;
  max-height: 260px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
  .filters input, .filters select { width: 100%; }
  .genre-filter-wrapper { width: 100%; }
  .nav-links { gap: 1rem; }
  .profile-header { flex-direction: column; }
  .listings-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .listings-grid { grid-template-columns: 1fr; }
}

/* ── Inbox badge ── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1;
}

/* ── Password toggle ── */
.input-wrap {
  position: relative;
}
.input-wrap input {
  padding-right: 2.75rem;
}
.toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.toggle-password:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  border-bottom: 1px solid var(--border);
  padding: 5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 350px at 90% 60%, rgba(192,57,43,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 500px 400px at -5% 80%, rgba(27,90,50,0.15) 0%, transparent 65%);
  pointer-events: none;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.hero-sub {
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 2.25rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ── Page title refinements ── */
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.25rem;
}

/* ── Nav logo sizing ── */
.nav-logo img { height: 52px; margin-left: -1.75rem; }

/* ── Hamburger button (hidden on desktop) ── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .nav-logo img { margin-left: 0; }
  .container { padding: 0 1.75rem; }
}

@media (max-width: 600px) {
  .nav-hamburger { display: flex; }
  .hero { padding: 1.5rem 0 1.25rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    color: var(--text);
  }
  .nav-links .btn-primary {
    background: none;
    color: var(--text);
    border: none;
    font-weight: 400;
    border-radius: 0;
  }
}
