/* =============================================================
   Reel World — Estilos principais
   ============================================================= */

/* ---------- Reset / Box-sizing (escopo do plugin) ---------- */
.rw-block,
.rw-player-overlay {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}
.rw-block *,
.rw-block *::before,
.rw-block *::after,
.rw-player-overlay *,
.rw-player-overlay *::before,
.rw-player-overlay *::after {
	box-sizing: inherit;
}

/* Bloqueia inversão por Dark Reader / modo escuro do SO */
.rw-player-overlay {
	color-scheme: only light;
}

/* ---------- Variáveis dos blocos de cards ---------- */
.rw-block {
	color: #111;
	margin: 32px 0;
}

/* ============================================================
   Cabeçalho dos blocos (Reel World / Trending Reels)
   ============================================================ */
.rw-block-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}
.rw-block-title {
	display: flex;
	align-items: center;
	gap: 10px;
}
.rw-block-title h2 {
	font-size: 28px;
	font-weight: 800;
	margin: 0;
	line-height: 1;
	color: #111;
}
.rw-block-icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	display: inline-block;
	flex-shrink: 0;
}
.rw-block-icon--default {
	background: #16b378;
	position: relative;
}
.rw-block-icon--default::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent #fff;
	transform: translate(-40%, -50%);
}
.rw-see-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	text-decoration: none;
	color: #111;
	white-space: nowrap;
}
.rw-see-all:hover { text-decoration: underline; }

/* ============================================================
   Carrossel horizontal
   ============================================================ */
.rw-carousel {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 6px;
	scrollbar-width: thin;
}
.rw-carousel .rw-card {
	flex: 0 0 auto;
	width: 200px;
	scroll-snap-align: start;
}

/* ============================================================
   Grade (Trending Reels)
   ============================================================ */
.rw-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}
@media (max-width: 900px) {
	.rw-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
	.rw-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Card estilo Entertainment Weekly
   (capa vertical 9:16, selo da fonte no topo, título sobre a imagem)
   ============================================================ */
.rw-card {
	display: block;
	width: 100%;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: inherit;
}
.rw-card-media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16;
	background: #111;
	border-radius: 6px;
	overflow: hidden;
}
.rw-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}
.rw-card-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 30%, rgba(0,0,0,0) 55%),
		linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0) 25%);
	pointer-events: none;
}
.rw-card:hover .rw-card-media img { transform: scale(1.04); }

/* Selo da fonte (EW / People) no canto superior esquerdo */
.rw-card-source {
	position: absolute;
	top: 8px;
	left: 8px;
	right: 8px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 5px;
	pointer-events: none;
}
.rw-card-source-logo {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: #fff;
}
.rw-card-source-name {
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.rw-card-verified { flex-shrink: 0; }

.rw-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0,0,0,.35);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
.rw-play-btn svg { margin-left: 2px; }

/* Legenda opcional no meio do card */
.rw-overlay-text {
	position: absolute;
	left: 10px;
	right: 10px;
	top: 62%;
	z-index: 2;
	padding: 6px 8px;
	border-radius: 4px;
	background: rgba(0,0,0,.7);
	font-size: 11px;
	line-height: 1.25;
	font-weight: 600;
	color: #fff;
	pointer-events: none;
}

/* Título branco sobre a imagem, no rodapé do card */
.rw-card-title {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	z-index: 2;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-weight: 800;
	font-size: 13px;
	line-height: 1.25;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0,0,0,.7);
	pointer-events: none;
}

/* ============================================================
   Player em tela cheia
   ============================================================ */
.rw-player-overlay {
	position: fixed;
	inset: 0;
	background: #000;
	z-index: 100000;
	/* NÃO usa flex nem grid aqui — usamos position:absolute nos filhos */
}
.rw-player-overlay[hidden] { display: none !important; }

/*
 * Container interno: preenche o overlay, position:relative
 * para ancorar todos os elementos absolutos (marca, fechar, grid).
 */
.rw-player-inner {
	position: relative;
	width: 100%;
	height: 100%;
	display: grid;
	grid-template-columns: 1fr 60px 340px;
	grid-template-areas: "stage nav sidebar";
	align-items: center;
	gap: 24px;
	padding: 60px 24px 24px; /* topo 60px para não colidir com marca/fechar */
	max-width: 1400px;
	margin: 0 auto;
}

/* ---------- Marca do portal ----------
   position:absolute em relação ao .rw-player-inner (que é relative).
   Canto superior ESQUERDO, acima do grid.                           */
.rw-player-brand {
	position: absolute;
	top: 16px;
	left: 24px;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 8px;
	pointer-events: none; /* não captura cliques */
}
.rw-player-brand img {
	max-height: 28px;
	max-width: 150px;
	display: block;
	object-fit: contain;
}
.rw-player-brand-text {
	font-size: 17px;
	font-weight: 800;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0,0,0,.7);
	white-space: nowrap;
}

/* ---------- Botão fechar ----------
   Canto superior DIREITO, sobre o grid.                            */
.rw-player-close {
	position: absolute;
	top: 14px;
	right: 24px;
	z-index: 10;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.rw-player-close:hover { background: #f0f0f0; }
.rw-player-close svg { display: block; }

/* ---------- Stage (coluna do vídeo) ---------- */
.rw-player-stage {
	grid-area: stage;
	position: relative;
	justify-self: center;
	width: min(100%, 420px);
	aspect-ratio: 9 / 16;
	max-height: calc(100vh - 80px);
	background: #111;
	border-radius: 10px;
	overflow: hidden;
}

/* Vídeo nativo */
.rw-player-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: #000;
	z-index: 0;
}

/* Container de embed (TikTok, YouTube, etc.) */
.rw-player-embed {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: none;
	overflow: hidden;
	z-index: 0;
}
.rw-player-embed iframe,
.rw-player-embed blockquote {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	border: none;
}

/* Modo embed: troca elementos visíveis */
.rw-player-stage.is-embed .rw-player-video  { display: none; }
.rw-player-stage.is-embed .rw-player-embed  { display: block; }
.rw-player-stage.is-embed .rw-pp-overlay,
.rw-player-stage.is-embed .rw-player-progress,
.rw-player-stage.is-embed #rw-play-pause-btn,
.rw-player-stage.is-embed #rw-mute-btn {
	display: none !important;
}

/* ---------- Overlay de play/pause ----------
   Cobre o vídeo inteiro; background sempre transparente
   para NÃO escurecer na hover.                          */
.rw-pp-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	background: transparent !important; /* força transparente mesmo com temas */
	-webkit-tap-highlight-color: transparent;
	outline: none;
}
.rw-pp-circle {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(0,0,0,.42);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity .18s ease;
}
/* Estado padrão (pausado): mostra play, esconde pause */
.rw-pp-icon-play  { display: block; }
.rw-pp-icon-pause { display: none;  }

/* Quando tocando: circulo vira invisible mas segue clicável */
.rw-player-stage.is-playing .rw-pp-circle    { opacity: 0; }
.rw-player-stage.is-playing .rw-pp-icon-play  { display: none;  }
.rw-player-stage.is-playing .rw-pp-icon-pause { display: block; }

/* ---------- Meta bar (logo fonte + botões) ---------- */
.rw-player-meta {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 46px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 8px;
}
.rw-player-source-logo {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #16b378 center/cover no-repeat;
	flex-shrink: 0;
	border: 1px solid rgba(255,255,255,.35);
}
.rw-player-source-name {
	flex: 1;
	font-weight: 700;
	font-size: 13px;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0,0,0,.5);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.rw-icon-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #fff;
}
.rw-icon-btn svg path { fill: #fff; }
.rw-like-btn.is-active svg path { fill: #e53e3e; }

/* ---------- Título ---------- */
.rw-player-title {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 20px;
	z-index: 3;
	margin: 0;
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
	text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* ---------- Barra de progresso ---------- */
.rw-player-progress {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 3px;
	background: rgba(255,255,255,.25);
	z-index: 3;
}
.rw-player-progress span {
	display: block;
	height: 100%;
	width: 0%;
	background: #e50914;
	transition: width .1s linear;
}

/* ---------- Nav (setas ↑↓) ---------- */
.rw-player-nav {
	grid-area: nav;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}
.rw-nav-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	border: none;
	color: #111;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0,0,0,.35);
	flex-shrink: 0;
}
.rw-nav-btn:disabled { opacity: .35; cursor: default; }
.rw-nav-btn svg path { fill: #111; }

/* ---------- Sidebar (anúncio + sugestões) ---------- */
.rw-player-sidebar {
	grid-area: sidebar;
	max-height: calc(100vh - 80px);
	overflow-y: auto;
}
.rw-player-sidebar h3 {
	font-size: 17px;
	font-weight: 700;
	color: #fff;
	margin: 0 0 12px;
}
.rw-ad-slot {
	background: #1a1a1a;
	border-radius: 8px;
	padding: 10px;
	margin-bottom: 20px;
}
.rw-suggestions-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.rw-suggestion {
	display: flex;
	gap: 10px;
	width: 100%;
	background: none;
	border: none;
	padding: 6px;
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: #fff;
}
.rw-suggestion:hover,
.rw-suggestion.is-active { background: rgba(255,255,255,.09); }
.rw-suggestion-thumb {
	width: 64px;
	height: 64px;
	border-radius: 6px;
	object-fit: cover;
	background: #333;
	flex-shrink: 0;
}
.rw-suggestion-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	justify-content: center;
}
.rw-suggestion-title {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.rw-suggestion-badge {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .05em;
	color: #aaa;
	text-transform: uppercase;
}
.rw-suggestion-status {
	font-size: 11px;
	color: #16b378;
}

/* ============================================================
   Responsivo — mobile/tablet
   ============================================================ */
@media (max-width: 900px) {
	.rw-player-inner {
		grid-template-columns: 1fr;
		grid-template-areas: "stage" "nav" "sidebar";
		padding: 56px 16px 20px;
		gap: 16px;
		overflow-y: auto;
		height: 100%;
		align-content: start;
	}
	.rw-player-brand { left: 16px; }
	.rw-player-close { right: 16px; }
	.rw-player-nav {
		flex-direction: row;
		justify-content: center;
	}
	.rw-player-sidebar { max-height: none; }
	.rw-player-stage {
		width: min(100%, 340px);
		justify-self: center;
	}
}

/* Trava scroll do body quando player está aberto */
body.rw-lock-scroll { overflow: hidden; }

/* Banner de anúncio na barra lateral do player */
.rw-ad-banner {
	display: block;
	width: 100%;
	max-width: 300px;
	height: auto;
	border-radius: 4px;
}
