body.video-viewer {
    margin: 0 !important;
}

body.video-viewer footer {
    display: none !important;
}

/* ============================================== */
/* DOJOB - VIDEO PAGE (FULLSCREEN MODE) */
/* ============================================== */

.video-page,
.video-page body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100dvh !important;
    background: #000;
}

.video-page header,
.video-page footer,
.video-page .nav-container {
    display: none !important;
}

.video-page main {
    all: unset;
}

/* ============================================== */
/* FEED VERTICAL (Scroll estilo TikTok) */
/* ============================================== */

.video-page #video-feed {
    position: fixed;
    inset: 0;

    height: 100dvh;
    overflow-y: auto;

    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
}

.video-page .video-container {
    position: relative;

    width: 100%;
    height: 100dvh;
    min-height: 100dvh;

    display: flex;
    justify-content: center;
    align-items: center;

    scroll-snap-align: start;
    scroll-snap-stop: always;

    background: #000;
}

.video-page .video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-page .video-container::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 45%;
    pointer-events: none;
    z-index: 2;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.6) 40%,
        rgba(0, 0, 0, 0.3) 70%,
        rgba(0, 0, 0, 0) 100%
    );
}

/* ============================================== */
/* UI LAYER */
/* ============================================== */

.video-page .video-ui {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    padding: 1em;
    z-index: 4;

    pointer-events: none;
}

.video-page .video-ui button,
.video-page .video-ui input {
    pointer-events: auto;
}

/* ============================================== */
/* OVERLAY (Perfil + descrição) */
/* ============================================== */

.video-page .overlay {
    max-width: 70%;
    color: var(--text-color-primary);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.video-page .overlay p {
    margin-top: 5px;
    font-size: 14px;
}

/* ============================================== */
/* BOTÕES LATERAIS */
/* ============================================== */

.video-page .bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-bottom: 20px;
}

.video-page .buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-page .buttons button {
    background: none;
    border: none;
    color: var(--text-color-primary);
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.video-page .buttons button:active {
    transform: scale(1.2);
}

.video-page .buttons i.active {
    color: var(--default-color-secondary);
    animation: pop 0.3s ease;
}

@keyframes pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ============================================== */
/* CONTROLES INFERIORES */
/* ============================================== */

.video-page .video-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.video-page .video-controls .time {
    color: var(--text-color-primary);
    font-size: 12px;
    min-width: 40px;
}

.video-page .progress-bar {
    flex: 1;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.video-page .progress-bar::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    background: var(--default-color-secondary);
    border-radius: 50%;
    cursor: pointer;
}

.video-page .btn-sound {
    background: none;
    border: none;
    color: var(--text-color-primary);
    font-size: 16px;
    cursor: pointer;
    width: 2em;
}

/* ============================================== */
/* PAUSE OVERLAY CENTRAL */
/* ============================================== */

.video-page .pause-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.video-page .pause-overlay i {
    font-size: 60px;
    color: var(--text-color-primary);
    opacity: 0.8;
}

/* ============================================== */
/* BOTÃO VOLTAR */
/* ============================================== */

.video-page .video-back-btn {
    position: fixed;
    top: 0.5em;
    left: 0.5em;
    z-index: 10;

    background: none;
    border: none;
    color: var(--text-color-primary);
    font-size: 2em;
    cursor: pointer;
}

.video-page .video-back-btn:active {
    transform: scale(0.9);
}

/* ============================================== */
/* OCULTAR SCROLLBAR (mantendo scroll ativo) */
/* ============================================== */

.video-page #video-feed {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.video-page #video-feed::-webkit-scrollbar {
    display: none;
}

#videos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25em;
    width: 100%;
}

@media(min-width: 900px) {
    #videos-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ============================================== */
/* GRID DE VÍDEOS & CARDS (CORRIGIDO)             */
/* ============================================== */

.video-card {
    display: block;
    width: 100%;
    overflow: hidden;
}

/* 1. Definimos o aspect-ratio no wrapper para segurar o tamanho com elementos absolutos */
.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16; /* Mantém proporção vertical perfeita tipo TikTok/Reels */
    overflow: hidden;
    background-color: #000; /* Fundo preto caso o vídeo demore um pouco para carregar */
}

/* 2. Sobrepomos o vídeo e a imagem ocupando 100% do wrapper */
.video-preview-player,
.video-preview-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease; /* Transição suave de fade no hover */
}

/* 3. ESTADO PADRÃO: Mostra apenas a imagem (thumbnail) e esconde o vídeo */
.video-preview-player {
    opacity: 0;
    pointer-events: none; /* Evita cliques acidentais no vídeo enquanto oculto */
}

.video-preview-img {
    opacity: 1;
    pointer-events: auto;
    display: block;
}

/* 4. ESTADO PLAYING: Quando o JS adiciona a classe .playing no hover/toque */
.video-card.playing .video-preview-player {
    opacity: 1;
    pointer-events: auto;
}

.video-card.playing .video-preview-img {
    opacity: 0;
    pointer-events: none;
}

/* 5. SEGURANÇA: Esconde o ícone de imagem quebrada do navegador enquanto a thumb não carrega no src */
.video-preview-img[src=""],
.video-preview-img:not([src]) {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Outros estilos complementares que você já tinha */
.videos-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.video-thumb {
    position: relative;
    aspect-ratio: 9/16;
    overflow: hidden;
    cursor: pointer;
}

.video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}