/* ============================================================
   BANNER
   ============================================================ */
.detail-banner { position: relative; width: 100%; height: 60vw; max-height: 420px; min-height: 320px; background: #111; flex: none; overflow: hidden; }
.detail-banner img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.detail-banner .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,.25) 0%, rgba(10,10,10,0) 25%, rgba(10,10,10,.65) 65%, #0a0a0a 100%); }
.detail-banner-content { position: absolute; bottom: 22px; left: 20px; right: 20px; z-index: 5; }
.app-brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.app-brand-text { position: relative; display: inline-block; font-size: 22px; font-weight: 900; font-style: italic; letter-spacing: -0.8px; line-height: 1.1; white-space: nowrap; }
.banner-logo-wrap { position: relative; min-height: 40px; max-width: 80%; }
.banner-logo-img { display: block; max-height: 68px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 4px 16px rgba(0,0,0,1)); }
.banner-title { font-size: 24px; font-weight: 900; line-height: 1.1; color: #fff; text-shadow: 0 3px 12px rgba(0,0,0,1); margin: 0; }
.type-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 8px; font-size: 10px; font-weight: 900; letter-spacing: 2px; color: #fff; background: linear-gradient(135deg, rgba(30,30,30,0.9) 0%, rgba(60,20,22,0.8) 45%, rgba(229,9,20,0.6) 100%); border: 1px solid rgba(255,255,255,0.18); }
.type-badge.type-serie { background: linear-gradient(135deg, rgba(30,30,30,0.9) 0%, rgba(25,35,55,0.8) 45%, rgba(90,120,220,0.6) 100%); }

/* ============================================================
   BODY
   ============================================================ */
.detail-body { padding: 14px 20px 40px 20px; }
.meta-line-top { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.88); flex-wrap: wrap; margin-bottom: 10px; }
.meta-line-top .match { color: #46d369; font-weight: 900; }
.genre-pills-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding: 2px 0 4px 0; }
.genre-pills-row::-webkit-scrollbar { display: none; }
.genre-pill { position: relative; flex: none; height: 26px; padding: 0 14px; border-radius: 10px; color: #fff; font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; white-space: nowrap; letter-spacing: 0.4px; overflow: hidden; background: linear-gradient(135deg, #E50914 0%, #ff3b46 35%, #ffffff 100%); box-shadow: 0 4px 12px rgba(229,9,20,0.35); border: none; transition: transform 0.15s; }
.genre-pill:active { transform: scale(0.94); }
.main-synopsis { font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.92); }
.main-synopsis.collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.synopsis-more-btn { font-size: 12px; font-weight: 800; color: #1e88e5; margin-top: 6px; cursor: pointer; background: none; border: none; padding: 0; }
.btn-assistir-big { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 15px 20px; margin-top: 18px; background: #fff; color: #000; font-weight: 900; font-size: 16px; border: none; border-radius: 12px; cursor: pointer; transition: transform 0.15s; }
.btn-assistir-big:active { transform: scale(0.97); background: #e6e6e6; }
.action-buttons-row { display: flex; align-items: flex-start; justify-content: space-around; margin-top: 18px; padding: 4px 0; gap: 4px; }
.action-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; background: none; border: none; color: #fff; padding: 6px 4px; transition: transform 0.15s; flex: 1; min-width: 0; }
.action-btn:active { transform: scale(0.9); opacity: 0.7; }
.action-btn-icon { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.action-btn-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.85); white-space: nowrap; }

/* ============================================================
   ELENCO
   ============================================================ */
.cast-section { margin-top: 28px; margin-left: -20px; margin-right: -20px; }
.cast-section h3 { font-size: 13px; font-weight: 900; color: #909090; text-transform: uppercase; letter-spacing: 2.5px; margin-bottom: 16px; padding-left: 20px; }
.cast-carousel { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; padding: 4px 20px 8px 20px; }
.cast-carousel::-webkit-scrollbar { display: none; }
.cast-card { flex: none; width: 100px; cursor: pointer; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cast-avatar { position: relative; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: #1a1a1a; border: 2px solid rgba(255,255,255,0.08); box-shadow: 0 6px 18px rgba(0,0,0,0.7); margin-bottom: 10px; flex-shrink: 0; }
.cast-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cast-avatar-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2a2a2a 0%, #151515 100%); }
.cast-avatar-fallback i { font-size: 32px; color: rgba(255,255,255,0.22); }
.cast-name { font-size: 12px; font-weight: 800; color: #fff; line-height: 1.25; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; }
.cast-role { font-size: 10.5px; color: #999; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; }
.cast-text { font-size: 12px; color: rgba(255,255,255,0.75); line-height: 1.6; padding: 0 20px; }

/* ============================================================
   SIMILARES
   ============================================================ */
.similar-section { margin-top: 36px; }
.similar-section h3 { font-size: 16px; font-weight: 900; color: #fff; margin-bottom: 14px; }
.similar-carousel { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.similar-carousel::-webkit-scrollbar { display: none; }
.similar-card { flex: none; width: 120px; cursor: pointer; }
.similar-thumb { width: 120px; height: 170px; border-radius: 8px; overflow: hidden; background: #1a1a1a; position: relative; box-shadow: 0 4px 14px rgba(0,0,0,0.6); }
.similar-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.similar-title { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.85); margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }

/* ============================================================
   TRAVA SCROLL DO BODY COM DETALHES ABERTO
   ============================================================ */
body.details-open { overflow: hidden !important; overscroll-behavior: none; }
body.details-open #app-container { visibility: hidden; }

/* ============================================================
   ANIMAÇÃO SLIDE IN/OUT
   ============================================================ */
#detailsScreen {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    will-change: transform;
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
#detailsScreen.slide-in { transform: translateX(100%); opacity: 1; }
#detailsScreen.slide-out { transform: translateX(100%); opacity: 1; transition: transform 0.38s cubic-bezier(0.4, 0, 0.6, 1); pointer-events: none; }
#detailsScreen .detail-banner,
#detailsScreen .detail-body { transition: transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1); }
#detailsScreen.slide-in .detail-banner,
#detailsScreen.slide-in .detail-body { transform: translateX(30px); }
#detailsScreen:not(.slide-in) .detail-banner,
#detailsScreen:not(.slide-in) .detail-body { transform: translateX(0); }

/* ============================================================
   TRANSIÇÃO DO BANNER (fade quando abre trailer)
   ============================================================ */
.detail-banner img.bg,
.detail-banner .overlay,
.detail-banner-content { transition: opacity 0.45s ease; }

/* ============================================================
   TRAILER PLAYER
   ============================================================ */
.trailer-player { position: absolute; inset: 0; z-index: 15; background: #000; overflow: hidden; animation: trailerFadeIn 0.4s ease; cursor: pointer; }
@keyframes trailerFadeIn { from { opacity: 0; } to { opacity: 1; } }
.trailer-player #ytTarget,
.trailer-player iframe { position: absolute; top: 50%; left: 50%; width: 178vh; min-width: 100%; height: 56.25vw; min-height: 100%; transform: translate(-50%, -55%); pointer-events: none; border: 0; }
.trailer-player::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 42px; background: #000; z-index: 3; pointer-events: none; }
.trailer-player::after { content: ''; position: absolute; top: 42px; left: 0; right: 0; height: 14px; background: linear-gradient(180deg, #000 0%, transparent 100%); z-index: 3; pointer-events: none; }
.trailer-overlay-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; background: rgba(0,0,0,0.55); border: 2px solid rgba(255,255,255,0.75); color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 4; transition: opacity 0.3s ease, transform 0.15s ease; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding-left: 4px; }
.trailer-overlay-btn.playing { opacity: 0; pointer-events: none; }
.trailer-overlay-btn:active { transform: translate(-50%, -50%) scale(0.9); }
.trailer-close-btn { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.25); color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 6; }
.trailer-close-btn:active { transform: scale(0.9); }
.trailer-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.15); z-index: 6; }
.trailer-progress-bar { height: 100%; width: 0%; background: #E50914; transition: width 0.35s linear; }

/* ============================================================
   CONTADOR DE CURTIDAS
   ============================================================ */
.action-btn-count { font-size: 10px; font-weight: 800; color: #888; line-height: 1; margin-top: 1px; letter-spacing: 0.3px; min-height: 10px; }
.action-btn-icon.like-pop { animation: likePop 0.35s ease; }
@keyframes likePop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ============================================================
   CHEVRON DO EPISÓDIO
   ============================================================ */
.episode-chevron-btn { background: none; border: none; padding: 6px 4px; cursor: pointer; color: rgba(255,255,255,0.5); display: flex; align-items: center; justify-content: center; transition: color 0.2s; }
.episode-chevron-btn:active { transform: scale(0.9); }
.episode-card.expanded .episode-chevron-btn .episode-chevron { transform: rotate(180deg); color: #E50914; }

/* ============================================================
   SKELETON — CORRIGIDO (box-sizing + flex-shrink + overflow hidden)
   ============================================================ */
.skeleton-loader {
    background: #1e1e1e;
    animation: skeletonPulse 1.2s ease-in-out infinite;
    border-radius: 6px;
    box-sizing: border-box;
}
@keyframes skeletonPulse { 0% { opacity: .6; } 50% { opacity: .25; } 100% { opacity: .6; } }

.skeleton-block {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    box-sizing: border-box;
    flex-shrink: 0;
}
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Banner skeleton (fundo enquanto carrega a capa) */
#detailsScreen .detail-banner .skeleton-loader {
    position: absolute;
    inset: 0;
    border-radius: 0;
}

/* Meta row (linha de infos: relevante, ano, classificação, duração) */
.skeleton-detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.skeleton-detail-meta .skeleton-block {
    height: 14px;
    border-radius: 4px;
    flex: none;
}

/* Pills de gênero */
.skeleton-detail-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.skeleton-detail-pills .skeleton-block {
    height: 26px;
    border-radius: 10px;
    flex: none;
}

/* Botão grande (assistir) */
.skeleton-detail-btn {
    width: 100% !important;
    max-width: 100%;
    height: 52px !important;
    border-radius: 12px;
    margin: 18px 0 !important;
    display: block !important;
    box-sizing: border-box;
}

/* Botões de ação (círculos) */
.skeleton-detail-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    gap: 8px;
    margin: 18px 0 24px 0;
}
.skeleton-detail-action {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
    border-radius: 50% !important;
    flex: none !important;
    display: block !important;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
}

/* Linhas de texto (sinopse) */
.skeleton-detail-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0 20px 0;
}
.skeleton-detail-lines .skeleton-block {
    height: 12px;
    border-radius: 4px;
    display: block;
}

/* Elenco (avatares redondos) */
.skeleton-detail-cast {
    display: flex;
    gap: 16px;
    margin: 28px -20px 24px -20px;
    padding: 0 20px;
    overflow: hidden;
}
.skeleton-detail-cast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: none !important;
    width: 84px;
    box-sizing: border-box;
}
.skeleton-detail-cast-avatar {
    width: 84px !important;
    height: 84px !important;
    min-width: 84px;
    min-height: 84px;
    max-width: 84px;
    max-height: 84px;
    border-radius: 50% !important;
    flex: none !important;
    display: block !important;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
}