/* Layout base já nasce centralizado desde o primeiro render */
body.page-shorts {
  overflow: hidden;
  background: #141414;
}

body.page-shorts #geral,
body.page-shorts #corpo {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  float: none;
}

body.page-shorts .spaceMenu {
  margin-top: 0;
}

body.page-shorts .conteudoBox {
  display: none;
}

/* Botão X para sair do modo Shorts no canto superior direito */
.shorts-exit-btn {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(35, 35, 35, 0.85);
  border: 1px solid #444;
  color: #fff !important;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  transition: background 0.15s, border-color 0.15s;
}

.shorts-exit-btn:hover {
  background: #f06292;
  border-color: #f06292;
}

/* Container com Scroll Snap (sem scroll-behavior: smooth para não animar o load inicial) */
.shorts-feed {
  width: 100%;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.shorts-feed::-webkit-scrollbar {
  display: none;
}

/* Cada slide de vídeo */
.short-item {
  width: 100%;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 12px 0;
}

/* Wrapper central (Desktop: 9:16 centralizado + barra lateral de ações) */
.short-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  height: 100%;
  max-height: 860px;
}

.short-player-wrap {
  position: relative;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: 100vw;
  background: #000;
  border: 1px solid #2b2b2b;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.short-player-wrap iframe,
.short-player-wrap video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border: 0;
}

/* Título, autor e pills sobrepostos na base do vídeo */
.short-overlay-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  padding: 32px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  color: #fff;
  pointer-events: none;
  z-index: 5;
}

.short-author-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #fff !important;
  pointer-events: auto;
}

.short-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #f06292;
}

.short-author-name {
  font-size: 0.92em;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.short-overlay-info h1,
.short-overlay-info h2 {
  font-size: 1.05em;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
  pointer-events: auto;
}

.short-overlay-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 6px;
  pointer-events: auto;
}

.short-overlay-pills .genero_btn {
  margin: 0;
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(35, 35, 35, 0.85);
}

.short-overlay-meta {
  font-size: 0.85em;
  color: #ccc;
  pointer-events: auto;
}

/* Coluna de ações */
.short-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 10px;
  z-index: 10;
  flex-shrink: 0;
}

.short-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ccc;
  text-align: center;
  user-select: none;
}

.short-action-btn .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #232323;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.short-action-btn:hover .icon-circle {
  background: #333;
  border-color: #f06292;
}

.short-action-btn.active .icon-circle {
  background: #f06292;
  border-color: #f06292;
}

.short-action-btn.active {
  color: #fff;
}

.short-action-btn img {
  width: 18px;
  height: 18px;
}

.short-action-btn span {
  font-size: 12px;
  color: #ccc;
}

/* Setas fixas de navegação no Desktop */
.shorts-nav-arrows {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.shorts-nav-arrows button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #232323;
  border: 1px solid #333;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.shorts-nav-arrows button:hover {
  background: #f06292;
  border-color: #f06292;
}

/* Gaveta lateral/inferior para Comentários e Infos */
.shorts-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99990;
}

.shorts-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 100vw;
  height: 100dvh;
  background: #1b1b1b;
  border-left: 1px solid #333;
  z-index: 99995;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
}

.shorts-drawer.open {
  right: 0;
}

.shorts-drawer-header {
  height: 48px;
  background: #232323;
  border-bottom: 2px solid #f06292;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-size: 1.05em;
}

.shorts-drawer-close {
  background: #333;
  border: 0;
  color: #fff;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
}

.shorts-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.js_modalBox,
.confirm_background,
.alert_view_box {
  z-index: 999999 !important;
}

/* MOBILE */
@media screen and (max-width: 768px) {
  .short-item {
    padding: 0;
  }

  .short-stage {
    width: 100%;
    height: 100%;
    max-height: none;
    gap: 0;
  }

  .short-player-wrap {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
  }

  .short-overlay-info {
    padding-right: 72px;
  }

  .short-actions {
    position: absolute;
    right: 10px;
    bottom: 20px;
  }

  .short-action-btn .icon-circle {
    background: rgba(35, 35, 35, 0.75);
  }

  .shorts-nav-arrows {
    display: none;
  }

  .shorts-drawer {
    top: auto;
    bottom: -80vh;
    right: 0;
    width: 100%;
    height: 75dvh;
    border-left: 0;
    border-top: 2px solid #f06292;
    transition: bottom 0.25s ease;
  }

  .shorts-drawer.open {
    bottom: 0;
  }
}