/**
 * YouTube Shorts Section Styles
 * 
 * @package VideoHub
 */

.vh-shorts-section {
    padding: 24px 0;
    margin: 24px 0;
    border-bottom: 4px solid var(--vh-surface);
}

.vh-shorts-header {
    margin-bottom: 16px;
    padding: 0 4px;
}

.vh-shorts-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--vh-text);
}

.vh-shorts-badge:hover {
    color: var(--vh-primary);
}

.vh-shorts-badge span {
    font-size: 1.25rem;
    font-weight: 700;
}

.vh-shorts-container {
    position: relative;
    padding: 0 40px;
}

.vh-shorts-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 16px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.vh-shorts-scroll::-webkit-scrollbar {
    display: none;
}

.vh-shorts-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--vh-surface);
    border: 1px solid var(--vh-border);
    color: var(--vh-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
    opacity: 0;
}

.vh-shorts-container:hover .vh-shorts-nav {
    opacity: 1;
}

.vh-shorts-nav:hover {
    background: var(--vh-surface-hover);
    transform: translateY(-50%) scale(1.1);
}

.vh-shorts-prev {
    left: 8px;
}

.vh-shorts-next {
    right: 8px;
}

/* Shorts Card (Listing) */
.vh-shorts-card {
    flex: 0 0 210px;
    max-width: 210px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    transition: transform 0.2s;
}

@media (max-width: 768px) {
    .vh-shorts-card {
        flex: 0 0 160px;
        max-width: 160px;
    }

    .vh-shorts-container {
        padding: 0 16px;
    }

    .vh-shorts-nav {
        display: none;
    }
}

.vh-shorts-link {
    display: block;
    width: 100%;
    aspect-ratio: 9/16;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* YouTube Badge on Shorts Card */
.vh-shorts-youtube-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.vh-shorts-card--youtube .vh-shorts-link:hover .vh-shorts-youtube-badge {
    background: rgba(255, 0, 0, 0.9);
}

.vh-shorts-youtube-badge svg {
    display: block;
}

.vh-shorts-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vh-shorts-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.vh-shorts-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--vh-text);
}

.vh-shorts-views {
    display: block;
    font-size: 0.8rem;
    color: var(--vh-text-muted);
}

/* =========================================
   Full-Screen Shorts Player (YouTube Style)
   ========================================= */

.vh-shorts-player-body {
    overflow: hidden;
    background: #0f0f0f;
    margin: 0;
    /* Preventing default margins */
    padding: 0;
}

.vh-shorts-player-page {
    position: fixed;
    inset: 0;
    background: #0f0f0f;
    z-index: 99999;
    /* Max Z-Index to stay on top of WP Admin Bar */
    display: flex;
    justify-content: center;
    align-items: center;
}

.vh-shorts-close {
    position: fixed;
    top: 80px;
    /* Safe distance from top/admin bar */
    left: 24px;
    z-index: 100000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #272727;
    color: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

/* Adjust for Admin Bar if present */
body.admin-bar .vh-shorts-close {
    top: 96px;
    /* Increased from 80px/60px to fully clear the 32px/46px admin bar */
}

.vh-shorts-close:hover {
    background: #3f3f3f;
}

/* Feed Container */
.vh-shorts-feed {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.vh-shorts-feed::-webkit-scrollbar {
    display: none;
}

/* Slide Layout */
.vh-shorts-slide {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    /* Remove padding to avoid cutting */
}

/* Wrapper for Video + Actions Side-by-Side */
.vh-shorts-layout {
    display: flex;
    align-items: center;
    gap: 16px;
    height: calc(100vh - 120px);
    /* 60px top/bottom buffer to prevent cutting */
    max-height: 800px;
    /* Reduced max height */
    width: auto;
    justify-content: center;
    position: relative;
    margin-top: 20px;
}

/* Video Container (Phone Shape) */
.vh-shorts-video-container {
    position: relative;
    height: 100%;
    aspect-ratio: 9/16;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    /* Ensure it doesn't overflow height */
    max-height: 100%;
}

.vh-shorts-video,
.vh-shorts-iframe,
.vh-shorts-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Bottom Info Overlay */
.vh-shorts-bottom-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    padding-bottom: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    color: #fff;
    pointer-events: none;
    z-index: 5;
}

.vh-shorts-channel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    pointer-events: auto;
}

.vh-shorts-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vh-shorts-avatar img,
.vh-shorts-avatar svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vh-shorts-username {
    font-weight: 600;
    font-size: 14px;
    color: #f1f1f1;
}

/* Subscribe Button - White Pill Style */
.vh-shorts-subscribe {
    background: #f1f1f1;
    color: #0f0f0f;
    border: none;
    padding: 8px 16px;
    /* Slightly larger padding */
    font-size: 14px;
    font-weight: 600;
    /* Bold font */
    border-radius: 24px;
    /* Pill shape */
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-block;
    text-decoration: none;
    line-height: normal;
    font-family: Roboto, Arial, sans-serif;
}

.vh-shorts-subscribe:hover {
    background: #d9d9d9;
}

.vh-shorts-video-title {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    pointer-events: auto;
}

/* Actions Column (Right) */
.vh-shorts-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Spacing between buttons */
    padding-bottom: 0;
    z-index: 10;
    margin-bottom: 12px;
    /* Align slightly up from very bottom */
}

.vh-shorts-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    /* Prevent button from squishing */
}

.vh-shorts-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    /* Semi-transparent gray circle */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s, color 0.2s;
    backdrop-filter: blur(4px);
    padding: 12px;
    /* Inner padding for SVG */
}

.vh-shorts-action:hover .vh-shorts-action-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.0);
    /* No scale, just color change */
}

.vh-shorts-action:active .vh-shorts-action-icon {
    background: rgba(255, 255, 255, 0.3);
}

.vh-shorts-action svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Liked State */
.vh-like-btn.liked .vh-shorts-action-icon {
    color: #fff;
    /* or YouTube red/blue if preferred */
}

.vh-like-btn.liked svg {
    fill: #ffffff;
    /* Explicit fill */
}

.vh-action-count,
.vh-action-label {
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Nav Arrows */
.vh-shorts-nav-arrow {
    position: fixed;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 200000;
    /* Extremely high z-index */
    backdrop-filter: blur(4px);
}

.vh-shorts-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.vh-shorts-up {
    top: calc(50% - 60px);
}

.vh-shorts-down {
    top: calc(50% + 10px);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .vh-shorts-layout {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        gap: 0;
        align-items: center;
        justify-content: center;
        margin-top: 0;
    }

    .vh-shorts-slide {
        padding: 0;
        height: 100vh;
        /* Force full viewport height */
    }

    .vh-shorts-video-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        display: flex;
        align-items: center;
        background: #000;
    }

    .vh-shorts-video,
    .vh-shorts-iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 9/16;
        max-height: 100vh;
        object-fit: contain;
    }

    .vh-shorts-actions {
        position: absolute;
        right: 12px;
        bottom: 80px;
        margin-bottom: 0;
        z-index: 20;
    }

    .vh-shorts-bottom-info {
        padding: 20px;
        padding-bottom: 40px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
        z-index: 15;
    }

    .vh-shorts-video-title {
        max-width: 80%;
    }

    .vh-shorts-nav-arrow {
        display: none;
    }

    .vh-shorts-close {
        top: 24px;
        left: 16px;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        width: 40px;
        height: 40px;
    }

    body.admin-bar .vh-shorts-close {
        top: 86px;
        /* Clear admin bar (46px) + safe spacing */
    }
}