/* Cinematic Transitions: tool-specific styles (shared look comes from /assets/css/styles.css). */

/* Preview toolbar */
.tr-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tr-mode { flex: none; }
.tr-now { flex: 1; min-width: 0; font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-toolbar .icon-btn[hidden] { display: none; }
#preview.is-picking { cursor: crosshair; }
.tr-marker {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; pointer-events: none;
  border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55), inset 0 0 0 1.5px rgba(0, 0, 0, .35);
}
.tr-marker::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.tr-marker[hidden] { display: none; }

/* Timeline */
.tr-timeline { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.tr-clip {
  flex: none; width: 132px; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 10px;
  border: 1.5px solid transparent; background: var(--bg-elev); cursor: pointer; user-select: none; position: relative;
  transition: border-color .15s;
}
.tr-clip:hover { border-color: var(--border-strong); }
.tr-clip.is-selected { border-color: var(--accent); }
.tr-clip.is-dragging { z-index: 2; opacity: .85; box-shadow: var(--shadow-lg); cursor: grabbing; transition: none; }
.tr-clip.drop-before::before, .tr-clip.drop-after::after {
  content: ""; position: absolute; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--accent);
}
.tr-clip.drop-before::before { left: -8px; }
.tr-clip.drop-after::after { right: -8px; }
.tr-clip-thumb { position: relative; line-height: 0; border-radius: 6px; overflow: hidden; }
.tr-clip-thumb canvas { width: 100%; height: auto; display: block; }
.tr-grip {
  position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px;
  background: rgba(0, 0, 0, .45); color: #fff; touch-action: none; cursor: grab;
}
.tr-grip svg { width: 14px; height: 14px; }
.tr-clip-remove {
  position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 5px; background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.tr-clip:hover .tr-clip-remove, .tr-clip:focus-within .tr-clip-remove, .tr-clip.is-selected .tr-clip-remove { opacity: 1; }
.tr-clip-remove svg { width: 13px; height: 13px; }
.tr-clip-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; padding: 0 2px; }
.tr-clip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-clip-len { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }

.tr-slot {
  flex: none; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 92px; min-width: 52px;
  padding: 6px 8px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface);
  font: inherit; font-size: 11px; font-weight: 600; color: var(--text); cursor: pointer; line-height: 1.15; text-align: center;
}
.tr-slot:hover { border-color: var(--accent); }
.tr-slot.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tr-slot.is-empty { border-style: dashed; color: var(--text-muted); font-weight: 500; }
.tr-slot.is-edge { border-radius: 10px; }
.tr-slot-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-slot-dur { font: 10px var(--font-mono); color: var(--text-faint); }
.tr-slot.is-selected .tr-slot-dur { color: inherit; opacity: .8; }
.tr-add {
  flex: none; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 12px;
  border-radius: 10px; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--text-muted);
  font: inherit; font-size: 12px; cursor: pointer;
}
.tr-add:hover { border-color: var(--accent); color: var(--accent); }
.tr-add svg { width: 18px; height: 18px; }

/* Editor */
.tr-editor:empty { display: none; }
.tr-editor .ctrl-section:last-child { border-bottom: 1px solid var(--border); }
.tr-pick { width: 100%; justify-content: space-between; }
.tr-pick-more { font-weight: 500; color: var(--accent); }
.tr-clip-info { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.tr-clip-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-clip-info span { color: var(--text-faint); font-size: 12px; }
.tr-move { display: flex; flex-wrap: wrap; gap: 6px; }

/* Gallery */
.modal.tr-gallery { width: min(1000px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 0; }
.tr-gallery-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 22px; border-bottom: 1px solid var(--border); }
.tr-gallery-head h2 { margin: 0; }
.tr-gallery-body { overflow-y: auto; padding: 6px 22px 22px; }
.tr-gallery-body h3 { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 10px; }
.tr-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tr-gallery-card {
  display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--bg-elev); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
}
.tr-gallery-card:hover { border-color: var(--border-strong); }
.tr-gallery-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tr-gallery-card canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 7px; display: block; }
.tr-gallery-card span { padding: 0 2px 2px; }
