/* Phone preview, thumbnail picker and live status steps. Filament has no theme build here, so this is plain CSS. */

/* Stays in view beside the form, and scrolls on its own if the window is too short for all of it. */
@media (min-width: 1280px) {
    .pt-sticky { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow-y: auto; }
}

.pt-preview { display: flex; flex-direction: column; align-items: center; gap: 0.625rem; }

.pt-tabs { display: flex; gap: 0.25rem; padding: 0.2rem; border-radius: 0.5rem; background: rgb(127 127 127 / 0.14); }
.pt-tab { padding: 0.375rem 0.875rem; border-radius: 0.375rem; font-size: 0.875rem; font-weight: 500; opacity: 0.7; }
.pt-tab-on { background: rgb(var(--primary-600, 79 70 229)); background: var(--primary-600, #4f46e5); color: #fff; opacity: 1; }

/* The phone. Text inside is sized from the phone's width, so it scales up in full screen. */
.pt-phone { width: clamp(240px, calc((100vh - 13rem) * 9 / 16), 360px); max-width: 100%; padding: 8px; border-radius: 36px; background: #111; box-shadow: 0 6px 22px rgb(0 0 0 / 0.28); }
.pt-screen { position: relative; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 28px; background: #000; color: #fff; container-type: inline-size; }
.pt-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

.pt-phone:fullscreen, .pt-phone.pt-is-full { width: 100%; max-width: none; height: 100%; padding: 0; display: flex; justify-content: center; border-radius: 0; background: #000; }
.pt-phone:fullscreen .pt-screen, .pt-phone.pt-is-full .pt-screen { height: 100%; aspect-ratio: 9 / 16; max-width: 100%; border-radius: 0; }
.pt-phone.pt-is-full:not(:fullscreen) { position: fixed; inset: 0; z-index: 60; }

.pt-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12%; text-align: center; font-size: 5.5cqw; opacity: 0.65; }

.pt-big-play { position: absolute; top: 50%; left: 50%; width: 18cqw; height: 18cqw; display: flex; align-items: center; justify-content: center; transform: translate(-50%, -50%); border-radius: 50%; background: rgb(0 0 0 / 0.5); }
.pt-big-play .pt-ic { width: 60%; height: 60%; }

.pt-ui { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgb(0 0 0 / 0.6), transparent 40%); }
.pt-rail { position: absolute; right: 3cqw; bottom: 10cqw; display: flex; flex-direction: column; align-items: center; gap: 4.5cqw; }
.pt-rail-item { display: flex; flex-direction: column; align-items: center; gap: 0.5cqw; }
.pt-rail-item small { font-size: 3.2cqw; }
.pt-ic { width: 8.5cqw; height: 8.5cqw; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.5)); }
.pt-ic-sm { width: 4.5cqw; height: 4.5cqw; flex: none; }

.pt-meta { position: absolute; left: 4cqw; right: 17cqw; bottom: 5cqw; display: flex; flex-direction: column; gap: 1.5cqw; font-size: 4.2cqw; line-height: 1.3; }
.pt-who { display: flex; align-items: center; gap: 2cqw; font-weight: 600; min-width: 0; }
.pt-who > span:first-of-type, .pt-who > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-avatar { width: 7.5cqw; height: 7.5cqw; flex: none; border-radius: 50%; object-fit: cover; }
.pt-avatar-lg { width: 10cqw; height: 10cqw; }
.pt-pill { flex: none; padding: 0.5cqw 2cqw; border: 1px solid rgb(255 255 255 / 0.7); border-radius: 1.5cqw; font-size: 3.4cqw; font-weight: 500; }
.pt-pill-solid { border-color: #fff; background: #fff; color: #000; border-radius: 4cqw; }
.pt-caption { display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; white-space: pre-line; }
.pt-audio { display: flex; align-items: center; gap: 1.5cqw; font-size: 3.6cqw; opacity: 0.9; }

/* Regular YouTube videos sit in a 16:9 player at the top with the details underneath. */
.pt-screen-yt-page { background: #0f0f0f; }
.pt-screen-yt-page .pt-video { inset: 9% 0 auto; height: auto; aspect-ratio: 16 / 9; }
.pt-yt-page { position: absolute; top: calc(9% + 56.25cqw + 2cqw); left: 4cqw; right: 4cqw; display: flex; flex-direction: column; gap: 3cqw; font-size: 4.2cqw; pointer-events: none; }
.pt-yt-title { margin: 0; font-size: 5cqw; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }

/* The chosen crop, shown straight away by cutting the original. The finished file already has this shape. */
.pt-ratio-9x16 .pt-video { object-fit: cover; }
.pt-ratio-4x5 .pt-video, .pt-ratio-1x1 .pt-video { inset: 50% 0 auto; height: auto; object-fit: cover; transform: translateY(-50%); }
.pt-ratio-4x5 .pt-video { aspect-ratio: 4 / 5; }
.pt-ratio-1x1 .pt-video { aspect-ratio: 1 / 1; }
.pt-screen-yt-page[class*="pt-ratio-"] .pt-video { inset: 9% auto auto 50%; width: auto; height: 56.25cqw; object-fit: cover; transform: translateX(-50%); }
.pt-screen-yt-page.pt-ratio-9x16 .pt-video { aspect-ratio: 9 / 16; }

/* Instagram's cropped views */
.pt-crop-feed .pt-video, .pt-crop-grid .pt-video { inset: 50% 0 auto; height: auto; object-fit: cover; transform: translateY(-50%); }
.pt-crop-feed .pt-video { aspect-ratio: 4 / 5; }
.pt-crop-grid .pt-video { aspect-ratio: 3 / 4; }

.pt-controls { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.pt-controls button { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgb(0 0 0 / 0.55); }
.pt-controls span { display: flex; }
.pt-controls .pt-ic-sm { width: 22px; height: 22px; }
.pt-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 1cqw; min-height: 2px; background: rgb(255 255 255 / 0.25); pointer-events: none; }
.pt-progress span { display: block; height: 100%; background: #fff; }

.pt-frames { display: flex; gap: 0.375rem; font-size: 0.8125rem; }
.pt-frames button { padding: 0.375rem 0.75rem; border-radius: 0.375rem; background: rgb(127 127 127 / 0.14); opacity: 0.75; }
.pt-frames .pt-frame-on { background: rgb(127 127 127 / 0.35); opacity: 1; font-weight: 600; }

.pt-note { margin: 0; width: 100%; font-size: 0.8125rem; line-height: 1.4; opacity: 0.72; }
.pt-note-warn { color: #d97706; opacity: 1; }

/* Crop progress and problems */
.pt-crop-status { width: 100%; display: flex; flex-direction: column; gap: 0.375rem; }
.pt-crop-item { display: flex; flex-direction: column; gap: 0.25rem; }

/* Thumbnail picker */
.pt-thumb { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.625rem; border-top: 1px solid rgb(127 127 127 / 0.22); font-size: 0.875rem; }
.pt-thumb > div:last-child { display: flex; flex-direction: column; gap: 0.5rem; }
.pt-thumb-head, .pt-thumb-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pt-link { font-size: 0.8125rem; text-decoration: underline; opacity: 0.8; }
.pt-button { padding: 0.5rem 0.875rem; border-radius: 0.375rem; background: var(--primary-600, #4f46e5); color: #fff; font-size: 0.875rem; font-weight: 500; }
.pt-strip { display: flex; gap: 3px; overflow-x: auto; }
.pt-strip-frame { flex: none; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; }
.pt-strip-frame img { display: block; height: 80px; width: auto; }
.pt-strip-on { border-color: var(--primary-500, #6366f1); }
.pt-slider { width: 100%; height: 1.5rem; accent-color: var(--primary-500, #6366f1); }

/* Live status steps on the post page */
.pt-status { display: flex; flex-direction: column; gap: 0.375rem; min-width: 20rem; padding: 0.125rem 0; white-space: normal; }
.pt-steps { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.pt-step { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 0.125rem; min-width: 4.25rem; font-size: 0.6875rem; line-height: 1.2; text-align: center; opacity: 0.5; }
.pt-step::before { content: ""; position: absolute; top: 0.3rem; left: -50%; width: 100%; height: 2px; background: rgb(127 127 127 / 0.4); }
.pt-step:first-child::before { display: none; }
.pt-step-dot { position: relative; z-index: 1; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: rgb(127 127 127 / 0.55); }
.pt-step-label { font-weight: 500; }
.pt-step-time { opacity: 0.75; font-variant-numeric: tabular-nums; }
.pt-step-done, .pt-step-current, .pt-step-failed { opacity: 1; }
.pt-step-done .pt-step-dot { background: #16a34a; }
.pt-step-done::before, .pt-step-current::before, .pt-step-failed::before { background: #16a34a; }
.pt-step-current .pt-step-dot { background: #f59e0b; animation: pt-pulse 1.4s ease-in-out infinite; }
.pt-step-failed .pt-step-dot { background: #dc2626; }
.pt-bar { height: 4px; overflow: hidden; border-radius: 2px; background: rgb(127 127 127 / 0.25); }
.pt-bar span { display: block; height: 100%; background: #f59e0b; transition: width 0.4s; }
.pt-status-detail { margin: 0; font-size: 0.75rem; opacity: 0.8; }

@keyframes pt-pulse { 50% { box-shadow: 0 0 0 4px rgb(245 158 11 / 0.3); } }

@media (prefers-reduced-motion: reduce) {
    .pt-step-current .pt-step-dot { animation: none; }
}
