/* ======================================================
   CineAI — UX / UI POLISH
====================================================== */

/* ACESSIBILIDADE */

:focus-visible {
  outline: 3px solid rgba(32, 214, 199, 0.9);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none !important;
}

/* HEADER */

.header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.navigation a {
  position: relative;
}

.navigation a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transition: right 0.25s ease;
}

.navigation a:hover::after {
  right: 0;
}

/* HERO */

.hero__badge {
  padding: 7px 11px;
  border: 1px solid rgba(32, 214, 199, 0.24);
  border-radius: 999px;
  background: rgba(8, 11, 18, 0.38);
  backdrop-filter: blur(10px);
}

.hero h1 {
  text-shadow:
    0 8px 35px rgba(0, 0, 0, 0.5);
}

.hero__meta span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(8, 11, 18, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero__buttons .button {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.22);
}

/* SEÇÕES */

.catalog {
  scroll-margin-top: 84px;
}

#recomendados {
  position: relative;
}

#recomendados::before {
  content: "";
  position: absolute;
  inset: 10px 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 15% 30%,
      rgba(124, 92, 255, 0.09),
      transparent 34%
    ),
    radial-gradient(
      circle at 85% 70%,
      rgba(32, 214, 199, 0.06),
      transparent 30%
    );
}

#recomendados .container {
  position: relative;
  z-index: 1;
}

#recommendationReason {
  max-width: 660px;
  color: var(--text-soft);
  font-size: 0.94rem;
}

/* CARDS */

.movie-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-7px);
  border-color: rgba(124, 92, 255, 0.32);
  box-shadow:
    0 24px 55px rgba(0, 0, 0, 0.34);
}

.movie-card__poster {
  overflow: hidden;
}

.movie-card__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      115deg,
      transparent 35%,
      rgba(255, 255, 255, 0.08) 50%,
      transparent 65%
    );
  transform: translateX(-140%);
  transition: transform 0.65s ease;
}

.movie-card:hover
.movie-card__poster::after {
  transform: translateX(140%);
}

.movie-type-badge,
.movie-rating-badge {
  backdrop-filter: blur(8px);
}

.favorite-button,
.details-button,
.trailer-button {
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.favorite-button:hover,
.details-button:hover,
.trailer-button:hover {
  transform: scale(1.08);
}

.favorite-button.is-saved {
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.34),
    0 8px 20px rgba(124, 92, 255, 0.16);
}

/* ======================================================
   ESTADOS — FASE 8.13
====================================================== */

.empty-list,
.search-empty {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.025),
      rgba(124, 92, 255, 0.025)
    );
}

.empty-list span,
.search-empty__icon {
  filter:
    drop-shadow(
      0 8px 20px rgba(124, 92, 255, 0.25)
    );
}

.empty-list p,
.search-empty strong {
  margin-top: 8px;
}

.empty-list small,
.search-empty p {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
}

.cineai-state {
  width: 100%;
  min-height: 150px;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: left;
  border:
    1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.035),
      rgba(124, 92, 255, 0.025)
    );
}

.cineai-state__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.55rem;
  background:
    rgba(255, 255, 255, 0.055);
  border:
    1px solid rgba(255, 255, 255, 0.07);
}

.cineai-state__content {
  min-width: 0;
}

.cineai-state__title {
  display: block;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
}

.cineai-state__message {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.cineai-state--compact {
  min-height: auto;
  justify-content: flex-start;
  padding: 16px 18px;
  margin-bottom: 8px;
}

.cineai-state--compact
.cineai-state__icon {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

.cineai-state--loading {
  border-color:
    rgba(124, 92, 255, 0.16);
}

.cineai-state--loading
.cineai-state__icon {
  animation:
    cineaiPulse 1.4s ease-in-out
    infinite;
}

.cineai-state--warning {
  border-color:
    rgba(245, 183, 63, 0.24);
  background:
    linear-gradient(
      145deg,
      rgba(245, 183, 63, 0.05),
      rgba(255, 255, 255, 0.02)
    );
}

.cineai-state--error {
  border-color:
    rgba(239, 68, 68, 0.28);
  background:
    linear-gradient(
      145deg,
      rgba(239, 68, 68, 0.06),
      rgba(255, 255, 255, 0.02)
    );
}

.cineai-search-error {
  margin-bottom: 20px;
}

.cineai-empty-state,
.search-empty--enhanced {
  border:
    1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
}

@keyframes cineaiPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

/* BUSCA */

.search-field {
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.search-field:focus-within {
  box-shadow:
    0 0 0 4px rgba(124, 92, 255, 0.08);
  background:
    rgba(255, 255, 255, 0.075);
}

.genre-filter {
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.genre-filter:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color:
    rgba(255, 255, 255, 0.22);
}

.genre-filter.is-active {
  box-shadow:
    0 6px 18px rgba(124, 92, 255, 0.14);
}

/* MODAL */

.details-modal__content {
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.65);
}

.details-modal__close {
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.details-modal__close:hover {
  transform:
    rotate(8deg)
    scale(1.06);
}

/* DETALHES AVANÇADOS — FASE 8.12 */

.details-modal__extra {
  margin-top: 24px;
  padding-top: 22px;
  border-top:
    1px solid rgba(255, 255, 255, 0.08);
}

.details-extra__grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.details-extra__item,
.details-extra__original,
.details-extra__trailer {
  padding: 14px 16px;
  border:
    1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background:
    rgba(255, 255, 255, 0.035);
}

.details-extra__item span,
.details-extra__original span,
.details-extra__trailer span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.details-extra__item strong,
.details-extra__original strong,
.details-extra__trailer strong {
  display: block;
  color: var(--text);
  font-size: 0.91rem;
  line-height: 1.4;
}

.details-extra__original,
.details-extra__trailer {
  margin-top: 12px;
}

.details-extra__trailer small {
  display: block;
  margin-top: 7px;
  color: var(--accent);
}

/* FOOTER */

.footer {
  margin-top: 30px;
  border-top:
    1px solid rgba(255, 255, 255, 0.06);
}

.footer__credits a {
  color: var(--accent);
  transition: opacity 0.2s ease;
}

.footer__credits a:hover {
  opacity: 0.78;
}

/* SCROLLBAR */

* {
  scrollbar-width: thin;
  scrollbar-color:
    rgba(124, 92, 255, 0.55)
    rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background:
    rgba(255, 255, 255, 0.025);
}

::-webkit-scrollbar-thumb {
  background:
    rgba(124, 92, 255, 0.5);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background:
    rgba(124, 92, 255, 0.72);
}

/* ======================================================
   RESPONSIVO / MOBILE — FASE 8.14
====================================================== */

@media (max-width: 1100px) {
  .navigation {
    gap: 20px;
  }

  .navigation a {
    font-size: 0.86rem;
  }

  .movie-grid {
    gap: 18px;
  }

  .details-modal__content {
    width: min(92vw, 900px);
  }
}

@media (max-width: 900px) {
  .header__content {
    min-height: 72px;
  }

  .navigation {
    gap: 14px;
  }

  .navigation a {
    font-size: 0.82rem;
  }

  .hero {
    min-height: 82vh;
  }

  .hero__content {
    max-width: 680px;
  }

  .hero p {
    max-width: 560px;
  }

  .details-extra__grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .container {
    width: min(92%, var(--container));
  }

  .header__content {
    gap: 10px;
    min-height: 66px;
  }

  .navigation {
    display: none;
  }

  .logo {
    font-size: 1.45rem;
  }

  .search-button,
  .profile {
    width: 40px;
    height: 40px;
  }

  .hero {
    min-height: auto;
    padding-top: 115px;
    padding-bottom: 70px;
    align-items: flex-end;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero h1 {
    max-width: 100%;
    line-height: 1;
    font-size:
      clamp(
        2.65rem,
        12vw,
        4.4rem
      );
  }

  .hero__meta {
    gap: 7px;
  }

  .hero__meta span {
    font-size: 0.76rem;
  }

  .hero p {
    max-width: 100%;
    font-size: 0.96rem;
    line-height: 1.55;
  }

  .hero__buttons {
    width: 100%;
    gap: 10px;
  }

  .hero__buttons .button {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 48px;
  }

  .hero-carousel {
    margin-top: 26px;
  }

  .catalog {
    padding-top: 42px;
  }

  .section-header {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .section-header h2 {
    line-height: 1.15;
  }

  .movie-grid {
    gap: 16px;
  }

  .movie-card:hover {
    transform: none;
  }

  .search-panel {
    padding-top: 82px;
  }

  .search-panel__content {
    height:
      calc(100vh - 82px);
    padding-bottom: 30px;
  }

  .search-field {
    margin-bottom: 18px;
  }

  .search-field input {
    padding:
      15px 12px;
  }

  .genre-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 22px;
    scrollbar-width: none;
  }

  .genre-filters::-webkit-scrollbar {
    display: none;
  }

  .genre-filter {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .details-modal {
    padding:
      12px;
  }

  .details-modal__content {
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 18px;
  }

  .details-modal__hero {
    min-height: 250px;
  }

  .details-modal__body {
    padding:
      24px 20px 28px;
  }

  .details-modal__buttons {
    flex-wrap: wrap;
  }

  .details-modal__buttons
  .button {
    flex: 1 1 180px;
  }

  .details-extra__grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .cineai-state {
    padding: 24px 20px;
  }

  .footer {
    text-align: center;
  }
}

@media (max-width: 520px) {
  .container {
    width: 94%;
  }

  .profile {
    display: none;
  }

  .header__actions {
    gap: 8px;
  }

  .hero {
    padding-top: 105px;
    padding-bottom: 58px;
  }

  .hero__badge {
    font-size: 0.68rem;
  }

  .hero h1 {
    font-size:
      clamp(
        2.35rem,
        13vw,
        3.5rem
      );
  }

  .hero__meta {
    gap: 6px;
  }

  .hero__meta span {
    padding: 4px 7px;
    font-size: 0.72rem;
  }

  .hero p {
    font-size: 0.92rem;
  }

  .hero__buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__buttons .button {
    width: 100%;
    flex: 0 0 48px;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 22px;
  }

  .hero-carousel {
    justify-content: space-between;
    width: 100%;
  }

  .hero-carousel__arrow {
    width: 40px;
    height: 40px;
  }

  .section-header {
    display: block;
  }

  .section-label {
    margin-bottom: 8px;
  }

  .movie-grid {
    grid-template-columns: 1fr;
  }

  .movie-card {
    width: 100%;
  }

  .movie-card__content {
    gap: 10px;
  }

  .movie-card__actions {
    flex-wrap: wrap;
  }

  .search-field__icon {
    margin-left: 14px;
  }

  .search-close {
    margin-right: 5px;
  }

  .search-empty {
    margin: 30px auto;
    padding: 34px 20px;
  }

  .details-modal__hero {
    min-height: 210px;
  }

  .details-modal__hero-title {
    font-size: 1.2rem;
  }

  .details-modal__body h2 {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .details-modal__meta {
    gap: 7px;
  }

  .details-modal__description {
    font-size: 0.92rem;
  }

  .details-extra__grid {
    grid-template-columns: 1fr;
  }

  .details-modal__buttons {
    flex-direction: column;
  }

  .details-modal__buttons
  .button {
    width: 100%;
    flex: none;
  }

  .cineai-state {
    flex-direction: column;
    text-align: center;
  }

  .cineai-state--compact {
    flex-direction: row;
    text-align: left;
  }

  .footer__technology,
  .footer__credits {
    font-size: 0.84rem;
  }
}

/* REDUÇÃO DE MOVIMENTO */

@media (
  prefers-reduced-motion: reduce
) {
  *,
  *::before,
  *::after {
    scroll-behavior:
      auto !important;
    animation-duration:
      0.01ms !important;
    animation-iteration-count:
      1 !important;
    transition-duration:
      0.01ms !important;
  }
}
