/* Styling matched to the ollie_smalls website (Spectral template + custom.css):
   Open Sans, white on #2e3842/#1d242a, accent red #ed4933/#e8482f, 3px radii,
   uppercase letter-spaced buttons. */

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 720px;
  padding: 0 1rem 4rem;
  font-family: "Open Sans", Helvetica, sans-serif;
  font-weight: 400;
  letter-spacing: 0.075em;
  line-height: 1.65;
  background: #2e3842;
  color: #fff;
}

header {
  padding: 1.5rem 0 1.25rem;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

h1 {
  margin: 0;
  font-size: 1rem;
}

h1 a {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: inherit;
  text-decoration: none;
}

.logo {
  display: block;
  height: 2rem;
  width: auto;
}

.app-title {
  text-transform: uppercase;
  letter-spacing: 0.225em;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

#status {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e8482f;
  transition: background 0.3s;
}

#status.online {
  background: #4fc26b;
}

nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

nav a {
  height: 2.6em;
  line-height: 2.6em;
  padding: 0 1.6em;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.225em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px #fff;
  transition: background-color 0.2s ease-in-out;
}

nav a:hover {
  background: rgba(144, 144, 144, 0.25);
}

nav a.active {
  background: #ed4933;
  box-shadow: none;
}

.setlist-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: #1d242a;
  border-radius: 3px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s ease-in-out;
}

.card:hover {
  background: #242d34;
}

.card-name {
  flex: 1;
  font-weight: 600;
}

.card-count {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.empty {
  color: rgba(255, 255, 255, 0.5);
}

.detail-header {
  margin-bottom: 1rem;
}

.back {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.back:hover {
  color: #fff;
}

.detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.4rem;
}

.detail-title-row h2 {
  flex: 1;
}

h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.075em;
  cursor: pointer;
}

.print-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.print-controls label {
  position: relative;
  padding-left: 2.1em;
  cursor: pointer;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  user-select: none;
}

.print-controls input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.print-controls label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5em;
  height: 1.5em;
  line-height: 1.5em;
  text-align: center;
  background: rgba(144, 144, 144, 0.25);
  border-radius: 3px;
}

.print-controls label:has(input:checked)::before {
  content: "✓";
  background: #ed4933;
  color: #fff;
}

.songs,
.library {
  list-style: none;
  counter-reset: song;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.songs li,
.library li {
  counter-increment: song;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: #1d242a;
  border-radius: 3px;
}

.songs li::before {
  content: counter(song) ".";
  min-width: 1.6rem;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.songs li.sortable-ghost {
  opacity: 0.4;
}

.library li.empty {
  background: none;
  padding: 0;
}

.usage {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.song-info {
  flex: 1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.6rem;
  min-width: 0;
}

.song-meta {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  cursor: grab;
  color: rgba(255, 255, 255, 0.5);
  touch-action: none;
  padding: 0 0.2rem;
}

.song-title {
  overflow-wrap: anywhere;
}

button {
  font: inherit;
  letter-spacing: inherit;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.icon {
  display: inline-flex;
}

.icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.edit,
.delete,
.duplicate {
  display: inline-flex;
  align-items: center;
  background: none;
  color: rgba(255, 255, 255, 0.65);
  padding: 0.25rem 0.4rem;
  transition: color 0.2s ease-in-out;
}

.delete:hover {
  color: #e8482f;
}

.edit:hover,
.duplicate:hover {
  color: #fff;
}

/* Spectral buttons: uppercase outline by default, solid red for primary. */
.add-form button,
.song-edit button,
.print-controls .print,
.login button {
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.225em;
  text-transform: uppercase;
  height: 3.4375em; /* 2.75em at base size — matches the inputs */
  padding: 0 1.8em;
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 2px #fff;
  white-space: nowrap;
  transition: background-color 0.2s ease-in-out;
}

.print-controls .print {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  line-height: 1;
  /* trailing letter-spacing after the last letter — trim it from the right
     padding so the icon+text cluster sits visually centered */
  padding: 0 1.575em 0 1.8em;
}

.print-controls .print .icon svg {
  width: 1.35em;
  height: 1.35em;
}

.song-edit .cancel:hover,
.print-controls .print:hover {
  background: rgba(144, 144, 144, 0.25);
}

.add-form button,
.song-edit .save,
.login button {
  background: #ed4933;
  box-shadow: none;
}

.add-form button:hover,
.song-edit .save:hover,
.login button:hover {
  background: #ef5e4a;
}

.add-form button:active,
.song-edit .save:active,
.login button:active {
  background: #eb341c;
}

.add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.song-fields .title,
.song-edit .title {
  flex-basis: 100%;
}

.song-fields .bpm,
.song-edit .bpm {
  flex: 0 0 6.5em;
}

.song-edit {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.add-form input,
.picker input,
.song-edit input,
.login input {
  appearance: none;
  flex: 1;
  font: inherit;
  letter-spacing: inherit;
  height: 2.75em;
  padding: 0 1em;
  border: none;
  border-radius: 3px;
  background: rgba(144, 144, 144, 0.25);
  color: inherit;
  outline: 0;
}

.add-form input:focus,
.picker input:focus,
.song-edit input:focus,
.login input:focus {
  box-shadow: 0 0 0 2px #e8482f;
}

.login {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 24rem;
  margin: 4rem auto 0;
}

.login input {
  flex: none;
  width: 100%;
}

.login-hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.login-error {
  margin: 0;
  color: #ef5e4a;
}

::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.picker {
  position: relative;
  margin-top: 1rem;
}

.picker input {
  width: 100%;
}

.picker-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  margin: 4px 0 0;
  padding: 0.3rem;
  list-style: none;
  background: #1d242a;
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-height: 40vh;
  overflow-y: auto;
}

.picker.open .picker-menu {
  display: block;
}

.picker-menu li {
  padding: 0.6rem 0.8rem;
  border-radius: 3px;
  cursor: pointer;
}

.picker-menu li:hover {
  background: rgba(144, 144, 144, 0.25);
}

.picker-menu li.create {
  color: #ef5e4a;
}

.picker-menu li.empty {
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
}

/* Stage-readable print version: white paper, large black text, no app chrome. */
@media print {
  body {
    position: relative;
    max-width: none;
    padding: 0;
    background: #fff;
    color: #000;
  }

  header,
  .back,
  .print-controls,
  .picker,
  .add-form,
  .drag-handle,
  .edit,
  .delete,
  .duplicate,
  .usage {
    display: none !important;
  }

  /* tiny setlist name in the upper right — the page belongs to the songs */
  .detail-header {
    margin: 0;
  }

  h2 {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 10pt;
    font-weight: 400;
    color: #444;
    cursor: default;
  }

  .songs,
  .library {
    gap: 0;
  }

  .songs li,
  .library li {
    background: none;
    padding: 0.35rem 0;
    font-size: 26pt;
    font-weight: 700;
    break-inside: avoid;
  }

  .songs li::before {
    display: none;
  }

  .song-meta {
    display: none;
    color: #444;
    font-size: 14pt;
    font-weight: 400;
  }

  body.print-details .song-meta {
    display: block;
  }
}
