/* tools/photo-to-video.css
   The photo video maker reuses the watermark maker's layout (watermark.css:
   settings open beside the results). This sheet adds the finished-video card,
   the preview player, the photo strip and the page-copy figures. The title
   fonts are the Designer's self-hosted faces. */

@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('/fonts/cards/PlayfairDisplay-normal-latin.woff2') format('woff2'); }
@font-face { font-family: 'Great Vibes'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/cards/GreatVibes-normal-latin.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/cards/Montserrat-normal-latin.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 300 700; font-display: swap; src: url('/fonts/cards/CormorantGaramond-italic-latin.woff2') format('woff2'); }

.pv-sample-btn {
    margin-top: 6px;
    font-size: 13px;
    padding: 8px 4px;
    min-height: 36px;
}

.pv-sample-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

.pv-unsupported {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.pv-unsupported[hidden] {
    display: none;
}

/* ── Settings ─────────────────────────────────────────────── */
.pv-optional {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
    margin-left: 4px;
}

.pv-pair {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pv-pair select {
    flex: 1 1 0;
    min-width: 0;
}

.tool-settings .pv-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
}

.pv-music-btn {
    width: 100%;
}

/* "Add your own music" had no button styles of its own on this page, so its
   label came out in the browser's near-black on the dark card. */
.pv-music-btn.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 9px 12px;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.pv-music-btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.pv-music-btn.btn-secondary:disabled {
    opacity: 0.6;
    cursor: default;
}

.tool-settings .pv-beat-row {
    display: flex;
    justify-content: flex-start;
    width: fit-content;
    margin-top: 10px;
    gap: 10px;
}

.tool-settings .pv-beat-row[hidden],
.pv-library[hidden] {
    display: none;
}

/* Built-in tracks (MUSIC_LIBRARY), above "Add your own music". */
.pv-library-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.pv-track {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.pv-track:hover {
    background: rgba(255, 255, 255, 0.12);
}

.pv-track-meta {
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.pv-library-credit {
    margin: 0 0 8px;
}

.pv-library-credit a {
    color: inherit;
    text-decoration: underline;
}

.pv-music-credit {
    margin: 6px 0 0;
}

.pv-music-credit[hidden] {
    display: none;
}

.pv-music-btn[hidden],
.pv-music-file[hidden] {
    display: none;
}

.pv-music-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 0;
}

.pv-music-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.pv-x {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pv-x:hover {
    background: rgba(255, 255, 255, 0.24);
}

.tool-settings .pv-sub-input {
    margin-top: 8px;
}

.tool-settings #setting-font {
    margin-top: 8px;
}

/* ── Results ─────────────────────────────────────────────── */
#results-view > .error-container:empty {
    display: none;
}

#results-view > .error-container {
    margin-bottom: 12px;
    text-align: center;
}

.pv-page .pv-controls {
    margin-bottom: 16px;
}

.pv-page .wm-actions {
    flex-wrap: wrap;
}

.pv-page #make-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* The finished video. */
.pv-made {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 18px;
    margin-bottom: 16px;
    border-radius: var(--tile-radius, 16px);
    background: var(--tile-fill, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--tile-border, rgba(255, 255, 255, 0.1));
}

.pv-made[hidden] {
    display: none;
}

.pv-made-video {
    flex: 0 0 auto;
    width: calc(min(52vh, 460px) * var(--ar, 0.5625));
    max-width: 55%;
}

.pv-made-side {
    flex: 1 1 220px;
    min-width: 0;
}

.pv-made[data-shape="wide"] {
    flex-direction: column;
    align-items: stretch;
}

.pv-made[data-shape="wide"] .pv-made-video {
    width: 100%;
    max-width: none;
}

.pv-made video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #000;
}

.pv-made-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 600;
}

.pv-made-detail {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
}

.pv-made-note {
    margin: 0 0 14px;
    font-size: 0.88rem;
    color: rgba(255, 220, 160, 0.95);
}

.pv-made-note[hidden],
.pv-made-stale[hidden] {
    display: none;
}

.pv-made-stale {
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

/* The preview player. */
.pv-stage {
    margin-bottom: 20px;
}

.pv-screen {
    position: relative;
    width: min(100%, calc(min(60vh, 560px) * var(--ar, 0.5625)));
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.pv-screen canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.pv-bigplay {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.2s;
}

.pv-bigplay svg {
    margin-left: 3px;
}

.pv-screen.is-playing .pv-bigplay {
    opacity: 0;
    pointer-events: none;
}

.pv-transport {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 560px);
    margin: 12px auto 0;
}

.pv-play {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.pv-play .i-pause,
.pv-play.is-playing .i-play {
    display: none;
}

.pv-play.is-playing .i-pause {
    display: block;
}

.pv-transport input[type="range"] {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: #fff;
}

.pv-time {
    flex: 0 0 auto;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
}

/* The photo strip. */
.pv-strip-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 4px 0 10px;
}

.pv-strip-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.pv-strip-head p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.pv-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
}

.pv-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1d;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    outline: none;
    transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}

.pv-tile:focus-visible {
    box-shadow: 0 0 0 2px #fff;
}

.pv-tile canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pv-tile .pv-num {
    position: absolute;
    left: 6px;
    top: 6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
    pointer-events: none;
}

.pv-tile .pv-remove {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 26px;
    height: 26px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.6);
}

.pv-strip.is-sorting .pv-tile:not(.is-dragging) {
    opacity: 0.75;
}

.pv-tile.is-dragging {
    cursor: grabbing;
    transform: scale(1.06);
    box-shadow: 0 0 0 2px #fff, 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.pv-read-status {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.pv-read-status[hidden] {
    display: none;
}

@media (max-width: 760px) {
    .pv-made {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }
    .pv-made-video {
        margin: 0 auto;
        max-width: 100%;
        width: min(100%, calc(56vh * var(--ar, 0.5625)));
    }
    .pv-made-side {
        flex: 0 0 auto;
    }
    .pv-screen {
        width: min(100%, calc(58vh * var(--ar, 0.5625)));
    }
    .pv-strip {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    }
}

/* ── Page copy ─────────────────────────────────────────────── */
.pv-figure {
    margin: 28px 0;
}

.pv-timeline {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    position: relative;
    padding-bottom: 14px;
}

.pv-timeline::after {
    /* The playhead line under the strip. */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #fff 0 38%, rgba(255, 255, 255, 0.2) 38% 100%);
}

.pv-timeline img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
}

.pv-figure figcaption,
.pv-caption {
    margin-top: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.pv-size-row {
    display: flex;
    gap: 28px;
    align-items: center;
    margin: 12px 0 16px;
}

.pv-phone {
    flex: 0 0 auto;
    margin: 0;
    width: 170px;
    padding: 8px;
    border-radius: 26px;
    background: #0d0d0f;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pv-phone-screen {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pv-phone-bg {
    position: absolute;
    inset: -10%;
    width: 120%;
    height: 120%;
    object-fit: cover;
    filter: blur(14px) brightness(0.8);
}

.pv-phone-fg {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    width: 100%;
    height: auto;
    transform: translateY(-50%);
}

.pv-phone-title,
.pv-phone-sub {
    position: relative;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.pv-phone-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: 19px;
}

.pv-phone-sub {
    margin-top: 4px;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 600;
    font-size: 8px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.pv-table-wrap {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.pv-size-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.95rem;
    text-align: left;
}

.pv-size-table th,
.pv-size-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: top;
}

.pv-size-table th {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
}

.pv-size-table td:nth-child(3) {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pv-ideas {
    margin: 8px 0 24px;
    padding-left: 20px;
    line-height: 1.6;
}

.pv-ideas li {
    margin-bottom: 6px;
}

@media (max-width: 640px) {
    .pv-size-row {
        flex-direction: column;
        align-items: stretch;
    }
    .pv-phone {
        align-self: center;
        width: 150px;
    }
    .pv-timeline {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .pv-size-table {
        font-size: 0.85rem;
    }
    .pv-size-table th,
    .pv-size-table td {
        padding: 8px 6px;
    }
    .pv-size-table td:nth-child(3) {
        white-space: normal;
    }
}
