/* === MOST VIEWED PAGE STYLES === */

/* Page Layout - same as featuredChannels */
.pp-channel-page-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    padding: 0 8.33vw;
    min-height: calc(100vh - 150px);
    background: var(--bg);
}

.pp-channel-main-content {
    min-width: 0;
}

/* Most Viewed Section */
.pp-mostviewed-section {
    background: #F9F9F9;
    padding: 30px 0 50px 0;
    min-height: calc(100vh - 70px);
}

.theme-dark .pp-mostviewed-section {
    background: linear-gradient(180deg, #010F29 0%, #001337 171.51%);
}

.pp-mostviewed-container {
    padding: 0 40px;
}

/* Header with Title and Filter */
.pp-mostviewed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.pp-mostviewed-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    text-transform: uppercase;
}

/* Filter Select */
.pp-mostviewed-filter {
    position: relative;
    max-width: 450px;
}

.pp-filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 8px 40px 8px 16px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    background-color: transparent;
    border: 1px solid var(--search-border);
    border-radius: 50px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23808794' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s ease;
}

.pp-filter-select:hover {
    border-color: var(--accent);
}

.pp-filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.theme-dark .pp-filter-select option {
    background-color: #0f1b36;
    color: #ffffff;
}

/* Videos Grid */
.pp-mostviewed-videos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Video Item */
.pp-mostviewed-video-item {
    position: relative;
    width: 100%;
}

.pp-mostviewed-video-card {
    display: block;
    text-decoration: none;
}

/* Video Thumbnail */
.pp-mostviewed-video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 236 / 160;
    border-radius: 5px;
    overflow: hidden;
    background: var(--surface);
}

.pp-mostviewed-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pp-mostviewed-video-card:hover .pp-mostviewed-video-thumb img {
    transform: scale(1.05);
}

/* Hover Overlay */
.pp-mostviewed-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(29, 29, 29, 0.00) 0%, rgba(1, 15, 41, 0.72) 80.79%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-mostviewed-video-card:hover .pp-mostviewed-video-overlay {
    opacity: 1;
}

.pp-mostviewed-video-card:hover .pp-mostviewed-video-thumb {
    border: 2px solid var(--video-card-hover-border);
    border-radius: 0;
}

/* Play Button */
.pp-mostviewed-video-play {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-mostviewed-video-play img {
    width: 40px;
    height: 40px;
}

/* Duration Badge */
.pp-mostviewed-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #FFFFFF;
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Video Info */
.pp-mostviewed-video-info {
    padding: 10px 0;
}

.pp-mostviewed-video-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.pp-mostviewed-video-channel {
    display: block;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-mostviewed-video-channel:hover {
    text-decoration: underline;
}

.pp-mostviewed-video-meta {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: var(--muted);
}

/* No Videos Message */
.pp-no-videos {
    text-align: center;
    padding: 60px 20px;
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* === RESPONSIVE BREAKPOINTS === */

/* 2560+ Ultra Wide - 7 videos */
@media (min-width: 2560px) {
    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* 2200-2559 - 6 videos */
@media (min-width: 2200px) and (max-width: 2559px) {
    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 1920-2199 - 5 videos */
@media (min-width: 1920px) and (max-width: 2199px) {
    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 1440-1919 - 4 videos */
@media (min-width: 1440px) and (max-width: 1919px) {
    .pp-channel-page-layout {
        padding: 0 5.71vw;
    }

    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 1200-1439 - 4 videos */
@media (min-width: 1200px) and (max-width: 1439px) {
    .pp-channel-page-layout {
        padding: 0 3.33vw;
    }

    .pp-mostviewed-container {
        padding: 0 30px;
    }

    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 1024-1199 - 3 videos */
@media (min-width: 1024px) and (max-width: 1199px) {
    .pp-channel-page-layout {
        grid-template-columns: 220px 1fr;
        padding: 0 3.33vw;
    }

    .pp-mostviewed-container {
        padding: 0 20px;
    }

    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 768-1023 Tablet - 3 videos */
@media (min-width: 768px) and (max-width: 1023px) {
    .pp-channel-page-layout {
        grid-template-columns: 200px 1fr;
        padding: 0 20px;
    }

    .pp-mostviewed-container {
        padding: 0 16px;
    }

    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .pp-mostviewed-title {
        font-size: 20px;
    }
}

/* 576-767 - Sidebar hidden, 2 videos */
@media (min-width: 576px) and (max-width: 767px) {
    .pp-channel-page-layout {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .pp-mostviewed-section {
        padding: 20px 0 30px 0;
    }

    .pp-mostviewed-container {
        padding: 0 16px;
    }

    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .pp-mostviewed-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .pp-mostviewed-title {
        font-size: 18px;
    }

    .pp-mostviewed-filter {
        max-width: none;
    }

    .pp-filter-select {
        width: auto;
        min-width: 120px;
        padding: 8px 32px 8px 12px;
        font-size: 12px;
        background-position: right 10px center;
    }
}

/* 426-575 Mobile - 2 videos */
@media (min-width: 426px) and (max-width: 575px) {
    .pp-channel-page-layout {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .pp-mostviewed-section {
        padding: 16px 0 24px 0;
    }

    .pp-mostviewed-container {
        padding: 0 16px;
    }

    .pp-mostviewed-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .pp-mostviewed-title {
        font-size: 18px;
    }

    .pp-mostviewed-filter {
        max-width: none;
    }

    .pp-filter-select {
        width: auto;
        min-width: 120px;
        padding: 8px 32px 8px 12px;
        font-size: 12px;
        background-position: right 10px center;
    }

    .pp-mostviewed-videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .pp-mostviewed-video-title {
        font-size: 13px;
    }

    .pp-mostviewed-video-channel,
    .pp-mostviewed-video-meta {
        font-size: 14px;
    }
}

/* 375-425 Mobile Small - 1 video */
@media (max-width: 425px) {
    .pp-channel-page-layout {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .pp-mostviewed-section {
        padding: 16px 0 24px 0;
    }

    .pp-mostviewed-container {
        padding: 0 10px;
    }

    .pp-mostviewed-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .pp-mostviewed-title {
        font-size: 18px;
    }

    .pp-mostviewed-filter {
        max-width: none;
    }

    .pp-filter-select {
        width: auto;
        min-width: 120px;
        padding: 7px 32px 7px 12px;
        font-size: 12px;
        background-position: right 10px center;
    }

    .pp-mostviewed-videos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pp-mostviewed-video-thumb {
        width: 100%;
        height: 160px;
        aspect-ratio: unset;
    }

    .pp-mostviewed-video-title {
        font-size: 14px;
    }

    .pp-mostviewed-video-channel,
    .pp-mostviewed-video-meta {
        font-size: 14px;
    }
}

/* === DISABLE HOVER ON TOUCH DEVICES === */
@media (hover: none), (pointer: coarse) {
    .pp-mostviewed-video-card:hover .pp-mostviewed-video-thumb img {
        transform: none;
    }

    .pp-mostviewed-video-card:hover .pp-mostviewed-video-overlay {
        opacity: 0;
    }

    .pp-mostviewed-video-card:hover .pp-mostviewed-video-thumb {
        border: none;
        border-radius: 5px;
    }
}