/* ==========================================================================
   🎬 HEARTBEAT.FM — DEDICATED SCENES DIRECTOR SCREEN STYLING
   ========================================================================== */

#screen-scenes {
  display: none;
  width: 100vw;
  height: 100vh;
  background: #0b0d14;
  color: #f1f5f9;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
}

#screen-scenes.active {
  display: block;
}

.scenes-screen-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, #151928 0%, #080a10 70%);
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.scenes-topbar {
  height: 64px;
  background: rgba(13, 16, 27, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.scenes-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenes-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #6366f1;
  color: #fff;
  transform: translateX(-2px);
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
}

.scenes-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scenes-brand-icon {
  font-size: 22px;
}

.scenes-brand-info {
  display: flex;
  flex-direction: column;
}

.scenes-brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  text-transform: uppercase;
}

.scenes-brand-sub {
  font-size: 11px;
  color: #94a3b8;
}

.topbar-center {
  display: flex;
  align-items: center;
}

.active-program-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
}

.program-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.program-dot.pulse {
  box-shadow: 0 0 10px #ef4444;
  animation: pulseSceneLive 1.5s infinite;
}

@keyframes pulseSceneLive {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.program-label {
  color: #fca5a5;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.program-name {
  color: #fff;
  font-weight: 800;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scenes-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenes-btn-secondary {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.scenes-btn-secondary:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: #818cf8;
  color: #fff;
}

.scenes-btn-primary {
  background: #6366f1;
  border: 1px solid #818cf8;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.scenes-btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.55);
}

/* ─── Substrip ───────────────────────────────────────────────────────────── */
.scenes-substrip {
  height: 42px;
  background: rgba(18, 22, 36, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  font-size: 12px;
  flex-shrink: 0;
}

.substrip-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.strip-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #cbd5e1;
}

.strip-meta {
  color: #94a3b8;
}

.strip-meta strong {
  color: #fff;
}

.scenes-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.scenes-link-btn:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* ─── Main Scenes Grid Viewport ─────────────────────────────────────────── */
.scenes-main-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.scenes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.scene-card {
  background: rgba(18, 22, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.scene-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.scene-card.live-program {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px #ef4444, 0 12px 35px rgba(239, 68, 68, 0.25);
  background: rgba(24, 20, 32, 0.85);
}

.scene-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scene-order-chip {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #818cf8;
}

.scene-category-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.scene-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scene-icon-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.scene-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.scene-icon-btn.active {
  color: #f59e0b;
  border-color: #f59e0b;
}

.scene-preview-stage {
  aspect-ratio: 16 / 9;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
}

.scene-preview-img-wrap {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.scene-preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.65) 100%);
}

.scene-big-icon {
  font-size: 38px;
  z-index: 2;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
}

.scene-live-banner {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.scene-cut-btn {
  position: absolute;
  bottom: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.2s ease;
}

.scene-card:hover .scene-cut-btn {
  opacity: 1;
  transform: translateY(0);
}

.scene-cut-btn:hover {
  background: #6366f1;
  border-color: #818cf8;
}

.scene-card-footer {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: space-between;
}

.scene-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
}

.scene-desc {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.scene-footer-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-manage-sources {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-manage-sources:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
}

/* ─── DEDICATED MODALS STYLING ───────────────────────────────────────────── */
.scenes-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.scenes-modal-window {
  width: 95%;
  max-width: 540px;
  background: #111524;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.15);
  color: #fff;
  overflow: hidden;
  animation: modalPopIn 0.2s ease-out;
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.scenes-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  font-size: 24px;
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-sub {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: #fff;
}

.scenes-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.5px;
}

.modal-input, .modal-select, .modal-textarea {
  background: #181d30;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus, .modal-select:focus, .modal-textarea:focus {
  border-color: #6366f1;
}

.icon-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-chip {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #181d30;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
}

.icon-chip.active {
  background: #6366f1;
  border-color: #818cf8;
}

.ratio-select-row {
  display: flex;
  gap: 12px;
}

.ratio-pill {
  flex: 1;
  background: #181d30;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ratio-pill.active {
  border-color: #6366f1;
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
}

.transition-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.trans-card {
  background: #181d30;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trans-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
}

.trans-card.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
}

.trans-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.trans-desc {
  font-size: 11px;
  color: #94a3b8;
}

.modal-slider {
  width: 100%;
  accent-color: #6366f1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
}

.scenes-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.modal-btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.modal-btn.primary {
  background: #6366f1;
  color: #fff;
}

.modal-btn.primary:hover {
  background: #4f46e5;
}

.modal-btn.danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.modal-btn.danger:hover {
  background: #ef4444;
  color: #fff;
}
