/* =============================================
   VIDEO GRID - LISTING PAGE
============================================= */
.cvg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0;
}
.cvg-grid.cvg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.cvg-grid.cvg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cvg-grid.cvg-cols-1 { grid-template-columns: 1fr; }

@media (max-width: 1024px) {
    .cvg-grid,
    .cvg-grid.cvg-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .cvg-grid,
    .cvg-grid.cvg-cols-4,
    .cvg-grid.cvg-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .cvg-grid,
    .cvg-grid.cvg-cols-4,
    .cvg-grid.cvg-cols-3,
    .cvg-grid.cvg-cols-2 { grid-template-columns: 1fr; }
}

/* CARD */
.cvg-card {
    display: block;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cvg-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

/* THUMBNAIL 16:9 */
.cvg-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: #000;
}
.cvg-thumbnail img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.cvg-card:hover .cvg-thumbnail img {
    transform: scale(1.06);
}

/* PLAY BUTTON */
.cvg-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    background: rgba(0,0,0,0.60);
    width: 54px; height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.2s, transform 0.2s;
}
.cvg-card:hover .cvg-play-btn {
    background: rgba(200,0,0,0.9);
    transform: translate(-50%, -60%) scale(1.1);
}
.cvg-play-btn svg { margin-left: 4px; }

/* DARK OVERLAY */
.cvg-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.88));
    padding: 35px 10px 10px;
    z-index: 4;
}

/* TITLE */
.cvg-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 5px;
    line-height: 1.4;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* TIME */
.cvg-time {
    color: #ccc;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}


/* =============================================
   SINGLE VIDEO PLAYER PAGE
============================================= */
body:has(.cvg-player-page) {
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    height: 100vh;
}

.cvg-player-page {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* LEFT - BACK BUTTON */
.cvg-back-btn {
    position: absolute;
    top: 18px;
    left: 15px;
    z-index: 100;
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.08);
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.cvg-back-btn:hover { background: rgba(255,255,255,0.2); }

/* CENTER WRAPPER */
.cvg-center {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    justify-content: center;
}

/* LOGO */
.cvg-logo {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}
.cvg-logo img {
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.cvg-site-name {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

/* VIDEO BOX */
.cvg-video-box {
    position: relative;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    background: #000;
}

/* VIDEO ELEMENT */
.cvg-video-box video {
    width: 100%;
    display: block;
    max-height: 80vh;
    background: #000;
    object-fit: contain;
}

/* VIDEO TITLE OVERLAY (bottom of video) */
.cvg-video-title-overlay {
    position: absolute;
    bottom: 55px;
    left: 0; right: 0;
    padding: 30px 12px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
    pointer-events: none;
    z-index: 5;
}

/* TIME BAR */
.cvg-video-meta-bar {
    width: 100%;
    padding: 6px 10px;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
}
.cvg-post-time {
    color: #aaa;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* RIGHT PANEL */
.cvg-right-panel {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

/* SHARE GROUP */
.cvg-share-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* SHARE BUTTONS */
.cvg-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.cvg-share-btn svg {
    width: 42px; height: 42px;
    border-radius: 50%;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cvg-share-btn span {
    color: #ccc;
    font-size: 11px;
    text-align: center;
}
.cvg-fb svg  { background: #1877f2; }
.cvg-tw svg  { background: #000; border: 1px solid #555; }
.cvg-copy svg { background: #444; }

.cvg-share-btn:hover svg { opacity: 0.85; }

/* NAV GROUP (up/down arrows) */
.cvg-nav-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cvg-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    text-decoration: none;
    transition: background 0.2s;
}
.cvg-nav-btn:hover { background: rgba(255,255,255,0.25); }

.cvg-nav-disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    cursor: not-allowed;
    opacity: 0.4;
}

/* NO VIDEO */
.cvg-no-video {
    color: #fff;
    text-align: center;
    padding: 40px;
    font-size: 15px;
}

/* =============================================
   MOBILE RESPONSIVE - PLAYER PAGE
============================================= */
@media (max-width: 768px) {
    .cvg-center {
        max-width: 100%;
    }
    .cvg-right-panel {
        right: 6px;
        gap: 15px;
    }
    .cvg-share-btn svg,
    .cvg-nav-btn {
        width: 36px; height: 36px;
    }
    .cvg-video-title-overlay {
        font-size: 13px;
        bottom: 50px;
    }
}

@media (max-width: 480px) {
    .cvg-right-panel { right: 4px; }
    .cvg-share-btn span { font-size: 10px; }
    .cvg-share-btn svg,
    .cvg-nav-btn {
        width: 32px; height: 32px;
        padding: 8px;
    }
}