/* ===== Transition Editor Styles ===== */
/* Popover, indicators, hover preview, and playback overlay */

/* ---- Transition indicator pills between slides ---- */
.transition-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 26px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-violet, #a855f7);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0 -4px;
  z-index: 2;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  user-select: none;
  align-self: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.transition-indicator:hover,
.transition-indicator.active {
  background: rgba(168, 85, 247, 0.28);
  border-color: rgba(168, 85, 247, 0.7);
  color: #ffffff;
  transform: scale(1.08);
}

.transition-indicator.is-override {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.6);
  color: #ffffff;
}

.transition-indicator.is-none {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(168, 85, 247, 0.5);
  color: rgba(168, 85, 247, 0.85);
  font-size: 16px;
}

.transition-indicator.is-none:hover {
  background: rgba(168, 85, 247, 0.18);
  border-style: solid;
  color: #ffffff;
}

@media (max-width: 768px) {
  .transition-indicator {
    width: 28px;
    height: 24px;
    font-size: 13px;
    margin: 0 -3px;
  }
  .transition-indicator.is-none {
    font-size: 15px;
  }
}

/* ---- Global transition settings button ---- */
.transition-global-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 8px;
  color: var(--accent-violet, #a855f7);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  align-self: center;
  margin-right: 4px;
}

.transition-global-btn .transition-global-icon {
  font-size: 16px;
  line-height: 1;
}

.transition-global-btn:hover {
  background: rgba(168, 85, 247, 0.28);
  border-color: rgba(168, 85, 247, 0.7);
  color: #ffffff;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .transition-global-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }
  .transition-global-btn .transition-global-icon {
    font-size: 14px;
  }
}

/* ---- Play button ---- */
.slide-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-cyan, #22d3ee), var(--accent-violet, #a855f7));
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(34, 211, 238, 0.25);
  align-self: center;
  margin-right: 4px;
}

.slide-play-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

/* ---- Transition Popover ---- */
/* JS sets position:fixed + left/top inline so it escapes overflow:hidden ancestors */
.transition-popover {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 16px);
  background: var(--editor-bg-panel, #0a0f1a);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 16px;
  z-index: 10000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: transition-popover-in 0.15s ease-out;
}

@keyframes transition-popover-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.transition-popover-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e7e8ef);
  margin-bottom: 4px;
}

.transition-popover-subtitle {
  font-size: 11px;
  color: var(--text-muted, rgba(231, 232, 239, 0.4));
  margin-bottom: 12px;
}

.transition-type-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.transition-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary, rgba(231, 232, 239, 0.6));
  cursor: pointer;
  font-size: 9px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.transition-type-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.transition-type-btn.selected {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  color: var(--accent-violet, #a855f7);
}

.transition-type-btn .type-icon {
  font-size: 14px;
  line-height: 1;
}

.transition-type-btn .type-label {
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.transition-duration-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.transition-duration-row label {
  font-size: 11px;
  color: var(--text-secondary, rgba(231, 232, 239, 0.6));
  white-space: nowrap;
}

.transition-duration-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.transition-duration-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent-violet, #a855f7);
  border-radius: 50%;
  cursor: pointer;
}

.transition-duration-value {
  font-size: 11px;
  color: var(--text-primary, #e7e8ef);
  min-width: 32px;
  text-align: right;
}

.transition-easing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.transition-easing-row label {
  font-size: 11px;
  color: var(--text-secondary, rgba(231, 232, 239, 0.6));
  white-space: nowrap;
}

.transition-easing-row select {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-primary, #e7e8ef);
  font-size: 11px;
  padding: 4px 8px;
  outline: none;
}

.transition-easing-row select:focus {
  border-color: var(--accent-violet, #a855f7);
}

.transition-override-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 11px;
  color: var(--text-secondary, rgba(231, 232, 239, 0.6));
}

.transition-override-row input[type="checkbox"] {
  accent-color: var(--accent-violet, #a855f7);
}

.transition-popover-actions {
  display: flex;
  gap: 8px;
}

.transition-popover-actions button {
  flex: 1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.12s;
}

.transition-popover-actions button:hover {
  opacity: 0.9;
}

.transition-popover-actions .btn-preview {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #e7e8ef);
}

.transition-popover-actions .btn-apply {
  background: linear-gradient(135deg, var(--accent-cyan, #22d3ee), var(--accent-violet, #a855f7));
  color: white;
}

/* ---- Hover Preview Overlay ---- */
.filmstrip-thumb-previewing {
  position: relative;
  overflow: hidden;
}

.preview-outgoing,
.preview-incoming {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.preview-outgoing {
  z-index: 2;
}

.preview-incoming {
  z-index: 1;
}

/* ---- Playback Overlay ---- */
.playback-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 50000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: playback-fade-in 0.2s ease-out;
}

@keyframes playback-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.playback-canvas-container {
  position: relative;
  width: 360px;
  height: 640px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.playback-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.playback-slide img,
.playback-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playback-transition-out,
.playback-transition-in {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.playback-transition-out img,
.playback-transition-in img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.playback-controls button {
  background: none;
  border: none;
  color: var(--text-primary, #e7e8ef);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.12s;
}

.playback-controls button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.playback-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted, rgba(231, 232, 239, 0.4));
}

.playback-progress-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.playback-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--accent-cyan, #22d3ee), var(--accent-violet, #a855f7));
  border-radius: 2px;
  transition: width 0.3s linear;
}
