/* =============================================
   THE VAULT — Memorabilia Collection Site
   styles.css
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&display=swap');

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

:root {
  --bg:        #0a0a0f;
  --surface:   #13131a;
  --surface2:  #1c1c26;
  --surface3:  #242432;
  --accent:    #e8b84b;
  --accent2:   #c9763a;
  --text:      #f0ede8;
  --muted:     #7a7890;
  --border:    #2a2a3a;
  --red:       #e05252;
  --teal:      #4bb8a0;
  --blue:      #5b8fe8;
  --purple:    #a07de8;
  --pink:      #e07da0;
  --green:     #6bc47a;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Navigation ── */
nav {
  background: linear-gradient(180deg, rgba(10,10,15,0.98) 0%, rgba(10,10,15,0) 100%);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--accent);
  flex-shrink: 0;
  text-shadow: 0 0 30px rgba(232,184,75,0.3);
  text-decoration: none;
  user-select: none;
}

.logo span { color: var(--text); opacity: 0.35; font-size: 0.85em; }

.nav-actions { display: flex; gap: 0.75rem; align-items: center; }

.btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  border-color: var(--accent);
  font-weight: 700;
}

.btn-primary:hover { background: #f0c860; border-color: #f0c860; color: #0a0a0f; }

.btn-danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn-danger:hover { background: rgba(224,82,82,0.1); }

/* ── Hero Section ── */
.hero {
  padding: 3rem 2rem 2rem;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(232,184,75,0.08) 0%, transparent 70%);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.hero h1 em { color: var(--accent); font-style: normal; }
.hero > p { color: var(--muted); font-size: 1rem; margin-bottom: 2rem; font-weight: 300; }

/* ── Search Bar ── */
.search-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  transition: border-color var(--transition);
}

.search-bar:focus-within { border-color: rgba(232,184,75,0.4); }

.search-input-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-icon { color: var(--muted); font-size: 1.1rem; flex-shrink: 0; }

.search-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
}

.search-input-wrap input::placeholder { color: var(--muted); }

.divider { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }

.filter-select {
  background: transparent;
  border: none;
  outline: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  appearance: none;
  -webkit-appearance: none;
  transition: color var(--transition);
}

.filter-select:hover { color: var(--text); }
.filter-select option { background: #1c1c26; color: var(--text); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.tab:hover { color: var(--text); border-color: var(--border); }
.tab.active { background: var(--accent); color: #0a0a0f; border-color: var(--accent); font-weight: 600; }

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.stat { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.stat strong { color: var(--text); font-size: 1.05rem; font-weight: 600; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Section ── */
.section { margin-bottom: 3rem; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 1.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.type-pill {
  font-family: var(--font-body);
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

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

/* ── Items Grid ── */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.2rem;
}

/* ── Item Card ── */
.item-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.item-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(232,184,75,0.15);
}

.item-card:hover .card-overlay { opacity: 1; }

.card-art {
  width: 100%;
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-art-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 0.5rem;
  z-index: 1;
  position: relative;
}

.card-art-icon { font-size: 2.8rem; line-height: 1; }

.card-art-year {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10,10,15,0.92) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  z-index: 2;
}

.overlay-btn {
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  width: 100%;
  transition: background var(--transition);
}

.overlay-btn:hover { background: #f0c860; }

.card-info { padding: 0.75rem; }

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

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

.card-meta { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.card-year { font-size: 0.73rem; color: var(--muted); }

.card-condition {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── Art Backgrounds ── */
.art-dvd      { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.art-cd       { background: linear-gradient(135deg, #0d1117 0%, #1a1a2e 50%, #2d1b69 100%); }
.art-vinyl    { background: linear-gradient(135deg, #0a0a0a 0%, #1a0a0a 50%, #2d0a0a 100%); }
.art-vhs      { background: linear-gradient(135deg, #0a1a0a 0%, #0f2b1a 50%, #133a20 100%); }
.art-poster   { background: linear-gradient(135deg, #1a0a1a 0%, #2d0f2d 50%, #3d1a0f 100%); }
.art-game     { background: linear-gradient(135deg, #0a0a1a 0%, #1a0f2d 50%, #0f1a3d 100%); }
.art-book     { background: linear-gradient(135deg, #1a1200 0%, #2d2010 50%, #3d2d05 100%); }
.art-magazine { background: linear-gradient(135deg, #1a0505 0%, #2d0a10 50%, #3d0a1a 100%); }

/* ── Condition Classes ── */
.cond-mint    { background: rgba(75,184,160,0.15); color: var(--teal); }
.cond-vg      { background: rgba(91,143,232,0.15); color: var(--blue); }
.cond-good    { background: rgba(160,125,232,0.15); color: var(--purple); }
.cond-fair    { background: rgba(232,184,75,0.15); color: var(--accent); }

/* ── Type Pill Colors ── */
.pill-dvd      { background: rgba(91,143,232,0.15); color: var(--blue); }
.pill-cd       { background: rgba(160,125,232,0.15); color: var(--purple); }
.pill-vinyl    { background: rgba(224,82,82,0.15); color: var(--red); }
.pill-vhs      { background: rgba(75,184,160,0.15); color: var(--teal); }
.pill-poster   { background: rgba(224,125,160,0.15); color: var(--pink); }
.pill-game     { background: rgba(91,143,232,0.2); color: #7eb0ff; }
.pill-book     { background: rgba(232,184,75,0.15); color: var(--accent); }
.pill-magazine { background: rgba(224,82,82,0.12); color: #ff9090; }

/* ── Modal ── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-bg.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  position: relative;
  animation: modalIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { transform: scale(0.95) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-art {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  position: relative;
}

.modal-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(0deg, var(--surface), transparent);
}

.modal-body { padding: 1.5rem; }

.modal-title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 2px;
  margin-bottom: 0.2rem;
  line-height: 1.1;
}

.modal-artist { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }

.modal-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

.modal-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-field label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 2px;
}

.modal-field span { font-size: 0.95rem; font-weight: 500; }

.modal-notes {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 0.75rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--border);
}

.modal-actions { display: flex; gap: 0.5rem; }

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 10;
}

.modal-close:hover { background: rgba(255,255,255,0.12); }

/* ── Add / Edit Form Modal ── */
.form-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  position: relative;
  animation: modalIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
}

.form-modal h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
}

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

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group select option { background: var(--surface2); }
.form-group textarea { resize: vertical; min-height: 80px; }

.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── Empty State ── */
.empty { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty p { font-size: 1rem; margin-bottom: 0.5rem; }
.empty small { font-size: 0.83rem; opacity: 0.6; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  z-index: 999;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.success { border-color: var(--teal); color: var(--teal); }
.toast.error   { border-color: var(--red); color: var(--red); }

@keyframes toastIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Image Upload ── */
.img-upload-area {
  grid-column: 1 / -1;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  background: var(--surface2);
}

.img-upload-area:hover { border-color: var(--accent); background: rgba(232,184,75,0.04); }
.img-upload-area.has-image { border-style: solid; border-color: rgba(232,184,75,0.4); padding: 0; overflow: hidden; }
.img-upload-area input[type="file"] { display: none; }

.img-upload-placeholder { pointer-events: none; }
.img-upload-icon { font-size: 2rem; margin-bottom: 0.4rem; opacity: 0.5; }
.img-upload-label { font-size: 0.82rem; color: var(--muted); display: block; margin-bottom: 0.25rem; }
.img-upload-hint  { font-size: 0.72rem; color: var(--muted); opacity: 0.6; }

.img-preview-wrap { position: relative; }
.img-preview-wrap img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
  border-radius: calc(var(--radius-md) - 2px);
}

.img-remove-btn {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  background: rgba(10,10,15,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.img-remove-btn:hover { background: rgba(224,82,82,0.7); }

/* Card art with image */
.card-art.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Modal art with image */
.modal-art.has-img { padding: 0; }
.modal-art.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Main Layout ── */
main { padding: 0 2rem 5rem; }

/* ── Responsive ── */
@media (max-width: 700px) {
  nav, main, .hero { padding-left: 1rem; padding-right: 1rem; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr 1fr; }
  .nav-actions .btn-label { display: none; }
}

@media (max-width: 420px) {
  .items-grid { grid-template-columns: repeat(2, 1fr); }
}
