/**
 * Playlist Hub Styles
 * 
 * Styles for the Community Hub and My Playlists feature.
 * @package VideoHub
 */

/* ==========================================================================
   Playlist Hub Page Layout
   ========================================================================== */

.vh-playlist-hub-page {
    padding: 100px 0 30px 0;
    min-height: 90vh;
    animation: vhFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--vh-background);
}

.vh-hub-layout {
    display: flex;
    gap: var(--vh-hub-gap, 32px);
    align-items: flex-start;
}

/* ==========================================================================
   Sidebar Navigation - YouTube Flat Style
   ========================================================================== */

.vh-hub-sidebar {
    width: var(--vh-hub-sidebar-width, 240px);
    flex-shrink: 0;
}

.vh-hub-sidebar-sticky {
    position: sticky;
    top: 80px;
    background: transparent;
    padding: 0 12px;
}

/* Profile Section - Flat Card Style */
.vh-hub-profile-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--vh-surface);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
    cursor: pointer;
}

.vh-hub-profile-section:hover {
    background: #282828;
}

/* Avatar - Simple Circle */
.vh-hub-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
    flex-shrink: 0;
}

.vh-hub-user-name {
    font-weight: 500;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation - Homepage Sidebar Style */
.vh-hub-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Matches sidebar */
    margin-bottom: 20px;
}

.vh-hub-nav-item {
    display: flex;
    align-items: center;
    gap: 24px;
    /* Matches sidebar */
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--vh-text);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    font-weight: 400;
    text-align: left;
    width: 100%;
}

.vh-hub-nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
    flex-shrink: 0;
}

.vh-hub-nav-item:hover {
    background: var(--vh-surface-hover);
}

.vh-hub-nav-item.active {
    background: var(--vh-surface-hover);
    font-weight: 600;
}

.vh-hub-nav-item.active svg {
    stroke: #fff;
}

/* Section Divider - Solid thin line */
.vh-hub-nav-divider {
    height: 1px;
    background: var(--vh-border);
    margin: 12px 0;
}

/* CTA Button - Solid YouTube Primary */
.vh-hub-cta {
    padding: 8px 0;
}

.vh-hub-cta .vh-btn-primary {
    background: var(--vh-primary);
    /* YouTube Blue */
    color: #0f0f0f;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 20px;
    transition: background 0.2s ease;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vh-hub-cta .vh-btn-primary:hover {
    background: #65b8ff;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.vh-hub-main {
    flex: 1;
    min-width: 0;
}

.vh-hub-header {
    margin-bottom: 32px;
}

.vh-hub-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.vh-hub-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* Spinner Container */
.vh-spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    min-height: 300px;
}

.vh-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--vh-primary);
    border-radius: 50%;
    animation: vhSpin 0.8s linear infinite;
}

@keyframes vhSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Playlist Card / Tile
   ========================================================================== */

.vh-playlist-tile {
    background: #141414;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
}

.vh-playlist-tile:hover {
    background: #1a1a1a;
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Mosaic Thumbnail Grid */
.vh-playlist-mosaic {
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
}

.vh-playlist-mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.vh-playlist-mosaic-single {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.vh-playlist-mosaic-single img {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

.vh-playlist-tile:hover .vh-playlist-mosaic img {
    transform: scale(1.05);
}

/* Count Badge */
.vh-playlist-count-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

/* Play Button */
.vh-playlist-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 48px;
    height: 48px;
    background: var(--vh-primary);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.vh-playlist-tile:hover .vh-playlist-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Info Section */
.vh-playlist-info {
    padding: 16px;
}

.vh-playlist-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--vh-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vh-playlist-meta {
    font-size: 12px;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.vh-playlist-meta svg {
    width: 12px;
    height: 12px;
}

.vh-tile-visibility-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
    opacity: 0.8;
}

.vh-tile-visibility-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    border-color: var(--vh-primary);
}

.vh-tile-visibility-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Smart Playlist Badge */
.vh-smart-playlist-tile {
    border-color: rgba(99, 102, 241, 0.2);
}

.vh-smart-playlist-tile:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

/* ==========================================================================
   Video Cards (for Liked Videos & History tabs)
   ========================================================================== */

.vh-video-card-mini {
    background: #141414;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.vh-video-card-mini:hover {
    background: #1a1a1a;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.vh-video-card-mini .vh-video-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.vh-video-card-mini .vh-video-thumb-container {
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background: #0a0a0a;
}

.vh-video-card-mini .vh-video-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.vh-video-card-mini:hover .vh-video-thumb-container img {
    transform: scale(1.05);
}

.vh-video-card-mini .vh-video-card-info {
    padding: 14px;
}

.vh-video-card-mini .vh-video-card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--vh-text);
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.vh-hub-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 20px;
}

.vh-hub-empty h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--vh-text);
}

.vh-hub-empty p {
    color: var(--vh-text-muted);
    font-size: 14px;
}

/* ==========================================================================
   Contribution Cards (Admin Review)
   ========================================================================== */

.vh-contribution-card {
    background: var(--vh-surface);
    border-radius: 12px;
    border: 1px solid var(--vh-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: vhFadeIn 0.3s ease;
}

.vh-tag-badge {
    background: var(--vh-surface-hover);
    border: 1px solid var(--vh-border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* ==========================================================================
   Modal Enhancements
   ========================================================================== */

.vh-icon-btn {
    background: none;
    border: none;
    color: var(--vh-text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vh-icon-btn:hover {
    background: var(--vh-surface-hover);
    color: var(--vh-text);
}

.vh-icon-btn.vh-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.vh-icon-btn svg {
    width: 16px;
    height: 16px;
}

.vh-icon-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

.vh-playlist-row:hover {
    background: var(--vh-surface);
}

.vh-select-playlist-item:hover {
    background: var(--vh-surface);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.vh-badge {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #777;
}

.vh-hub-nav-item.active .vh-badge {
    background: var(--vh-primary);
    color: #fff;
}

.vh-badge-primary {
    background: #3ea6ff;
    color: #000;
}

.vh-badge-warning {
    background: #f59e0b;
    color: #000;
}

/* ==========================================================================
   Skeletons & Animations
   ========================================================================== */

.vh-skeleton {
    background: linear-gradient(90deg, #181818 25%, #222 50%, #181818 75%);
    background-size: 200% 100%;
    animation: vhSkeleton 1.5s infinite linear;
}

.vh-skeleton-text {
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(90deg, #181818 25%, #222 50%, #181818 75%);
    background-size: 200% 100%;
    animation: vhSkeleton 1.5s infinite linear;
}

@keyframes vhSkeleton {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes vhFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 992px) {
    .vh-hub-layout {
        flex-direction: column;
    }

    .vh-hub-sidebar {
        width: 100%;
    }

    .vh-hub-sidebar-sticky {
        position: relative;
        top: 0;
        display: flex;
        flex-direction: column;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        padding: 0;
        margin-bottom: 8px;
    }

    .vh-hub-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px 0;
        margin-bottom: 16px;
        gap: 10px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .vh-hub-nav::-webkit-scrollbar {
        display: none;
    }

    /* Premium Pill-Style Navigation for Mobile */
    .vh-hub-nav-item {
        white-space: nowrap;
        width: auto;
        padding: 10px 20px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 24px;
        font-size: 13px;
        font-weight: 500;
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.7);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .vh-hub-nav-item:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .vh-hub-nav-item svg {
        width: 18px;
        height: 18px;
    }

    .vh-hub-nav-item.active {
        background: #f1f1f1;
        /* Flat white/light grey chip for active mobile */
        color: #0f0f0f;
        border-color: #f1f1f1;
        box-shadow: none;
    }

    .vh-hub-nav-item.active svg {
        stroke: #0f0f0f;
        filter: none;
    }

    .vh-hub-nav-item.active::before {
        display: none;
    }

    .vh-hub-nav-item::after {
        display: none;
    }

    .vh-hub-nav-divider {
        display: none;
    }

    .vh-hub-profile-section {
        display: none;
    }

    /* Flat Floating Action Button */
    .vh-hub-cta {
        position: fixed;
        bottom: 28px;
        right: 20px;
        z-index: 1000;
        padding: 0;
    }

    .vh-hub-cta .vh-btn,
    .vh-hub-cta .vh-btn-primary {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #3ea6ff;
        /* YouTube Blue */
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .vh-hub-cta .vh-btn:active,
    .vh-hub-cta .vh-btn-primary:active {
        transform: scale(0.95);
        background: #65b8ff;
    }

    .vh-hub-cta span {
        display: none;
    }

    .vh-hub-cta svg {
        margin-right: 0 !important;
        width: 24px !important;
        height: 24px !important;
        color: #0f0f0f;
    }

    .vh-hub-header h1 {
        font-size: 26px;
    }

    .vh-hub-content-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 576px) {
    .vh-playlist-hub-page {
        padding: 20px 0;
    }

    .vh-hub-content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .vh-playlist-info {
        padding: 12px;
    }

    .vh-playlist-name {
        font-size: 14px;
    }

    .vh-playlist-meta {
        font-size: 11px;
    }
}

:root {
    --vh-hub-sidebar-width: 260px;
    --vh-hub-gap: 32px;
}

.vh-aspect-video {
    aspect-ratio: 16/9;
}