/* cinema theme decorators — film production aesthetic with warm amber accents */

@layer decorators {

/* Aspect-ratio containers with black letterbox bars */
.cinema-frame {
  position: relative;
  background: #000;
  border-radius: var(--d-radius);
  overflow: hidden;
}

.cinema-frame[data-ratio="16:9"] { aspect-ratio: 16 / 9; }
.cinema-frame[data-ratio="4:3"] { aspect-ratio: 4 / 3; }
.cinema-frame[data-ratio="2.35:1"] { aspect-ratio: 2.35 / 1; }

/* Film grain overlay */
.cinema-grain {
  position: relative;
}

.cinema-grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

/* Clapperboard-style numbered badges */
.cinema-slate {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.625rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--d-primary);
  background: #000;
  border: 2px solid var(--d-primary);
  border-radius: 3px;
  text-transform: uppercase;
}

.cinema-slate::before {
  content: '';
  width: 8px;
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--d-primary),
    var(--d-primary) 2px,
    #000 2px,
    #000 4px
  );
  border-radius: 1px;
  flex-shrink: 0;
}

/* Title-card typography */
.cinema-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--d-text);
}

/* Monospace timecode displays */
.cinema-timecode {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--d-primary);
  background: #000;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Dark radial vignette overlay */
.cinema-vignette {
  position: relative;
}

.cinema-vignette::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Focus crosshair overlay */
.cinema-crosshair {
  position: relative;
}

.cinema-crosshair::before,
.cinema-crosshair::after {
  content: '';
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.cinema-crosshair::before {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--d-primary) 25%, transparent);
}

.cinema-crosshair::after {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: color-mix(in srgb, var(--d-primary) 25%, transparent);
}

/* Filmstrip with sprocket holes */
.cinema-filmstrip {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0;
  overflow-x: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--d-border) transparent;
}

.cinema-filmstrip::before,
.cinema-filmstrip::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--d-border) 0px,
    var(--d-border) 4px,
    transparent 4px,
    transparent 12px
  );
  pointer-events: none;
}

.cinema-filmstrip::before { top: 0; }
.cinema-filmstrip::after { bottom: 0; }

/* Anamorphic letterbox */
.cinema-letterbox {
  position: relative;
}

.cinema-letterbox::before,
.cinema-letterbox::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 12%;
  background: #000;
  z-index: 2;
  pointer-events: none;
}

.cinema-letterbox::before { top: 0; }
.cinema-letterbox::after { bottom: 0; }

/* Warm amber glow on active elements */
.cinema-amber-glow {
  box-shadow: 0 0 20px color-mix(in srgb, var(--d-primary) 30%, transparent),
              0 0 40px color-mix(in srgb, var(--d-primary) 10%, transparent);
}

/* Sidebar nav active */
.sidebar-nav-item[data-active="true"] {
  background: color-mix(in srgb, var(--d-primary) 12%, transparent) !important;
  color: var(--d-text) !important;
  box-shadow: inset 2px 0 0 var(--d-primary);
}

/* Progress bar */
.progress-track {
  position: relative;
  height: 6px;
  background: #0A0A0A;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--d-primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--d-primary) 60%, transparent);
  transition: width 200ms ease;
  border-radius: 3px;
}

.progress-fill[data-status="error"] { background: var(--d-error); box-shadow: none; }
.progress-fill[data-status="success"] { background: var(--d-success); }
.progress-fill[data-status="rendering"] {
  background: linear-gradient(90deg, var(--d-primary), var(--d-accent));
  animation: render-pulse 2s ease-in-out infinite;
}

@keyframes render-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Status dot */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot[data-status="completed"] { background: var(--d-success); box-shadow: 0 0 6px color-mix(in srgb, var(--d-success) 60%, transparent); }
.status-dot[data-status="rendering"] { background: var(--d-primary); animation: dot-pulse 1.4s ease-in-out infinite; }
.status-dot[data-status="queued"] { background: var(--d-text-muted); opacity: 0.5; }
.status-dot[data-status="failed"] { background: var(--d-error); box-shadow: 0 0 6px color-mix(in srgb, var(--d-error) 60%, transparent); }
.status-dot[data-status="draft"] { background: var(--d-warning); }
.status-dot[data-status="active"] { background: var(--d-success); }

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Timeline track */
.timeline-track {
  position: relative;
  height: 48px;
  background: #0A0A0A;
  border: 1px solid var(--d-border);
  border-radius: 3px;
  overflow: hidden;
}

.timeline-clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: color-mix(in srgb, var(--d-primary) 25%, #1F1F1F);
  border: 1px solid color-mix(in srgb, var(--d-primary) 50%, transparent);
  border-radius: 3px;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--d-text-muted);
  cursor: pointer;
  transition: border-color 150ms ease;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.timeline-clip:hover {
  border-color: var(--d-primary);
}

.timeline-clip[data-selected="true"] {
  border-color: var(--d-primary);
  box-shadow: 0 0 8px color-mix(in srgb, var(--d-primary) 30%, transparent);
}

/* Scrubber playhead */
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--d-primary);
  box-shadow: 0 0 6px color-mix(in srgb, var(--d-primary) 60%, transparent);
  z-index: 10;
  pointer-events: none;
}

.timeline-playhead::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  background: var(--d-primary);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* Keyframe dot */
.keyframe-dot {
  width: 8px;
  height: 8px;
  background: var(--d-accent);
  border-radius: 1px;
  transform: rotate(45deg);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 100ms ease;
}

.keyframe-dot:hover {
  transform: rotate(45deg) scale(1.3);
  box-shadow: 0 0 8px var(--d-accent);
}

/* Hero glow */
.hero-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 600px 400px at 50% 0%, color-mix(in srgb, var(--d-primary) 12%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

} /* end @layer decorators */
