@extends('layouts.app') @section('title', $playlist->name) @section('content')
{{-- Back link --}} @auth @if(auth()->id() === $playlist->user_id) Back to My Playlists @endif @endauth {{-- Playlist Header --}}

{{ $playlist->name }}

@if($playlist->is_public) Public @else Private @endif
@if($playlist->description)

{{ $playlist->description }}

@endif

{{ $playlist->videos->count() }} {{ Str::plural('video', $playlist->videos->count()) }}

{{-- Play All button --}} @if($playlist->videos->count() > 0) @endif {{-- Loop toggle --}} @if($playlist->videos->count() > 1) @endif {{-- Shuffle toggle --}} @if($playlist->videos->count() > 1) @endif {{-- Share button --}} @if($playlist->is_public) @endif {{-- Owner actions --}} @auth @if(auth()->id() === $playlist->user_id)
@csrf @method('DELETE')
@endif @endauth
@if($playlist->videos->count() > 0)
{{-- Video Player --}}
{{-- Placeholder before playing --}}
@if($playlist->videos->first()) {{ $playlist->name }} @endif

Play All

{{ $playlist->videos->count() }} {{ Str::plural('video', $playlist->videos->count()) }}

{{-- Video List (Sidebar on desktop, below on mobile) --}}
{{-- List Header --}}

Playlist

{{ $playlist->videos->count() }} videos
{{-- Scrollable Video List --}}
@foreach($playlist->videos as $index => $video)
{{-- Position / Now Playing Indicator --}}
{{ $index + 1 }}
{{-- Thumbnail --}}
{{ $video->title }}
{{ $video->formatted_duration }}
{{-- Video Info --}}

{{ $video->title }}

{{-- Remove button (owner only, stops propagation) --}} @auth @if(auth()->id() === $playlist->user_id)
@csrf @method('DELETE')
@endif @endauth
@endforeach
@else {{-- Empty State --}}

No videos in this playlist

Browse videos and add them to this playlist to get started.

Browse Videos
@endif
{{-- Edit Modal --}} @auth @if(auth()->id() === $playlist->user_id) @endif @endauth @endsection @push('scripts') {{-- YouTube IFrame API --}} {{-- Drag-and-Drop Reorder Script (owner only) --}} @auth @if(auth()->id() === $playlist->user_id && $playlist->videos->count() > 1) @endif @endauth @endpush