/* ---------- Viewings (js/viewings.js) ---------- */

/* "×3" on the card of a movie watched more than once: a small tag pinned
   to the poster's corner. */
.card-rewatch {
  position: absolute;
  top: 18px;
  right: 6px;
  padding: 3px 8px;
  background: var(--accent-strong);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 2px 3px 0 var(--accent-deep);
  transform: rotate(4deg);
  pointer-events: none;
}

/* ---------- the detail window's summary ---------- */

.viewings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px 4px 8px;
  border: 1.5px dashed color-mix(in srgb, var(--accent-deep) 45%, transparent);
  border-radius: 2px;
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition);
}

.viewings-toggle:hover {
  background: color-mix(in srgb, var(--accent-strong) 10%, transparent);
  border-color: var(--accent-deep);
}

.viewings-caret {
  display: inline-block;
  transition: transform var(--transition);
}

.viewings-toggle[aria-expanded="false"] .viewings-caret {
  transform: rotate(-90deg);
}

/* The list: one ticket stub per viewing, latest first. */
.viewings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.viewings-list[hidden] {
  display: none;
}

.viewing-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border-left: 3px solid var(--accent-strong);
  background: color-mix(in srgb, var(--accent-strong) 7%, transparent);
  text-align: left;
  transition: background var(--transition);
}

.viewing-item:hover,
.viewing-item:focus-visible {
  background: color-mix(in srgb, var(--accent-strong) 15%, transparent);
}

.viewing-item-date {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
}

/* "The first time you saw this movie", on the earliest viewing. Takes
   only the room left (width 0, then grows), so on a narrow phone it wraps
   onto a second line instead of widening the whole window. */
.viewing-item-note {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  line-height: 1.25;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--text-muted);
}

.viewing-item-go {
  margin-left: auto;
  color: var(--accent-deep);
  font-size: 18px;
  line-height: 1;
}

.detail-actions-review [data-action="watched-again"] {
  border: 1.5px solid var(--accent-deep);
  background: transparent;
  color: var(--accent-deep);
  padding: 10px 16px;
  border-radius: 7px;
}

.detail-actions-review [data-action="watched-again"]:hover {
  background: color-mix(in srgb, var(--accent-strong) 12%, transparent);
}

/* ---------- one viewing, in the window ---------- */

.viewing-back {
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: color var(--transition);
}

.viewing-back:hover,
.viewing-back:focus-visible {
  color: var(--accent-deep);
}

.viewing-eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.viewing-form {
  margin-top: 8px;
}

.viewing-error {
  margin-top: 14px;
  font-size: 13px;
  color: #f87171;
}

.viewing-actions {
  justify-content: space-between;
}

.viewing-actions .complete-btn {
  margin-left: auto;
}

/* ---------- small field helpers (this form and Edit's) ---------- */

.field-error {
  margin-top: 6px;
  font-size: 12px;
  color: #f87171;
}

.update-viewings-hint {
  margin-top: 4px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  border: 1.5px dashed var(--border);
}
