@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;700&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  --bg: #e6f0ff;
  --ink: #0b1b34;
  --accent: #0f4c81;
  --accent-strong: #0a3560;
  --panel: rgba(255, 255, 255, 0.88);
  --muted: #40506b;
  --ring: rgba(15, 76, 129, 0.35);
  --edge: rgba(11, 27, 52, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Helvetica", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 20%, #cfe0ff, var(--bg));
  min-height: 100vh;
}

main {
  max-width: 980px;
  margin: 56px auto;
  padding: 24px 24px 64px;
  position: relative;
}

header h1 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", "Helvetica", sans-serif;
  font-size: clamp(34px, 4vw, 50px);
  letter-spacing: 0.3px;
}

header p {
  margin: 0 0 24px;
  font-size: 18px;
  color: var(--muted);
}

.toast {
  position: sticky;
  top: 16px;
  margin: 0 auto 16px;
  max-width: 680px;
  padding: 10px 14px;
  border: 1px solid rgba(11, 27, 52, 0.15);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.2px;
  display: inline-flex;
  justify-content: center;
  border-radius: 4px;
}

.toast--error {
  border-color: rgba(160, 30, 30, 0.4);
  background: rgba(220, 70, 70, 0.12);
  color: #7a1b1b;
}

.toast--success {
  border-color: rgba(15, 76, 129, 0.4);
  background: rgba(60, 130, 210, 0.12);
  color: #0b2f52;
}

form {
  background: var(--panel);
  padding: 28px;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(11, 27, 52, 0.16);
  border: 1px solid rgba(11, 27, 52, 0.08);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(11, 27, 52, 0.12);
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.footer-title {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.2px;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
}

.toggle input {
  accent-color: var(--accent);
}

.entries {
  border: 1px solid rgba(11, 27, 52, 0.12);
  background: rgba(255, 255, 255, 0.85);
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: 0;
  opacity: 0;
  transform: translateY(8px);
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.35s ease;
}

.entries.is-visible {
  max-height: 900px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.entries-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.entries-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.entries-list {
  display: grid;
  gap: 6px;
  max-height: min(45vh, 420px);
  overflow: auto;
  padding-right: 6px;
}

.entry {
  border: 1px solid rgba(11, 27, 52, 0.1);
  padding: 6px 10px;
  font-size: 12px;
  background: #f8fbff;
}

.entry--incomplete {
  border-color: rgba(160, 30, 30, 0.35);
  background: rgba(220, 70, 70, 0.08);
  color: #7a1b1b;
}

.entry-row {
  display: grid;
  grid-template-columns: 48px minmax(90px, 130px) minmax(140px, 1fr) minmax(120px, 1fr) 90px;
  gap: 8px;
  align-items: center;
}

.entry-meta {
  color: var(--muted);
}

.entry-date {
  font-variant-numeric: tabular-nums;
}

.entry-title,
.entry-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.corrections {
  border: 1px solid rgba(11, 27, 52, 0.15);
  background: rgba(255, 255, 255, 0.85);
  padding: 18px;
  display: grid;
  gap: 16px;
}

.corrections-header h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.corrections-header p {
  margin: 0;
  color: var(--muted);
}

.corrections-list {
  display: grid;
  gap: 12px;
}

.correction-row {
  border: 1px solid var(--edge);
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #f7faff;
}

.correction-row.incomplete {
  border-color: rgba(160, 30, 30, 0.35);
  background: rgba(220, 70, 70, 0.08);
}

.correction-meta {
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: 0.2px;
}

.correction-fields {
  display: grid;
  gap: 10px;
}

.correction-fields .field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

.correction-fields input[type="text"],
.correction-fields input[type="date"] {
  width: 100%;
  padding: 10px 12px;
}

.delete-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.is-deleted {
  opacity: 0.45;
  text-decoration: line-through;
}

@media (min-width: 700px) {
  .correction-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .entries {
    transition: none;
  }
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

input[type="file"],
input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: #f5f8ff;
  font-size: 16px;
  font-family: "IBM Plex Sans", "Helvetica", sans-serif;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type="file"] {
  padding: 10px 12px;
  background: #eef4ff;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(15, 76, 129, 0.25);
  border-radius: 4px;
  background: rgba(15, 76, 129, 0.1);
  color: var(--accent-strong);
  font-weight: 600;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: rgba(15, 76, 129, 0.18);
}

.date-input {
  background: #f1f6ff;
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding-right: 40px;
  background-image: linear-gradient(135deg, rgba(15, 76, 129, 0.18), transparent);
}

input[type="number"] {
  background: linear-gradient(135deg, rgba(15, 76, 129, 0.08), transparent);
}

select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(135deg, rgba(15, 76, 129, 0.08), transparent),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230f4c81' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center, right 12px center;
  background-size: auto, 16px 16px;
}

input::placeholder {
  color: rgba(64, 80, 107, 0.7);
}

.date-input::-webkit-calendar-picker-indicator {
  background: radial-gradient(circle at 40% 40%, #0f4c81, #0a3560);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M7 2a1 1 0 0 1 1 1v1h8V3a1 1 0 1 1 2 0v1h1.5A2.5 2.5 0 0 1 22 6.5v13A2.5 2.5 0 0 1 19.5 22h-15A2.5 2.5 0 0 1 2 19.5v-13A2.5 2.5 0 0 1 4.5 4H6V3a1 1 0 0 1 1-1Zm-2.5 6a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h15a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5h-15Zm2.5 3h3v3H7v-3Z'/></svg>") center / 18px 18px no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M7 2a1 1 0 0 1 1 1v1h8V3a1 1 0 1 1 2 0v1h1.5A2.5 2.5 0 0 1 22 6.5v13A2.5 2.5 0 0 1 19.5 22h-15A2.5 2.5 0 0 1 2 19.5v-13A2.5 2.5 0 0 1 4.5 4H6V3a1 1 0 0 1 1-1Zm-2.5 6a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 .5.5h15a.5.5 0 0 0 .5-.5v-11a.5.5 0 0 0-.5-.5h-15Zm2.5 3h3v3H7v-3Z'/></svg>") center / 18px 18px no-repeat;
  width: 18px;
  height: 18px;
  opacity: 1;
  cursor: pointer;
}

input[type="file"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

button {
  padding: 14px 20px;
  border: none;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #2a7cc4);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(10, 53, 96, 0.25);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions button[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.button-link:hover {
  border-color: rgba(15, 76, 129, 0.6);
  color: var(--accent-strong);
}

.grid {
  display: grid;
  gap: 16px;
}

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 3px;
  background: rgba(15, 76, 129, 0.12);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

.decor {
  position: absolute;
  inset: auto 0 0 auto;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  border-radius: 12px;
  transform: translate(36%, 40%);
  pointer-events: none;
}

.floating {
  position: absolute;
  top: 24px;
  right: -30px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle at 30% 30%, #8fc2ff, rgba(143, 194, 255, 0));
  border-radius: 8px;
  filter: blur(1px);
  animation: drift 10s ease-in-out infinite;
}

.stroke {
  position: absolute;
  left: -40px;
  bottom: -60px;
  width: 240px;
  height: 100px;
  border-radius: 6px;
  border: 2px solid rgba(15, 76, 129, 0.2);
  transform: rotate(-6deg);
  pointer-events: none;
}

@media (min-width: 700px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-12px, 8px);
  }
  100% {
    transform: translate(0, 0);
  }
}

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

header,
form {
  animation: reveal 0.6s ease both;
}

form {
  animation-delay: 0.1s;
}

.error {
  background: rgba(245, 90, 90, 0.12);
  border: 1px solid rgba(180, 30, 30, 0.3);
  color: #7a1b1b;
  padding: 10px 12px;
  border-radius: 4px;
  font-weight: 600;
}
