/**
 * Channel Template Styles (YouTube-style)
 * 
 * Responsive CSS for channel mode author pages.
 * Uses existing CSS variables for consistency.
 *
 * @package Videohub360_Theme
 * @since 1.0.0
 */

/* ===================================================================
   Channel Page Container
   =================================================================== */

.vh360-channel-page {
    background: var(--surface-1);
    min-height: 100vh;
}

/* Scoped container for channel pages only */
.vh360-channel-page .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* ===================================================================
   Channel Header (Banner + Avatar + Stats + Actions)
   =================================================================== */

.vh360-channel-header {
    background: var(--surface-1);
    margin-bottom: 0;
    position: relative;
}

/* Banner */
.vh360-channel-banner {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color, #ef4444) 0%, var(--secondary-color, #3b82f6) 100%);
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
}

.vh360-channel-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vh360-channel-banner-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color, #ef4444) 0%, var(--secondary-color, #3b82f6) 100%);
}

/* Channel Info Section */
.vh360-channel-info {
    position: relative;
    max-width: var(--max-width, 1280px);
    margin: -80px auto 0;
    padding: 0 var(--spacing, 1rem);
}

.vh360-channel-info-inner {
    background: var(--surface-1);
    padding: 1.5rem;
    border-radius: var(--border-radius, 0.5rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Avatar */
.vh360-channel-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--bg-color, #ffffff);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    margin-right: 2rem;
    vertical-align: middle;
}

.vh360-channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Channel Details */
.vh360-channel-details {
    flex: 1;
    min-width: 0;
}

.vh360-channel-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-1);
    margin: 0 0 0.5rem 0;
}

/* Channel Stats */
.vh360-channel-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9375rem;
    color: var(--text-light, #6b7280);
}

.vh360-channel-stat strong {
    font-weight: 600;
    color: var(--text-1);
}

.vh360-channel-stat-separator {
    color: var(--border-color, #d1d5db);
}

/* Channel Actions */
.vh360-channel-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.vh360-channel-customize-btn,
.vh360-channel-subscribe-btn,
.vh360-follow-btn,
.vh360-unfollow-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.vh360-channel-customize-btn {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-1);
}

.vh360-channel-customize-btn:hover {
    background: var(--border-1);
}

.vh360-channel-subscribe-btn,
.vh360-follow-btn {
    background: var(--primary-color, #ef4444);
    color: #ffffff;
}

.vh360-channel-subscribe-btn:hover,
.vh360-follow-btn:hover {
    background: var(--primary-hover, #dc2626);
}

.vh360-unfollow-btn {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-1);
}

.vh360-unfollow-btn:hover {
    background: var(--border-1);
}

/* ===================================================================
   Channel Navigation (Tabs)
   =================================================================== */

.vh360-channel-navigation {
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-1);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-top: 2rem;
}

.vh360-channel-nav-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.vh360-channel-nav-item {
    margin: 0;
}

.vh360-channel-nav-link {
    display: block;
    padding: 1rem 0;
    color: var(--text-light, #6b7280);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.vh360-channel-nav-link:hover {
    color: var(--text-1);
}

.vh360-channel-nav-link.active {
    color: var(--primary-color, #ef4444);
    border-bottom-color: var(--primary-color, #ef4444);
}

/* ===================================================================
   Channel Content Area
   =================================================================== */

.vh360-channel-content {
    padding: 2rem 0 3rem;
}

.vh360-channel-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-1);
    margin: 0 0 1.5rem 0;
}

.vh360-channel-subsection-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-1);
    margin: 0 0 1rem 0;
}

/* ===================================================================
   Videos Grid Section
   =================================================================== */

.vh360-channel-videos-section {
    /* Videos section styles */
}

.vh360-channel-videos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Sorting Controls */
.vh360-channel-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vh360-channel-sort-label {
    font-size: 0.875rem;
    color: var(--text-light, #6b7280);
    font-weight: 500;
}

.vh360-channel-sort-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.375rem;
    background: var(--surface-1);
    color: var(--text-1);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.vh360-channel-sort-select:focus {
    outline: none;
    border-color: var(--primary-color, #ef4444);
}

/* Videos Grid */
.vh360-videos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vh360-video-card {
    background: var(--surface-1);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vh360-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.vh360-video-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.vh360-video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: var(--bg-secondary, #f3f4f6);
    overflow: hidden;
}

.vh360-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vh360-video-thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-light, #9ca3af);
}

.vh360-video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.vh360-video-info {
    padding: 0.75rem;
}

.vh360-video-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-1);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vh360-video-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--text-light, #6b7280);
}

.vh360-video-meta-separator {
    color: var(--border-color, #d1d5db);
}

/* ===================================================================
   Playlists Grid Section
   =================================================================== */

.vh360-playlists-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vh360-playlist-card {
    background: var(--surface-1);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vh360-playlist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.vh360-playlist-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.vh360-playlist-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: var(--bg-secondary, #f3f4f6);
    overflow: hidden;
}

.vh360-playlist-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vh360-playlist-thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-light, #9ca3af);
}

.vh360-playlist-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ffffff;
}

.vh360-playlist-overlay svg {
    width: 32px;
    height: 32px;
}

.vh360-playlist-count {
    font-size: 1rem;
    font-weight: 600;
}

.vh360-playlist-info {
    padding: 0.75rem;
}

.vh360-playlist-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-1);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.vh360-playlist-description {
    font-size: 0.8125rem;
    color: var(--text-light, #6b7280);
    margin: 0;
    line-height: 1.5;
}

/* ===================================================================
   Users Grid Section (Followers/Following)
   =================================================================== */

.vh360-users-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vh360-user-card {
    background: var(--surface-1);
    border: 1px solid var(--border-1);
    border-radius: var(--border-radius, 8px);
    overflow: hidden;
    transition: all 0.3s ease;
}

.vh360-user-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: var(--primary-color, #3b82f6);
}

.vh360-user-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.vh360-user-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

.vh360-user-card .vh360-user-avatar {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.vh360-user-card .vh360-user-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--border-1);
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.vh360-user-card:hover .vh360-user-avatar img {
    border-color: var(--primary-color, #3b82f6);
}

.vh360-user-card .vh360-user-info {
    flex: none;
    display: block;
    width: 100%;
    text-align: center;
}

.vh360-user-card .vh360-user-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s ease;
    text-align: center;
}

.vh360-user-card:hover .vh360-user-name {
    color: var(--primary-color, #3b82f6);
}

.vh360-user-card .vh360-user-username {
    font-size: 0.875rem;
    color: var(--text-light, #6b7280);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.vh360-user-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-color, #4b5563);
}

.vh360-user-stat {
    display: block;
    line-height: 1.4;
}

.vh360-user-stat strong {
    font-weight: 700;
    color: var(--text-1);
}

.vh360-user-actions {
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--border-1);
}

.vh360-user-follow-btn,
.vh360-user-follow-btn.vh360-follow-btn,
.vh360-user-follow-btn.vh360-unfollow-btn {
    width: 100%;
    justify-content: center;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--border-radius, 6px);
    transition: all 0.3s ease;
}

/* ===================================================================
   About Section
   =================================================================== */

.vh360-channel-about-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.vh360-channel-about-main {
    /* Main about column */
}

.vh360-channel-description {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-color, #374151);
    margin-bottom: 2rem;
}

.vh360-channel-description-empty {
    color: var(--text-light, #6b7280);
    font-style: italic;
}

.vh360-channel-links {
    margin-top: 2rem;
}

.vh360-channel-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vh360-channel-links-list li {
    margin-bottom: 0.75rem;
}

.vh360-channel-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color, #ef4444);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.vh360-channel-link:hover {
    color: var(--primary-hover, #dc2626);
}

/* Stats Sidebar */
.vh360-channel-about-sidebar {
    /* Stats sidebar column */
}

.vh360-channel-stats-box {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-1);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.vh360-channel-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-1);
}

.vh360-channel-stat-item:last-child {
    border-bottom: none;
}

.vh360-channel-stat-label {
    font-size: 0.875rem;
    color: var(--text-light, #6b7280);
}

.vh360-channel-stat-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-1);
}

/* ===================================================================
   Empty States
   =================================================================== */

.vh360-channel-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light, #6b7280);
}

.vh360-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.vh360-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-1);
    margin: 0 0 0.5rem 0;
}

.vh360-empty-description {
    font-size: 0.9375rem;
    color: var(--text-light, #6b7280);
    margin: 0;
}

/* ===================================================================
   Pagination
   =================================================================== */

.vh360-channel-pagination {
    margin-top: 2rem;
}

.vh360-channel-pagination .page-numbers {
    display: inline-flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.vh360-channel-pagination .page-numbers li {
    margin: 0;
}

.vh360-channel-pagination a,
.vh360-channel-pagination .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.375rem;
    background: var(--surface-1);
    color: var(--text-1);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.vh360-channel-pagination a:hover {
    background: var(--bg-secondary, #f3f4f6);
    border-color: var(--primary-color, #ef4444);
}

.vh360-channel-pagination .current {
    background: var(--primary-color, #ef4444);
    color: #ffffff;
    border-color: var(--primary-color, #ef4444);
}

/* ===================================================================
   Responsive Design
   =================================================================== */

/* Tablet (1200px and below) */
@media (max-width: 1200px) {
    .vh360-videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet (768px and below) */
@media (max-width: 768px) {
    /* Banner */
    .vh360-channel-banner {
        height: 120px;
    }

    /* Channel Info */
    .vh360-channel-info {
        margin-top: -50px;
    }

    /* Avatar */
    .vh360-channel-avatar {
        width: 100px;
        height: 100px;
    }

    /* Channel Info */
    .vh360-channel-info-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .vh360-channel-details {
        width: 100%;
    }

    .vh360-channel-name {
        font-size: 1.5rem;
    }

    .vh360-channel-actions {
        width: 100%;
        margin-left: 0;
    }

    .vh360-channel-customize-btn,
    .vh360-channel-subscribe-btn,
    .vh360-follow-btn,
    .vh360-unfollow-btn {
        width: 100%;
        justify-content: center;
    }

    /* Navigation */
    .vh360-channel-nav-tabs {
        gap: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vh360-channel-nav-link {
        padding: 0.875rem 0;
        font-size: 0.875rem;
    }

    /* Videos Grid */
    .vh360-videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Playlists Grid */
    .vh360-playlists-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Users Grid */
    .vh360-users-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    /* About Layout */
    .vh360-channel-about-layout {
        grid-template-columns: 1fr;
    }

    /* Content Padding */
    .vh360-channel-content {
        padding: 1.5rem 0 2rem;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    /* Banner */
    .vh360-channel-banner {
        height: 100px;
    }

    /* Channel Info */
    .vh360-channel-info {
        margin-top: -40px;
    }

    /* Avatar */
    .vh360-channel-avatar {
        width: 80px;
        height: 80px;
        border-width: 3px;
    }

    /* Channel Info Inner */
    .vh360-channel-info-inner {
        padding: 1rem;
    }

    /* Channel Name */
    .vh360-channel-name {
        font-size: 1.25rem;
    }

    /* Stats */
    .vh360-channel-stats {
        font-size: 0.8125rem;
    }

    /* Videos Grid */
    .vh360-videos-grid {
        grid-template-columns: 1fr;
    }

    /* Playlists Grid */
    .vh360-playlists-grid {
        grid-template-columns: 1fr;
    }

    /* Users Grid */
    .vh360-users-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Section Titles */
    .vh360-channel-section-title {
        font-size: 1.25rem;
    }

    /* Videos Header */
    .vh360-channel-videos-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .vh360-channel-sort {
        width: 100%;
    }

    .vh360-channel-sort-select {
        flex: 1;
    }
}

/* Dark Mode Support (if theme has dark mode) */
@media (prefers-color-scheme: dark) {
    /* Adjust colors for dark mode if needed */
    /* This is optional and depends on theme's dark mode implementation */
}
