/**
 * Styling for App\Livewire\TranscriptEditor.
 *
 * Plain CSS rather than Tailwind utilities, for the same reason the player entry, the
 * scrubber and the upload field have their own sheets: Filament's compiled bundle does
 * not scan this application's Blade views, so a utility class used only here resolves
 * to nothing at all.
 */

.tp-transcript {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tp-transcript__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/**
 * The player stays on screen while the cue list scrolls past it — the editor is a
 * comparison between what is said and what is written, and a player that scrolls away
 * makes that comparison impossible.
 */
.tp-transcript__player {
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: hidden;
    border-radius: 0.75rem;
    background-color: #000;
}

.tp-transcript__video {
    width: 100%;
}

.tp-transcript__banner {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgb(120 53 15);
    background-color: rgb(254 252 232);
    border: 1px solid rgb(253 230 138);
    border-radius: 0.75rem;
}

.dark .tp-transcript__banner {
    color: rgb(253 230 138);
    background-color: rgb(41 37 36);
    border-color: rgb(120 53 15);
}

.tp-transcript__banner-title {
    font-weight: 600;
}

.tp-transcript__banner-body {
    margin-top: 0.25rem;
}

.tp-transcript__cues {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/**
 * A paragraph is a run of cues with no gap between them (plan.md §7). Grouping them
 * visually is the only way the split/merge buttons mean anything.
 */
.tp-transcript__paragraph {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 1px solid rgb(228 228 231);
    border-radius: 0.75rem;
    background-color: rgb(250 250 250);
}

.dark .tp-transcript__paragraph {
    border-color: rgb(63 63 70);
    background-color: rgb(24 24 27);
}

.tp-transcript__cue {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.tp-transcript__cue--active {
    background-color: rgb(219 234 254);
}

.dark .tp-transcript__cue--active {
    background-color: rgb(30 58 138);
}

.tp-transcript__timing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.tp-transcript__number {
    min-width: 2ch;
    font-variant-numeric: tabular-nums;
    color: rgb(113 113 122);
}

.tp-transcript__timecode {
    /*
     * Twelve characters of content (`00:00:00.000`) plus the padding and border on
     * top. With the default border-box sizing 11ch had to hold the padding as well,
     * and the milliseconds were clipped off the end of every field (M7 review R4.2) —
     * the very digits the paragraph rule turns on. A hair over 12ch leaves the caret
     * room after the last digit.
     */
    box-sizing: content-box;
    width: 12.5ch;
    padding: 0.125rem 0.375rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    color: inherit;
    background-color: rgb(255 255 255);
    border: 1px solid rgb(212 212 216);
    border-radius: 0.375rem;
}

.dark .tp-transcript__timecode {
    background-color: rgb(39 39 42);
    border-color: rgb(82 82 91);
}

.tp-transcript__timecode:disabled {
    opacity: 0.6;
}

.tp-transcript__arrow {
    color: rgb(161 161 170);
}

.tp-transcript__cue-actions {
    display: inline-flex;
    gap: 0.375rem;
    margin-left: auto;
}

.tp-transcript__action {
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    color: rgb(63 63 70);
    background-color: rgb(244 244 245);
    border: 1px solid rgb(212 212 216);
    border-radius: 0.375rem;
    cursor: pointer;
}

.tp-transcript__action:hover {
    background-color: rgb(228 228 231);
}

.dark .tp-transcript__action {
    color: rgb(212 212 216);
    background-color: rgb(39 39 42);
    border-color: rgb(82 82 91);
}

.tp-transcript__text {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: inherit;
    background-color: rgb(255 255 255);
    border: 1px solid rgb(212 212 216);
    border-radius: 0.375rem;
    resize: vertical;
}

.dark .tp-transcript__text {
    background-color: rgb(39 39 42);
    border-color: rgb(82 82 91);
}

.tp-transcript__text:disabled {
    opacity: 0.6;
}

.tp-transcript__error {
    font-size: 0.75rem;
    color: rgb(185 28 28);
}

.dark .tp-transcript__error {
    color: rgb(248 113 113);
}

.tp-transcript__error--form {
    font-size: 0.875rem;
}

.tp-transcript__empty {
    padding: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
    color: rgb(82 82 91);
    background-color: rgb(244 244 245);
    border: 1px dashed rgb(212 212 216);
    border-radius: 0.75rem;
}

.dark .tp-transcript__empty {
    color: rgb(161 161 170);
    background-color: rgb(39 39 42);
    border-color: rgb(63 63 70);
}

.tp-transcript__footer {
    display: flex;
    justify-content: flex-end;
}
