/* ================================================================
   MUSE AI Gallery System — Dark Futuristic Theme
   ================================================================ */

:root {
  --bg:        #0a0a14;
  --bg2:       #0f0f1e;
  --bg3:       #161626;
  --border:    rgba(139,92,246,.22);
  --purple:    #8b5cf6;
  --purple-d:  #7c3aed;
  --gold:      #f59e0b;
  --text:      #f3f4f6;
  --muted:     #9ca3af;
  --success:   #10b981;
  --danger:    #ef4444;
  --radius:    14px;
  --shadow:    0 8px 32px rgba(0,0,0,.5);
}

/* ── Reset ─────────────────────────────────────────────────────── */
.muse-upload-body,
.muse-gallery-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Logo ──────────────────────────────────────────────────────── */
.muse-wordmark-link { display: block; text-decoration: none; }
.muse-wordmark {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}
.muse-footer-wordmark {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* ── Photographer branding ─────────────────────────────────────── */
.muse-ph-logo { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.muse-ph-logo img {
  max-height: 44px;
  max-width: 200px;
  object-fit: contain;
  display: block;
}
.muse-ph-logo-nav { flex-direction: row; align-items: center; gap: 8px; }
.muse-ph-logo-nav img { max-height: 36px; }
.muse-powered-badge {
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: .3px;
  white-space: nowrap;
}

/* ================================================================
   UPLOAD PAGE
   ================================================================ */
.muse-upload-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.muse-up-header {
  text-align: center;
  padding: 32px 16px 28px;
}

.muse-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139,92,246,.15);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 14px;
}
.ev-emoji { font-size: 1.1rem; }

.muse-ev-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #fff 60%, var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.muse-ev-date {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.muse-ev-msg {
  font-size: 1rem;
  color: #d1d5db;
  margin: 0 0 18px;
  line-height: 1.6;
}

.muse-count-pill {
  display: inline-block;
  background: linear-gradient(135deg, rgba(139,92,246,.2), rgba(245,158,11,.12));
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 0.9rem;
}
.count-n {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  margin-right: 4px;
}

/* ── Upload Card ─────────────────────────────────────────────── */
.muse-up-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

/* ── Form Fields ─────────────────────────────────────────────── */
.muse-field {
  margin-bottom: 18px;
}
.muse-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.muse-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.muse-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}
.muse-input::placeholder { color: var(--muted); }
select.muse-input option { background: #1a1a2e; }

/* ── Drop Zone ───────────────────────────────────────────────── */
.muse-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
  margin-bottom: 20px;
}
.muse-drop-zone:hover,
.muse-drop-zone.drag-over {
  border-color: var(--purple);
  background: rgba(139,92,246,.05);
}
.dz-icon { font-size: 2.8rem; margin-bottom: 10px; }
.dz-text { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.dz-sub  { font-size: 0.82rem; color: var(--muted); }

.dz-btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.dz-btn { padding: 10px 20px; font-size: 0.9rem; }

/* ── Multi-photo preview grid ────────────────────────────────── */
.muse-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
@media (min-width: 400px) {
  .muse-preview-grid { grid-template-columns: repeat(4, 1fr); }
}
.preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
}
.preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s;
}
.preview-remove:hover { background: var(--danger); }
.preview-status {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.status-ok   { display: flex; background: var(--success); color: #fff; }
.status-fail { display: flex; background: var(--danger);  color: #fff; }

/* ── Progress ────────────────────────────────────────────────── */
.muse-progress-wrap { margin-bottom: 20px; }
.muse-progress-bar {
  background: var(--bg3);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.muse-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  border-radius: 100px;
  transition: width .3s ease;
}
.muse-progress-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* ── Error ───────────────────────────────────────────────────── */
.muse-error-msg {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 8px;
  color: #fca5a5;
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.muse-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple), var(--purple-d));
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: 0 4px 20px rgba(139,92,246,.35);
}
.muse-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(139,92,246,.5);
}
.muse-btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.muse-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.muse-btn-ghost:hover {
  border-color: var(--purple);
  color: var(--text);
}
.muse-btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ── Success State ───────────────────────────────────────────── */
.muse-success-wrap {
  text-align: center;
  padding: 48px 24px;
  animation: fadeIn .4s ease;
}
.success-burst { font-size: 4rem; margin-bottom: 16px; }
.success-title { font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; }
.success-count { color: var(--muted); margin-bottom: 28px; }
.success-actions { display: flex; flex-direction: column; gap: 12px; max-width: 320px; margin: 0 auto; }

/* ── Footer ──────────────────────────────────────────────────── */
.muse-up-footer,
.muse-gal-footer {
  text-align: center;
  padding: 28px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.muse-footer-brand {
  font-weight: 900;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.muse-footer-brand span { color: var(--purple); }

/* ================================================================
   GALLERY PAGE
   ================================================================ */
.muse-gal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,20,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.muse-gal-hero {
  background: linear-gradient(180deg, rgba(139,92,246,.12) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 36px;
  text-align: center;
}
.gal-hero-inner { max-width: 600px; margin: 0 auto; }
.gal-ev-emoji   { font-size: 3rem; margin-bottom: 8px; }
.gal-ev-name    { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 800; margin: 0 0 6px; }
.gal-ev-date    { color: var(--muted); margin-bottom: 20px; }

.gal-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}
.gal-stat { text-align: center; }
.stat-n   { font-size: 1.8rem; font-weight: 800; display: block; color: var(--gold); }
.stat-lbl { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.gal-stat-divider { width: 1px; height: 36px; background: var(--border); }
.gal-hero-cta { color: var(--muted); font-size: 0.95rem; }

/* ── Photo Grid ──────────────────────────────────────────────── */
.muse-gal-container { max-width: 1200px; margin: 0 auto; padding: 32px 16px; }
.muse-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.photo-cell { position: relative; border-radius: 10px; overflow: hidden; }
.photo-thumb-wrap { position: relative; aspect-ratio: 1; overflow: hidden; }
.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
  display: block;
}
.photo-cell:hover .photo-thumb { transform: scale(1.04); }

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  transition: opacity .25s;
}
.photo-cell:hover .photo-overlay { opacity: 1; }

.photo-buy-btn {
  background: linear-gradient(135deg, var(--purple), var(--purple-d));
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s;
}
.photo-buy-btn:hover { transform: scale(1.04); }

.photo-meta {
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty state */
.gal-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.gal-empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.gal-empty p { margin-bottom: 20px; }

/* Load more */
.gal-load-more { text-align: center; margin-top: 32px; }

/* ── Product Modal ───────────────────────────────────────────── */
.muse-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .2s ease;
}
.muse-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}

@media (max-width: 600px) {
  .muse-modal { grid-template-columns: 1fr; }
  .modal-preview-col { display: none; }
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--text);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
  transition: background .15s;
}
.modal-close-btn:hover { background: rgba(255,255,255,.2); }

.modal-preview-col {
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.modal-photo {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 8px;
}
.modal-actions-col { padding: 32px 28px; }
.modal-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 6px; padding-right: 36px; }
.modal-sub   { font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }

.modal-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.modal-product-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.modal-product-btn:hover {
  border-color: var(--purple);
  background: rgba(139,92,246,.08);
  color: var(--text);
}
.modal-note { font-size: 0.8rem; color: var(--muted); text-align: center; }

/* ================================================================
   PHOTOGRAPHER DASHBOARD
   ================================================================ */
.muse-dashboard {
  padding: 8px 0 40px;
}
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-title { font-size: 1.4rem; font-weight: 700; margin: 0; }

/* Create Form */
.dash-create-form {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 28px;
  animation: slideDown .25s ease;
}
.form-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 20px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.muse-field-toggle { display: flex; flex-direction: column; gap: 6px; }
.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
}
.toggle-label input[type=checkbox] { display: none; }
.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  flex-shrink: 0;
  position: relative;
  transition: background .2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .2s, background .2s;
}
.toggle-label input:checked ~ .toggle-track { background: var(--purple); border-color: var(--purple); }
.toggle-label input:checked ~ .toggle-track::after {
  transform: translateX(20px);
  background: #fff;
}
.field-hint { font-size: 0.8rem; color: var(--muted); margin: 0; }
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}
.form-actions .muse-btn-primary,
.form-actions .muse-btn-ghost { width: auto; }

/* New event result */
.dash-new-result { margin-bottom: 28px; animation: fadeIn .35s ease; }
.new-result-inner {
  background: var(--bg2);
  border: 1px solid rgba(139,92,246,.4);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.new-result-icon { font-size: 3rem; margin-bottom: 12px; }
.qr-result-box {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  text-align: left;
  background: var(--bg3);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}
@media (max-width: 480px) { .qr-result-box { flex-direction: column; align-items: center; text-align: center; } }
.qr-preview { width: 120px; height: 120px; border: 4px solid var(--border); border-radius: 8px; flex-shrink: 0; }
.qr-result-links p { margin: 0 0 12px; font-size: 0.9rem; }
.muse-link { color: var(--purple); word-break: break-all; }
.new-result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.new-result-actions .muse-btn-primary,
.new-result-actions .muse-btn-ghost { width: auto; }

/* Events list */
.dash-events-list { display: flex; flex-direction: column; gap: 16px; }
.dash-event-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .2s;
}
.dash-event-card:hover { border-color: rgba(139,92,246,.4); }

.ev-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.ev-card-type { font-size: 0.78rem; font-weight: 600; color: var(--purple); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.ev-card-name { font-size: 1.15rem; font-weight: 700; margin: 0 0 3px; }
.ev-card-date { font-size: 0.85rem; color: var(--muted); margin: 0; }

.ev-card-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 100px;
  flex-shrink: 0;
}
.ev-status-active   { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.ev-status-inactive { background: rgba(107,114,128,.15); color: var(--muted); border: 1px solid var(--border); }
.ev-status-deleted  { background: rgba(239,68,68,.1); color: #f87171; border: 1px solid rgba(239,68,68,.2); }

/* Progress */
.ev-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ev-progress-bar {
  flex: 1;
  background: var(--bg3);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
}
.ev-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  border-radius: 100px;
  transition: width .5s ease;
}
.ev-progress-label { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

/* QR row */
.ev-qr-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg3);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.ev-qr-img { width: 76px; height: 76px; border-radius: 6px; border: 2px solid var(--border); flex-shrink: 0; }
.ev-qr-info { flex: 1; min-width: 0; }
.ev-qr-label { font-size: 0.78rem; color: var(--muted); margin: 0 0 4px; }
.ev-upload-url a { font-size: 0.8rem; color: var(--purple); word-break: break-all; }

/* Actions row */
.ev-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Empty state */
.dash-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.dash-empty-icon { font-size: 3.5rem; margin-bottom: 14px; }
.dash-empty h3 { margin-bottom: 8px; }
.dash-empty p  { color: var(--muted); margin-bottom: 24px; }
.dash-empty .muse-btn-primary { width: auto; display: inline-flex; }

.muse-success-inline {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 8px;
  color: #6ee7b7;
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-top: 14px;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .muse-photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .muse-gal-nav { padding: 12px 16px; }
  .muse-gal-hero { padding: 32px 16px 24px; }
}
