/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

.video-card {
    cursor: pointer;
    transition: transform 0.1s ease;
}

.video-card:hover {
    transform: translateY(-2px);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #181818;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.02);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.video-info {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
    margin-top: 2px;
}

.video-details h3 {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 6px;
    color: #f1f1f1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    font-size: 14px;
    color: #aaaaaa;
    line-height: 1.3;
}

.channel-name {
    margin-bottom: 2px;
    color: #aaaaaa;
}

.channel-name:hover {
    color: #f1f1f1;
}

/* Video Page Styles */
.video-main {
    flex: 2;
    min-width: 0;
}

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    margin-bottom: 16px;
}

.video-title-main {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #f1f1f1;
    line-height: 1.3;
}

.video-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #303030;
    flex-wrap: wrap;
    gap: 16px;
}

.video-views {
    color: #aaaaaa;
    font-size: 14px;
    font-weight: 400;
}

.video-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    background: none;
    border: none;
    color: #f1f1f1;
    padding: 8px 16px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.1s ease;
}

.action-btn:hover {
    background-color: #272727;
}

.action-icon {
    width: 24px;
    height: 24px;
    fill: #f1f1f1;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #303030;
}

.channel-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.channel-details {
    flex: 1;
}

.channel-details h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
    color: #f1f1f1;
}

.subscriber-count {
    font-size: 12px;
    color: #aaaaaa;
    font-weight: 400;
}

.subscribe-btn {
    background-color: #cc0000;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.subscribe-btn:hover {
    background-color: #aa0000;
}

.video-description {
    background-color: #181818;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.video-description p {
    font-size: 14px;
    line-height: 1.4;
    color: #f1f1f1;
}

/* Comments Section */
.comments-section {
    margin-top: 24px;
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.comments-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #f1f1f1;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #f1f1f1;
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.sort-btn:hover {
    background-color: #272727;
}

.sort-icon {
    width: 16px;
    height: 16px;
    fill: #f1f1f1;
}

.add-comment {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    align-items: flex-start;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.comment-input {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 1px solid #303030;
    padding: 8px 0;
    font-size: 14px;
    color: #f1f1f1;
    outline: none;
    transition: border-color 0.1s ease;
}

.comment-input::placeholder {
    color: #888;
}

.comment-input:focus {
    border-color: #f1f1f1;
}

.comment {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 13px;
    font-weight: 500;
    color: #f1f1f1;
}

.comment-time {
    font-size: 12px;
    color: #aaaaaa;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: #f1f1f1;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #aaaaaa;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.1s ease;
}

.comment-action:hover {
    background-color: #272727;
}

.comment-action-icon {
    width: 16px;
    height: 16px;
    fill: #aaaaaa;
}

/* Video Sidebar */
.video-sidebar {
    flex: 1;
    min-width: 300px;
}

.sidebar-videos {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-video {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.sidebar-video:hover {
    background-color: #181818;
}

.sidebar-video-thumbnail {
    position: relative;
    width: 168px;
    aspect-ratio: 16/9;
    background-color: #181818;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-video-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

.sidebar-video-info {
    flex: 1;
    min-width: 0;
}

.sidebar-video-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 4px;
    color: #f1f1f1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-video-channel {
    font-size: 12px;
    color: #aaaaaa;
    margin-bottom: 2px;
}

.sidebar-video-stats {
    font-size: 12px;
    color: #aaaaaa;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .video-sidebar {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .video-page.active {
        flex-direction: column;
        gap: 16px;
    }
    
    .video-sidebar {
        min-width: auto;
    }
    
    .sidebar-videos {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .sidebar-video {
        flex-direction: column;
    }
    
    .sidebar-video-thumbnail {
        width: 100%;
    }
    
    .video-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .channel-info {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .video-title-main {
        font-size: 18px;
    }
    
    .video-actions {
        gap: 4px;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .sidebar-videos {
        grid-template-columns: 1fr;
    }
}