/* SechsAI — seletor de estilo (IR) */

.style-picker-modal {
  --sp-red: #dd0000;
  --sp-text: #fff;
  --sp-muted: rgba(255, 255, 255, 0.58);
  --sp-line: rgba(255, 255, 255, 0.08);
  position: fixed;
  inset: 0;
  z-index: 225;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(0.5rem + env(safe-area-inset-top, 0px))
    0.75rem
    calc(0.5rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.style-picker-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

body.style-picker-open {
  overflow: hidden;
}

.style-picker-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 50% 42%, rgba(221, 0, 0, 0.14), transparent 70%),
    rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.style-picker-modal__sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 72rem);
  max-height: min(94dvh, 56rem);
  overflow: hidden;
  color: var(--sp-text);
  border: 1px solid var(--sp-line);
  border-radius: 1.25rem;
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(221, 0, 0, 0.1), transparent 55%),
    linear-gradient(180deg, #121212 0%, #0a0a0a 48%, #070707 100%);
  box-shadow:
    0 0 0 1px rgba(221, 0, 0, 0.12),
    0 1.75rem 3.5rem rgba(0, 0, 0, 0.65);
  transform: translateY(0.4rem) scale(0.985);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
}

.style-picker-modal.is-open .style-picker-modal__sheet {
  transform: none;
  opacity: 1;
}

.style-picker-modal__header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.2rem 3.25rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.style-picker-modal__title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.3rem, 3.2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.style-picker-modal__subtitle {
  margin: 0;
  max-width: 40ch;
  color: var(--sp-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.style-picker-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: background 0.2s ease;
}

.style-picker-modal__close:hover {
  background: rgba(221, 0, 0, 0.22);
}

.style-picker-modal__toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
}

.style-picker-modal__toolbar[hidden] {
  display: none !important;
}

.style-picker-modal__tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 0.45rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.style-picker-modal__tabs::-webkit-scrollbar {
  display: none;
}

.style-picker-modal__tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.style-picker-modal__tab em {
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 800;
}

.style-picker-modal__tab:hover {
  color: #fff;
  border-color: rgba(221, 0, 0, 0.55);
}

.style-picker-modal__tab.is-active {
  color: #fff;
  border-color: var(--sp-red);
  background: var(--sp-red);
}

.style-picker-modal__tab.is-active em {
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
}

.style-picker-modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem 1.15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(221, 0, 0, 0.55) transparent;
}

.style-picker-modal__body::-webkit-scrollbar {
  width: 5px;
}

.style-picker-modal__body::-webkit-scrollbar-thumb {
  background: var(--sp-red);
  border-radius: 999px;
}

.style-picker-modal__category {
  margin-bottom: 0;
}

.style-picker-modal__empty {
  margin: 3rem auto;
  max-width: 28ch;
  color: var(--sp-muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.style-picker-modal__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  max-width: 68rem;
  margin: 0 auto;
}

.style-picker-modal__category--movies {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.style-picker-modal__category--shorts {
  min-width: 0;
  max-width: 68rem;
  margin: 0 auto;
}

.style-picker-modal__shorts-host {
  min-width: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.style-picker-modal__category--porn {
  min-width: 0;
  max-width: 68rem;
  margin: 0 auto;
}

.style-picker-modal__porn-host {
  min-width: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.style-picker-modal.is-shorts-panel .style-picker-modal__footer,
.style-picker-modal.is-porn-panel .style-picker-modal__footer {
  display: none;
}

.style-picker-modal.is-shorts-panel .style-picker-modal__body,
.style-picker-modal.is-porn-panel .style-picker-modal__body {
  padding-bottom: 1.25rem;
}

/* Movies tab: reuse home carousel; IR accent only on group heads */
.style-picker-modal__category--movies .home-movies-group__head > .material-symbols-outlined {
  color: var(--sp-red);
}

.style-picker-modal__category--movies .home-movies-card.is-selected {
  border-color: var(--sp-red);
  box-shadow:
    0 0 0 1px rgba(221, 0, 0, 0.45),
    0 0 1.25rem rgba(221, 0, 0, 0.25);
}

.style-picker-modal__category--movies .home-hscroll__arrow {
  color: #fff;
}

.style-picker-modal__category--movies .home-movies-grid {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 1200px) {
  .style-picker-modal__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.style-picker-modal__card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: #101010;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease;
}

.style-picker-modal__card video,
.style-picker-modal__card img:not(.style-picker-modal__card-logo) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  background: #000;
  transition: transform 0.35s ease, filter 0.25s ease;
}

.style-picker-modal__card.has-logo-fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(221, 0, 0, 0.18), transparent 65%),
    #101010;
}

.style-picker-modal__card-logo {
  width: 52%;
  height: auto;
  margin-bottom: 1.4rem;
  opacity: 0.85;
}

.style-picker-modal__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.88) 100%);
  pointer-events: none;
}

.style-picker-modal__card:hover video,
.style-picker-modal__card:hover img:not(.style-picker-modal__card-logo) {
  transform: scale(1.04);
  filter: brightness(1.05);
}

.style-picker-modal__card.is-active {
  border-color: var(--sp-red);
  box-shadow:
    0 0 0 1px rgba(221, 0, 0, 0.45),
    0 0 1.5rem rgba(221, 0, 0, 0.28);
}

.style-picker-modal__card::before {
  content: "\2713";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  color: #fff;
  background: var(--sp-red);
  font-size: 0.85rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.style-picker-modal__card.is-active::before {
  opacity: 1;
  transform: none;
}

.style-picker-modal__card-label {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 0.45rem 0.55rem;
  border-radius: 0.65rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
}

.style-picker-modal__card.is-active .style-picker-modal__card-label {
  background: var(--sp-red);
}

.style-picker-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem calc(1.05rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}

.style-picker-modal__selected {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.style-picker-modal__selected-kicker {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.style-picker-modal__selected-name {
  overflow: hidden;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-picker-modal__status {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
}

.style-picker-modal__status[hidden] {
  display: none !important;
}

.style-picker-modal__generate {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 11rem;
  min-height: 2.9rem;
  padding: 0.65rem 1.35rem;
  border: 0;
  border-radius: 0.65rem;
  color: #fff;
  background: var(--sp-red);
  box-shadow: 0 0.45rem 1.25rem rgba(221, 0, 0, 0.28);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.style-picker-modal__generate:hover:not(:disabled) {
  filter: brightness(1.08);
}

.style-picker-modal__generate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.style-picker-modal__generate.is-busy {
  opacity: 0.75;
  cursor: wait;
}

@media (max-width: 900px) {
  .style-picker-modal__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .style-picker-modal__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
  }
}

@media (max-width: 640px) {
  .style-picker-modal {
    padding: 0;
  }

  .style-picker-modal__sheet {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .style-picker-modal__header {
    align-items: flex-start;
    text-align: left;
    padding: 1.1rem 3rem 0.55rem 1rem;
  }

  .style-picker-modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .style-picker-modal__footer {
    flex-wrap: wrap;
  }

  .style-picker-modal__generate {
    flex: 1 1 auto;
    min-width: 0;
  }
}
