/* ========= Log!t Design System - Library Grid & Items ========= */

body {
  padding-bottom: 64px;
}

/* ========= LIBRARY SEARCH BAR ========= */
.searchBar {
  display: flex;
  align-items: center;
  height: 28px;
  margin-left: auto;
  padding: 0 8px;
  background: #222;
  border-radius: 8px;
  gap: 6px;
  min-width: 100px;
  max-width: 140px;
}

.searchBar svg {
  flex-shrink: 0;
  color: #48484a;
}

.searchBar input {
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  min-width: 0;
}

.searchBar input::placeholder {
  color: #48484a;
}

.searchBar .clearBtn {
  display: none;
}
.searchBar .clearBtn.visible {
  display: flex;
}

.searchResults {
  padding: 8px 12px 74px;
  display: grid;
  grid-template-columns: repeat(var(--grid), 1fr);
  gap: 3px;
}

.noResults {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  color: #48484a;
  font-size: 13px;
}

/* ========= LIBRARY ACCORDION CONTAINER ========= */
.library {
  padding: 8px 12px 74px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

@media (max-width: 1023px) {
}

.monthSection {
  display: flex;
  flex-direction: column;
}

.monthMovies {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease-out;
  contain: layout style;
}
.monthMovies > .moviesGridWrap {
  overflow: hidden;
  min-height: 0;
}
.monthSection.active .monthMovies {
  grid-template-rows: 1fr;
}

.monthHead {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  cursor: pointer;
  user-select: none;
}

.monthLeft {
  display: flex;
  align-items: center;
  gap: 6px;
}

.monthArrow {
  font-size: 9px;
  color: #48484a;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
  width: 10px;
  text-align: center;
}
.monthSection.active .monthArrow {
  transform: rotate(90deg);
}

.monthHead h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
}

.monthHead .count {
  font-size: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

/* ========= MOVIE POSTER GRID ========= */
.moviesGrid {
  display: grid;
  grid-template-columns: repeat(var(--grid), 1fr);
  gap: 2px;
  padding-top: 4px;
  align-items: start;
  contain: content;
  transform: translateZ(0);
}

.movie {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  min-height: 0;
  position: relative;
  contain: layout paint;
}

.movie img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  content-visibility: auto;
}

.movie:hover img {
  will-change: transform;
}

.movieDate {
  height: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.movieDate .day {
  font-weight: 700;
  color: #fff;
}
.movieDate .rewatch {
  color: var(--pink);
  font-weight: 700;
}

body.hide-dates .movieDate {
  display: none;
}

/* ========= EMPTY STATE ========= */
.empty {
  height: 65vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.emptyIcon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.emptyIcon svg {
  color: var(--muted);
}

.emptyTitle {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.emptyHint {
  font-size: 13px;
  color: var(--muted);
}

.retryBtn {
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--surface2);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.retryBtn:active {
  opacity: 0.85;
}

/* ========= MISSING METADATA INDICATORS ========= */
.missingDot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 4px var(--red);
}

.movie.hasMissing {
  border: 2px solid var(--red);
  border-radius: 4px;
}

.movie.hasMissing::after {
  content: 'Missing metadata';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 69, 58, 0.9);
  color: #fff;
  padding: 3px 6px;
  border-radius: 0 0 4px 4px;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  z-index: 10;
}

.monthMissingDot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  margin-left: 8px;
  vertical-align: middle;
  box-shadow: 0 0 6px var(--red);
}
