/* ============================================================
   VINYL LIBRARY — Dark Premium Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* === CSS Variables ======================================== */
:root {
  --bg-primary:     #0d0d0d;
  --bg-surface:     #141414;
  --bg-card:        #1c1c1c;
  --bg-card-hover:  #222222;
  --bg-elevated:    #272727;

  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.11);
  --border-gold:    rgba(201, 168, 76, 0.4);

  --gold:           #c9a84c;
  --gold-light:     #e0c470;
  --gold-dim:       rgba(201, 168, 76, 0.12);

  --text-primary:   #f0f0f0;
  --text-secondary: #9a9a9a;
  --text-muted:     #4e4e4e;

  --danger:         #c0392b;
  --danger-bg:      rgba(192, 57, 43, 0.15);
  --danger-border:  rgba(192, 57, 43, 0.35);
  --success:        #27ae60;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  22px;

  --transition: 180ms ease;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.65);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--gold-light); }

.hidden { display: none !important; }

/* === Navigation =========================================== */
.nav {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.03em;
}
.nav-brand:hover { color: var(--gold-light); }
.nav-brand i { font-size: 1.35rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-user {
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.5rem;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--border-subtle);
}

/* === Alerts / Messages ==================================== */
.messages {
  max-width: 1240px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}
.alert i { color: var(--gold); }

/* === Main Layout ========================================= */
.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem;
}

/* === Page Header ========================================= */
.page-header { margin-bottom: 2rem; }

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.page-header h1 i { color: var(--gold); font-size: 1.6rem; }

.page-header p {
  color: var(--text-secondary);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

/* === Collection Header =================================== */
.collection-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.collection-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.collection-desc {
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

/* === Stats Grid ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.stat-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}
.stat-card-label i { color: var(--gold); font-size: 0.8rem; }

.stat-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* === Collection Controls ================================= */
.collection-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* === Vinyl Grid ========================================== */
.vinyl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1.25rem;
}

.vinyl-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.vinyl-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}

/* === Vinyl Disc Design ==================================== */
.vinyl-disc-wrap {
  padding: 1rem;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-disc {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  /* Grooves: repeating rings over dark base */
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0)     0px,
      rgba(255, 255, 255, 0)     4px,
      rgba(255, 255, 255, 0.022) 4px,
      rgba(255, 255, 255, 0.022) 5px
    ),
    #0e0e0e;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.8),
    0 8px 40px rgba(0, 0, 0, 0.9);
  transition: transform 0.4s ease;
}

/* Light reflection */
.vinyl-disc::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 32% 18%,
    rgba(255, 255, 255, 0.09) 0%,
    transparent 55%
  );
  z-index: 4;
  pointer-events: none;
}

/* Center spindle hole */
.vinyl-disc::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6%;
  height: 6%;
  border-radius: 50%;
  background: #080808;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.9);
  z-index: 5;
}

/* Album art label (center circle) */
.vinyl-disc-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  height: 40%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
}
.vinyl-disc-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vinyl-disc-label-placeholder {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #2a2a2a, #181818);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vinyl-disc-label-placeholder i {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Spin on hover */
.vinyl-card:hover .vinyl-disc {
  animation: vinyl-spin 5s linear infinite;
}
@keyframes vinyl-spin {
  to { transform: rotate(360deg); }
}

.vinyl-card-body {
  padding: 0.875rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.vinyl-card-artist {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vinyl-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vinyl-card-year {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.vinyl-card-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  margin-top: auto;
  padding-top: 0.5rem;
}

/* === Empty State ========================================= */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
}
.empty-state i {
  font-size: 4rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 1.25rem;
}
.empty-state h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === Buttons ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--gold);
  color: #0a0a0a;
}
.btn-primary:hover { background: var(--gold-light); color: #0a0a0a; }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-bg);
  color: #e74c3c;
  border: 1px solid var(--danger-border);
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--border-subtle); color: var(--text-primary); }

.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }

/* === Back Link =========================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.75rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--gold); }

/* === Vinyl Detail Layout ================================= */
.detail-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* === Vinyl Detail Cover (large disc) ===================== */
.detail-cover {
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0)     0px,
      rgba(255, 255, 255, 0)     5px,
      rgba(255, 255, 255, 0.02)  5px,
      rgba(255, 255, 255, 0.02)  6px
    ),
    #0e0e0e;
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.9),
    0 12px 60px rgba(0, 0, 0, 0.9);
  aspect-ratio: 1;
  position: relative;
}

/* Reflection */
.detail-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 30% 18%,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 55%
  );
  z-index: 4;
  pointer-events: none;
}

/* Center spindle hole */
.detail-cover::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5%;
  height: 5%;
  border-radius: 50%;
  background: #080808;
  z-index: 5;
}

/* Large label (album art in center of detail disc) */
.detail-cover-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42%;
  height: 42%;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.1);
}
.detail-cover-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-cover-label-placeholder {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #2a2a2a, #181818);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-cover-label-placeholder i {
  font-size: 3rem;
  color: var(--text-muted);
}

/* Slow ambient spin on detail page */
.detail-cover-spinning {
  animation: vinyl-spin 18s linear infinite;
}

.detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}
.detail-artist {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--gold);
  margin-bottom: 1.75rem;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.detail-info-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}
.detail-info-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}
.detail-info-label i { color: var(--gold); }
.detail-info-value {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-value-card {
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-value-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.detail-value-amount {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold-light);
}

.detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* === Notes Section ======================================= */
.notes-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}
.notes-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.notes-section h2 i { color: var(--gold); }

.notes-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.notes-card h3 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.notes-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
}

/* === Star Rating ========================================= */
.stars { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }
.stars .star-filled { color: var(--gold); font-size: 1.1rem; }
.stars .star-empty  { color: var(--text-muted); font-size: 1.1rem; }

/* === Forms =============================================== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 700px;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.form-label .required { color: var(--gold); margin-left: 0.15rem; }

/* Override Django-rendered form widgets */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.625rem 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
select option { background: var(--bg-elevated); color: var(--text-primary); }

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

.form-error {
  color: #e74c3c;
  font-size: 0.8rem;
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.form-help {
  color: var(--text-muted);
  font-size: 0.775rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* === Auth Pages ========================================== */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-card);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo i {
  font-size: 3rem;
  color: var(--gold);
  display: block;
  margin-bottom: 0.75rem;
}
.auth-logo span {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.auth-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}
.auth-card .subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* === Mobile Navigation (footer) ========================= */
.mobile-nav {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
  /* Show mobile nav */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding-bottom: env(safe-area-inset-bottom, 0); /* iPhone notch */
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.6rem 0.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: color var(--transition);
    position: relative;
  }

  .mobile-nav-item i {
    font-size: 1.2rem;
    display: block;
    transition: transform var(--transition), color var(--transition);
  }

  .mobile-nav-item:hover,
  .mobile-nav-item.active {
    color: var(--gold);
  }

  .mobile-nav-item.active i {
    transform: translateY(-1px);
  }

  /* Active indicator dot */
  .mobile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0.35rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
  }

  /* "Ajouter" button — accent visuel */
  .mobile-nav-add i {
    background: var(--gold);
    color: #0a0a0a;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.1rem;
    transition: background var(--transition), transform var(--transition);
  }

  .mobile-nav-add:hover i,
  .mobile-nav-add.active i {
    background: var(--gold-light);
    transform: scale(1.08);
  }

  .mobile-nav-add.active::after { display: none; }

  /* Push main content above the nav bar */
  .main {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  }

  /* Hide desktop nav links on mobile (keep brand) */
  .nav-links { display: none; }

  /* Scanner tabs */
  .scanner-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.4rem;
  }

  .scanner-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
  }

  .scanner-tab-btn.active {
    background: var(--bg-elevated);
    color: var(--gold);
    border: 1px solid var(--border-gold);
  }

  .scanner-tab-btn i { font-size: 0.85rem; }

  /* On mobile, scanner sections are managed by tabs */
  .scanner-layout {
    display: block;  /* no grid on mobile */
  }

  .scanner-section-full { grid-column: unset; }
}


.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;           /* single line on desktop */
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
}
.filter-search {
  position: relative;
  flex: 1;
  min-width: 0;                /* let it shrink */
}
.filter-search i {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.75rem;
  pointer-events: none;
}
.filter-search input {
  padding-left: 2rem;
  width: 100%;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.82rem;
}
.filter-select {
  flex-shrink: 0;
  width: auto;
  min-width: 0;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.82rem;
}
.filter-count {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
  min-width: 3rem;
  text-align: right;
}
.card-hidden { display: none !important; }
.btn-link {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
}
.btn-link:hover { color: var(--gold-light); }

/* === Scanner ============================================= */
.scanner-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.875rem;
  line-height: 1.5;
}
.scanner-section-full { grid-column: 1 / -1; }
.search-input-wrap { max-width: 600px; }

/* Tabs — hidden on desktop, shown on mobile */
@media (min-width: 769px) {
  .scanner-tabs { display: none; }
}

/* Section hidden by JS on mobile when another tab is active */
.tab-hidden { display: none !important; }

.scanner-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.scanner-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.scanner-section h2 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.scanner-section h2 i { color: var(--gold); }

.scanner-video-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  width: 100%;
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanner-video-wrap > div { width: 100% !important; }
.scanner-video-wrap video { width: 100% !important; height: auto !important; display: block; }

.scanner-controls { display: flex; gap: 0.75rem; }
.manual-input-wrap { display: flex; gap: 0.75rem; }
.manual-input-wrap input { flex: 1; }

/* === Results ============================================= */
.results-section { margin-top: 0.5rem; }
.results-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.results-section h2 i { color: var(--gold); }

/* Results use the same vinyl-grid layout */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1.25rem;
}

/* Result card inherits vinyl-card styles, just adds the button */
.result-vinyl-card {
  cursor: default;
  display: flex;
  flex-direction: column;
}
.result-vinyl-card .vinyl-disc-wrap {
  max-height: 220px;
  overflow: hidden;
}
.result-vinyl-card:hover { transform: none; box-shadow: none; border-color: var(--border-subtle); }
.result-vinyl-card .vinyl-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.result-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}
.result-card-meta-row span {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.result-card-meta-row i { color: var(--text-muted); font-size: 0.65rem; }

.result-add-btn {
  width: 100%;
  justify-content: center;
  margin-top: auto;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.vinyl-price-stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.price-min  { color: #6ec97a; }
.price-avg  { color: var(--gold); }
.price-max  { color: #e07b7b; }
.price-loading { color: var(--text-muted); }

/* === Loading & Error ===================================== */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 2rem;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-default);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  color: #e74c3c;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* === Delete Page ========================================= */
.delete-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 520px;
}
.delete-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #e74c3c;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.delete-vinyl-info {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.delete-vinyl-info .dv-artist {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 0.2rem;
}
.delete-vinyl-info .dv-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}
.delete-vinyl-info .dv-year {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.delete-warning {
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}
.delete-warning i { color: #e8a000; margin-top: 0.2rem; flex-shrink: 0; }

/* === Scan Notification =================================== */
.scan-notification {
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  color: var(--gold-light);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* === Responsive ========================================= */

/* Tablet (≤860px) */
@media (max-width: 860px) {
  .detail-layout        { grid-template-columns: 1fr; }
  .detail-cover-col     { display: flex; justify-content: center; margin-bottom: 1.5rem; }
  .detail-cover         { max-width: 280px; width: 100%; }
  .scanner-layout       { grid-template-columns: 1fr; }
  .scanner-section-full { grid-column: 1; }
}

/* Mobile (≤640px) */
@media (max-width: 640px) {
  .stats-grid           { grid-template-columns: 1fr; }
  .detail-info-grid     { grid-template-columns: 1fr; }
  .collection-header    { flex-direction: column; align-items: flex-start; }
  .collection-title     { font-size: 1.75rem; }
  .vinyl-grid           { grid-template-columns: repeat(2, 1fr); }
  .form-card, .delete-card { max-width: 100%; }
  .results-grid         { grid-template-columns: 1fr; }
  .filter-bar           { flex-wrap: wrap; padding: 0.875rem 1rem; gap: 0.5rem; }
  .filter-search        { min-width: 100%; order: -1; }
  .filter-search input,
  .filter-select        { font-size: 0.9rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .filter-select        { flex: 1; min-width: 0; }
  .search-input-wrap    { max-width: 100%; }
}

/* Small mobile (≤480px) */
@media (max-width: 480px) {
  .nav-inner            { padding: 0 1rem; }
  .nav-user             { display: none; }
  .main                 { padding: 1.5rem 1rem calc(6rem + env(safe-area-inset-bottom, 0px)); }
  .auth-card            { padding: 1.75rem 1.25rem; }
  .page-header h1       { font-size: 1.5rem; }
  .form-actions,
  .detail-actions       { flex-direction: column; }
  .form-actions .btn,
  .detail-actions .btn  { width: 100%; justify-content: center; }
  .result-vinyl-card .vinyl-disc-wrap { max-height: 160px; }
  .vinyl-grid           { gap: 0.75rem; }
  .vinyl-disc-wrap      { padding: 0.75rem; }
  .delete-card          { padding: 1.25rem 1rem; }
  .detail-cover         { max-width: 220px; }
  .filter-select        { min-width: 100%; }
  .stat-card-value      { font-size: 1.5rem; }
}
