/* ========= Log!t Design System - Modals, Sheets & Overlays ========= */

/* ========= ADD MOVIE MODAL ========= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 300;
  display: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  border-radius: 20px;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.top h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.searchBox {
  height: 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  margin-bottom: 10px;
}

.searchBox input {
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
}

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

.searchRow {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.searchRow input {
  flex: 1;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  outline: none;
  border-radius: 12px;
  padding: 0 12px;
  color: #fff;
  font-size: 13px;
}

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

.results {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 30px;
}

@media (max-width: 600px) {
  .results {
    grid-template-columns: repeat(3, 1fr);
  }
}

.result {
  aspect-ratio: 2/3;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.result:active {
  transform: scale(0.96);
}
.result img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.resultInfo {
  padding: 4px 2px;
  text-align: center;
}

.resultTitle {
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.resultYear {
  font-size: 9px;
  color: var(--muted);
  line-height: 1.3;
}

/* ========= RATING BOTTOM SHEET ========= */
.ratingSheet {
  position: fixed;
  inset: 0;
  z-index: 500;
}

.sheetBg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: rgba(10, 10, 10, 0.75);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 20px;
  transform: translateY(20px);
  opacity: 0;
  animation: sheetIn 0.3s cubic-bezier(0.2, 0, 0, 1) forwards;
}

.sheet img {
  width: 86px;
  height: 129px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  margin: auto;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.sheet h3 {
  font-size: 17px;
  text-align: center;
  margin-bottom: 16px;
  font-weight: 600;
}

.rates {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.rates button {
  height: 38px;
  border: none;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.rates button.active {
  background: #fff !important;
  color: #000 !important;
  font-weight: 700;
}

.sheetAdd {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 14px;
  background: #fff !important;
  color: #000 !important;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sheetAdd.enabled {
  opacity: 1;
  pointer-events: auto;
}

/* ========= MOVIE DETAILS META SHEET ========= */
.metaModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  z-index: 400;
}

.metaModal .posterBgModal {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: blur(90px) saturate(1.4);
  transform: scale(1.2) translateZ(0);
  pointer-events: none;
  z-index: 0;
}

.metaModal .posterBgModal.active {
  opacity: 0.65;
}

.metaModal.active {
  display: flex;
}

.meta {
  position: relative;
  z-index: 1;
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 24px 20px 32px;
  max-height: 90vh;
  overflow: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.metaModal.active .meta {
  transform: translateY(0);
}

.metaHandle {
  display: none; /* Removed slide-down handle/pill */
}

.metaHeader {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.posterWrap {
  position: relative;
  width: 90px;
  height: 135px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.posterBtn {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0);
  cursor: pointer;
  transition: background 0.2s;
}

.posterWrap:hover .posterBtn {
  background: rgba(0, 0, 0, 0.3);
}

.metaInfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topRow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 12px;
}

.topRow h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
  letter-spacing: -0.5px;
  color: #fff;
}

/* Minimal rating presentation - no background pill */
.ratingBox {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.ratingEdit {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ratingEdit button {
  height: 28px;
  min-width: 34px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 6px;
  transition: all 0.15s ease;
}

.ratingEdit button:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.ratingEdit button.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/* Minimal tags display - no backgrounds, bullet-separated */
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 0px;
}

.chips span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.chips span:not(:last-child)::after {
  content: '  ·';
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

/* Minimal grid layout - no box card elements */
.info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.info > div {
  display: flex;
  flex-direction: column;
}

.info p,
.logged p,
.metaSection p {
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.info h4,
.logged h4 {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
  color: #e5e5ea;
}

.logged {
  margin: 16px 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

.logged p {
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.logged h4 {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #e5e5ea;
}

.logged .metaInput {
  width: 100%;
  max-width: 200px;
}

.metaSection {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
  margin-bottom: 0;
}

.metaSection p {
  margin-bottom: 6px;
}

.metaSection h4 {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.metaSection h4:empty {
  display: none;
}

.metaSection h4:empty + .metaInput {
  margin-top: 0;
}

.metaSection .metaInput {
  margin-top: 0;
}

/* Minimal name chip - clean text separated by commas */
.nameChip {
  display: inline;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  white-space: normal;
}

.nameChip:not(:last-child)::after {
  content: ', ';
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.actions button {
  height: 44px;
  border: 1px solid #ffffff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #000000;
}

.actions button:active {
  transform: scale(0.98);
}

.actions button:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
}

.edit {
  background: #ffffff;
  color: #000000;
}

.deleteBtn {
  background: #d90429 !important;
  color: #ffffff !important;
  border-color: #d90429 !important;
}

.deleteBtn:hover {
  background: #b90320 !important;
  border-color: #b90320 !important;
  color: #ffffff !important;
}

/* ========= META EDIT STATE ========= */
/* Minimal bottom-bordered inputs */
.metaInput {
  display: none;
  width: 100%;
  height: 32px;
  margin-top: 4px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  outline: none;
  border-radius: 0;
  padding: 4px 0;
  color: #fff;
  font-size: 13px;
  transition: border-bottom-color 0.2s;
}

.metaInput:focus {
  border-bottom-color: #fff;
}

.metaInputSmall {
  width: 60px;
  height: 24px;
  margin-top: 0;
  padding: 0 4px;
  font-size: 12px;
  text-align: left;
}

.meta.editing .metaInput {
  display: block;
}

.meta.editing .metaInputSmall {
  display: inline-block;
  width: 60px;
  height: 24px;
}

.meta.editing h4 {
  display: none;
}

.meta.editing .logged {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.metaCheckbox {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.sheetToggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.meta.editing .metaCheckbox {
  display: flex;
}

.meta.editing #mWatch {
  display: none;
}

.meta.editing .ratingBox {
  display: none;
}

#saveBtn {
  display: none;
}

.meta.editing #saveBtn {
  display: block;
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.meta.editing #saveBtn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
}

.meta.editing #editBtn,
.meta.editing #deleteBtn {
  display: none;
}

#eRating {
  display: none;
}

.meta.editing #eRating {
  display: flex;
}

/* ========= ALTERNATIVE POSTERS PICKER ========= */
.posterPicker {
  position: fixed;
  inset: 0;
  z-index: 600;
}

.posterBg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Minimal poster sheet design */
.posterSheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.7);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 24px 20px 32px;
  max-height: 80vh;
  overflow: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.posterPicker.active .posterSheet {
  transform: translateY(0);
}

.posterSheetHandle {
  display: none;
}

.posterGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.posterItem {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 3px;
  overflow: hidden;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s;
}

.posterItem.active {
  border-color: #fff;
}
.posterItem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.posterLang {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 16px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

/* Sticky Close button for meta details and poster sheet */
.metaCloseBtn,
.posterCloseBtn {
  position: sticky;
  top: 0;
  float: right;
  z-index: 100;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  margin-top: -6px;
  margin-bottom: -24px;
}

@media (max-width: 768px) {
  .modal-content,
  .sheet {
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .metaModal .posterBgModal {
    filter: blur(40px) saturate(1.3);
    transform: scale(1.2) translateZ(0);
  }

  .meta {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    max-height: 75vh;
    padding: 16px 16px 24px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }

  .metaHeader {
    gap: 14px;
    margin-bottom: 14px;
  }

  .posterWrap {
    width: 72px;
    height: 108px;
  }

  .topRow h2 {
    font-size: 18px;
  }

  .sheet {
    padding: 16px;
    bottom: 8px;
    left: 8px;
    right: 8px;
    border-radius: 16px;
  }

  .sheet img {
    width: 70px;
    height: 105px;
    margin-bottom: 10px;
  }

  .sheet h3 {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .rates {
    gap: 4px;
    margin-bottom: 12px;
  }

  .rates button {
    height: 34px;
    font-size: 11px;
  }

  .sheetAdd {
    height: 44px;
    font-size: 14px;
    border-radius: 12px;
  }
}

.metaCloseBtn:hover,
.posterCloseBtn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}
