/* ==========================================================================
   Estilos específicos de páginas
   ========================================================================== */

/* ---------- Busca ---------- */
.search-box {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 760px;
  padding: 0 10px 0 20px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  transition: border-color var(--dur-1), box-shadow var(--dur-2);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.22); }
.search-box > svg { width: 22px; height: 22px; color: var(--text-2); flex: none; }
.search-input { border: 0 !important; background: transparent !important; box-shadow: none !important; min-height: 58px; padding: 0; font-size: 19px; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-suggest {
  --r: var(--r-lg);
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  padding: 6px;
  max-height: 60vh;
  overflow-y: auto;
}
.search-suggest li { cursor: pointer; }
.search-suggest__row {
  --r: calc(var(--r-lg) - 6px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r);
}
.search-suggest li[aria-selected="true"] .search-suggest__row, .search-suggest li:hover .search-suggest__row { background: rgba(255, 255, 255, 0.12); }
.search-suggest__img { width: 40px; height: 60px; border-radius: 8px; overflow: hidden; flex: none; background: var(--bg-elev-2); }
.search-suggest__img.is-round { width: 48px; height: 48px; border-radius: 50%; }
.search-suggest__img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Biblioteca e listas ---------- */
.library-filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.list-card {
  --r: var(--r-lg);
  display: grid;
  align-content: end;
  gap: 6px;
  min-height: 160px;
  padding: 20px;
  border-radius: var(--r);
  text-align: left;
  transition: transform var(--dur-3) var(--ease-spring);
}
.list-card:hover { transform: translateY(-3px) scale(1.01); }
.list-card > svg { width: 28px; height: 28px; color: var(--accent-2); margin-bottom: auto; }
.list-card--new { place-content: center; justify-items: center; color: var(--text-2); border: 1.5px dashed rgba(255, 255, 255, 0.25); background: transparent; box-shadow: none; }
.list-card--new::before, .list-card--new::after { display: none; }
.list-card--new > svg { margin: 0; }
.list-item { position: relative; }
.list-remove { position: absolute; top: 8px; right: 8px; z-index: 4; opacity: 0; transition: opacity var(--dur-2); }
.list-item:hover .list-remove, .list-remove:focus-visible { opacity: 1; }
@media (hover: none) { .list-remove { opacity: 1; } }

/* ---------- Detalhes ---------- */
.details-tabs { margin-bottom: 8px; }
.details-panel > [role="tabpanel"] { animation: view-in var(--dur-3) var(--ease-out) both; }
.hero .chip.glass:not(.chip--tag) { justify-self: start; }

/* ---------- Lançamentos ---------- */
.release-list { display: grid; gap: 14px; }
.release-row {
  --r: var(--r-lg);
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px 18px 12px 12px;
  border-radius: var(--r);
}
.release-row__img { width: 86px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--bg-elev-2); }
.release-row__img img { width: 100%; height: 100%; object-fit: cover; }
.release-row__when { text-align: right; }
.release-row__count { font-size: 1.5rem; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 599px) {
  .release-row { grid-template-columns: 64px 1fr; }
  .release-row__img { width: 64px; }
  .release-row__when { grid-column: 2; text-align: left; }
}

.calendar { --r: var(--r-xl); padding: 18px; }
.calendar__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar__dow { text-align: center; font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; padding: 4px 0; }
.calendar__day {
  --r: var(--r-sm);
  min-height: 96px;
  padding: 6px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.calendar__day.is-out { opacity: 0.35; }
.calendar__day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar__num { font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); }
.calendar__ev {
  display: block;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  background: rgba(77, 163, 255, 0.22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar__ev--movie { background: rgba(255, 159, 67, 0.25); }
.calendar__ev--mine { background: rgba(48, 209, 88, 0.28); }
@media (max-width: 699px) {
  .calendar__day { min-height: 54px; }
  .calendar__ev { font-size: 0; padding: 0; width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
}

/* ---------- Pessoa ---------- */
.person-head { display: grid; grid-template-columns: minmax(160px, 260px) 1fr; gap: 36px; align-items: start; }
.person-photo { --r: var(--r-xl); border-radius: var(--r); overflow: hidden; aspect-ratio: 2 / 3; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); background: var(--bg-elev-2); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 28px; margin-top: 24px; }
.facts dt { font-size: var(--fs-sm); color: var(--text-3); font-weight: 600; }
.facts dd { margin: 2px 0 0; }
.filmography { display: grid; gap: 4px; }
.filmo-row {
  --r: var(--r-md);
  display: grid;
  grid-template-columns: 56px 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: var(--r);
  transition: background var(--dur-1);
}
.filmo-row:hover { background: rgba(255, 255, 255, 0.06); }
.filmo-row__year { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; }
.filmo-row__img { width: 44px; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--bg-elev-2); }
.filmo-row__img img { width: 100%; height: 100%; object-fit: cover; }
.filmo-row .seen { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-size: var(--fs-xs); font-weight: 700; }
.filmo-row .seen svg { width: 14px; height: 14px; }
@media (max-width: 699px) {
  .person-head { grid-template-columns: 1fr; }
  .person-photo { max-width: 220px; }
  .filmo-row { grid-template-columns: 44px 36px 1fr; }
  .filmo-row > :last-child { grid-column: 3; }
}

/* ---------- Chat ---------- */
.chat { display: grid; grid-template-rows: auto 1fr auto; height: calc(100vh - 120px); height: calc(100dvh - 120px); max-width: 880px; margin: 0 auto; }
.chat__log { overflow-y: auto; padding: 16px 4px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.msg { max-width: 80%; padding: 12px 16px; border-radius: 22px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg--user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 8px; }
.msg--assistant { --r: 22px; align-self: flex-start; border-bottom-left-radius: 8px; }
.msg--tool { align-self: flex-start; font-size: var(--fs-xs); color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; }
.chat__composer { --r: var(--r-xl); display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 18px; margin-bottom: 8px; }
.chat__composer textarea { flex: 1; resize: none; border: 0; background: transparent; min-height: 44px; max-height: 160px; padding: 11px 0; font-size: 17px; outline: none; }
.chat__budget { display: grid; gap: 6px; padding: 10px 4px 0; }
.chat__suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 699px) { .chat { height: calc(100dvh - 190px); } .msg { max-width: 92%; } }
