:root {
  --bg-1: #0f0c14;
  --bg-2: #1a1323;
  --panel: #18141f;
  --panel-soft: #221b2e;
  --line: #4a3d61;
  --text: #f3effa;
  --muted: #cbbdde;
  --accent: #b79bff;
  --accent-2: #8e74d8;
  --danger: #ff8ca6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(183, 155, 255, 0.22), transparent 42%),
    radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.07), transparent 28%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 20px;
}

.container {
  background: linear-gradient(180deg, rgba(31, 25, 41, 0.96), rgba(22, 17, 30, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 44px 34px 26px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 5px
  );
  pointer-events: none;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-right: 96px;
  position: relative;
  z-index: 2;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #2a2138;
  color: #dccfff;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--line);
}

.mode-badge.admin {
  background: #2d2340;
  color: #cab2ff;
}

/* Language toggle */
.lang-toggle {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  background: none;
  border: none;
  color: #ac99d0;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  transition: color 0.2s;
}

.lang-btn.active {
  color: #fff;
}

.lang-btn:hover {
  color: #fff;
}

.lang-sep {
  color: #6f5d90;
  font-size: 0.85rem;
}

h1 {
  font-family: Georgia, 'Times New Roman', serif;
  text-align: center;
  font-size: 1.95rem;
  margin-bottom: 18px;
  color: #fbf8ff;
  letter-spacing: 0.8px;
  position: relative;
  z-index: 2;
}

h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  margin-bottom: 24px;
  color: #f7f0ff;
}

.hero-vinyl {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 26px;
  position: relative;
  z-index: 2;
}

.record {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #1b1622 0 14px, #9e84df 14px 22px, #16121f 22px 100%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 5px);
  border: 5px solid #272033;
  box-shadow: 0 0 0 2px #43355b, 0 10px 24px rgba(0, 0, 0, 0.4);
  animation: spin-record 5s linear infinite;
}

.record-arm {
  width: 92px;
  height: 6px;
  background: linear-gradient(90deg, #9380ba, #e5ddff);
  border-radius: 999px;
  transform: translateX(-10px) translateY(-32px) rotate(-28deg);
  transform-origin: 85% center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

@keyframes spin-record {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Buttons */
.main-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.import-note {
  margin-top: -2px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.btn {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #130d1d;
  border: 1px solid #cab7ff;
  border-radius: 10px;
  padding: 15px 26px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s, filter 0.2s;
  letter-spacing: 0.2px;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #251d34;
  color: #eee5ff;
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  filter: brightness(1.12);
}

.btn-inline {
  width: auto;
  min-width: 120px;
  padding: 10px 14px;
  font-size: 0.92rem;
}

/* Form — text/number inputs and selects */
.form-view label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #d6c8ef;
}

.form-view input[type="text"],
.form-view input[type="number"],
.form-view select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #1f192a;
  color: #f4edff;
  transition: border 0.2s;
}

.form-view input[type="text"]:focus,
.form-view input[type="number"]:focus,
.form-view select:focus {
  outline: none;
  border-color: var(--accent);
  background: #241d31;
}

.photo-input {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px dashed #695887;
  border-radius: 8px;
  background: #1d1727;
  color: #f1e9ff;
}

.field-note {
  margin-top: -2px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: #bcaed4;
}

/* Two-column form row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Checkbox row inside form-row */
.form-row.checkboxes {
  margin-bottom: 18px;
  align-items: center;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent);
  margin: 0;
}

.checkbox-row label {
  margin-bottom: 0 !important;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d6c8ef;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.search-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.search-primary,
.origin-primary,
.sort-primary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.search-primary {
  flex: 1 1 240px;
}

.origin-primary,
.sort-primary {
  flex: 0 0 120px;
}

.filter-panel label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ddcff5;
  margin-bottom: 0;
}

.filter-panel input[type="text"],
.filter-panel select {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #5e4f7a;
  border-radius: 8px;
  font-size: 0.96rem;
  font-family: inherit;
  background: #1f192a;
  color: #f4edff;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.filter-panel input[type="text"]:focus,
.filter-panel select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(183, 155, 255, 0.24);
  background: #241d31;
}

.advanced-toggle-wrap {
  display: flex;
  align-items: end;
  flex: 0 0 auto;
}

.advanced-toggle-wrap .btn-inline {
  height: 40px;
  min-width: 132px;
}

.advanced-filters {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #4d3f67;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.list-header h2 {
  margin-bottom: 0;
}

.filter-panel {
  background: #1c1727;
  border: 1px solid #47395f;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.filter-panel .form-row {
  margin-top: 12px;
}

.filter-panel .form-col {
  min-width: 0;
}

.filter-panel .form-row:last-child {
  margin-bottom: 0;
}

.filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  margin-top: 8px;
}

.photo-banner {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #4a3d61;
  border-radius: 10px;
  background: linear-gradient(180deg, #1f192a 0%, #1a1522 100%);
}

.photo-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.photo-banner-label {
  margin-bottom: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #baa9d6;
}

.photo-banner h3 {
  font-size: 1.05rem;
  color: #f6eeff;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.photo-card {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #2a2239;
  border: 1px solid #55456f;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Vinyl list */
#vinyl-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.vinyl-card {
  background: #1f192a;
  border: 1px solid #514168;
  border-radius: 8px;
  padding: 14px 18px;
}

.vinyl-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.vinyl-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f4ecff;
  line-height: 1.4;
}

.type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  background: #a68bff;
  color: #1f1531;
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.vinyl-genre {
  font-size: 0.85rem;
  color: #bdaed9;
  margin-bottom: 8px;
}

.vinyl-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: #d4c7ec;
  margin-bottom: 8px;
}

.rating-label {
  font-weight: 600;
}

.grade-value {
  font-weight: 700;
  color: #f4ecff;
}

.vinyl-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 10px;
  letter-spacing: 0.3px;
}

.tag-rated {
  background: #2b2340;
  color: #c9b5ff;
}

.tag-new {
  background: #302447;
  color: #dcc8ff;
}

.tag-origin {
  background: #261f37;
  color: #bfa9f3;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 7, 14, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: #1e1829;
  border: 1px solid #514168;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(10, 35, 49, 0.2);
}

.modal-card-small {
  max-width: 460px;
}

.modal-copy {
  margin-bottom: 18px;
  color: #d2c3ea;
  line-height: 1.5;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack-form label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #d8caef;
}

.stack-form input,
.stack-form select {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #594970;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #221c2e;
  color: #f4ecff;
}

.stack-form input:focus,
.stack-form select:focus {
  outline: none;
  border-color: var(--accent);
  background: #2a2239;
}

.form-error {
  margin-top: 0;
  margin-bottom: 8px;
  color: #b42318;
  font-size: 0.92rem;
  font-weight: 600;
}

.vinyl-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.icon-btn {
  border: none;
  border-radius: 6px;
  background: transparent;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}

.icon-btn-edit {
  color: #d8c6ff;
}

.icon-btn-edit:hover {
  background: #2d2540;
}

.icon-btn-camera {
  color: #c3adff;
}

.icon-btn-camera:hover {
  background: #2d2540;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
  flex-shrink: 0;
  margin-left: 8px;
}

.delete-btn:hover {
  background: #3a2130;
}

.empty-message {
  text-align: center;
  color: #ad9acb;
  font-style: italic;
  padding: 20px 0;
}

.about-view {
  position: relative;
  z-index: 2;
}

.about-card {
  background: #1d1728;
  border: 1px solid #514168;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #eadfff;
  line-height: 1.55;
}

.about-mail {
  color: #d8c6ff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed #d8c6ff;
  width: fit-content;
}

.about-mail:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.site-signature {
  margin-top: 20px;
  text-align: center;
  font-size: 0.72rem;
  color: #ad9acb;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
}

.back-btn {
  margin-top: 8px;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #b79bff;
  color: #1f1531;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 0.97rem;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 640px) {
  .container {
    padding: 36px 18px 24px;
  }

  .lang-toggle {
    top: 12px;
    right: 14px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .record {
    width: 120px;
    height: 120px;
  }

  .record-arm {
    width: 70px;
    transform: translateX(-6px) translateY(-28px) rotate(-28deg);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    padding-right: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions {
    flex-direction: column;
  }

  .search-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .photo-banner-header {
    flex-direction: column;
    align-items: stretch;
  }

  .advanced-toggle-wrap {
    width: 100%;
  }

  .origin-primary,
  .sort-primary,
  .search-primary {
    flex: 1 1 auto;
  }

  .advanced-toggle-wrap .btn-inline {
    min-width: 0;
  }

  .list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-inline {
    width: 100%;
  }

  .vinyl-card-header {
    gap: 8px;
  }
}
