/* Admin & Editor Global Styles */
body {
  background-color: #fce4ec; /* pink lighten-5 */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: #333;
}

.admin-header {
  background-color: #e91e63; /* pink */
  color: #fff;
  padding: 15px 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1, .admin-header h2, .admin-header h5 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-container {
  max-width: 1300px;
  margin: 25px auto;
  padding: 25px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* Step Wizard Navigation */
.step-nav {
  display: flex;
  border-bottom: 2px solid #f8bbd0;
  margin-bottom: 25px;
  gap: 10px;
}

.step-tab {
  flex: 1;
  text-align: center;
  padding: 14px 10px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.step-tab.active {
  color: #e91e63;
  border-bottom: 3px solid #e91e63;
  background-color: #fff5f8;
}

.step-tab.completed {
  color: #4caf50;
}

.step-tab .badge-step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eee;
  color: #666;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.step-tab.active .badge-step {
  background: #e91e63;
  color: #fff;
}

.step-tab.completed .badge-step {
  background: #4caf50;
  color: #fff;
}

.step-content {
  display: none;
}

.step-content.active {
  display: block;
}

/* Dropzone Styles */
.dropzone-box {
  border: 2px dashed #f48fb1;
  background-color: #fffafc;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 15px;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: #e91e63;
  background-color: #fce4ec;
}

.dropzone-box i {
  font-size: 48px;
  color: #e91e63;
  margin-bottom: 10px;
}

/* Audio Track Card */
.audio-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audio-card.default-track {
  border-left: 4px solid #e91e63;
  background: #fff9fa;
}

/* PDF Slicer Workspace */
.slicer-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #333;
  border-radius: 12px;
  padding: 20px;
  position: relative;
  max-height: 75vh;
  overflow-y: auto;
}

.canvas-page-wrapper {
  position: relative;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  background: #fff;
  user-select: none;
}

.canvas-page-wrapper canvas {
  display: block;
  max-width: 100%;
}

.cutline-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.cutline {
  position: absolute;
  left: 0;
  width: 100%;
  height: 8px;
  margin-top: -4px;
  background-color: rgba(233, 30, 99, 0.9);
  border-top: 2px dashed #fff;
  cursor: row-resize;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  transition: background 0.15s;
}

.cutline:hover, .cutline.dragging {
  background-color: #d81b60;
  height: 10px;
  margin-top: -5px;
}

.cutline-del-btn {
  background: #fff;
  color: #e91e63;
  border: 2px solid #e91e63;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-right: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.35);
  pointer-events: auto;
  z-index: 25;
}

.cutline-del-btn:hover {
  background: #e91e63;
  color: #fff;
  transform: scale(1.15);
}

/* Slicer Segments (자르지 않을 부분/무시할 영역) */
.slicer-segment {
  position: absolute;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 15px;
  pointer-events: none; /* 내부는 클릭 투과 */
}

.slicer-segment.ignored {
  background: repeating-linear-gradient(
    45deg,
    rgba(233, 30, 99, 0.18),
    rgba(233, 30, 99, 0.18) 12px,
    rgba(0, 0, 0, 0.12) 12px,
    rgba(0, 0, 0, 0.12) 24px
  );
  border-top: 1px dashed rgba(233, 30, 99, 0.6);
  border-bottom: 1px dashed rgba(233, 30, 99, 0.6);
}

.segment-toggle-btn {
  pointer-events: auto; /* 버튼만 클릭 가능 */
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.slicer-segment:not(.ignored) .segment-toggle-btn {
  background: rgba(255, 255, 255, 0.9);
  color: #2e7d32;
  border: 1px solid #81c784;
}

.slicer-segment:not(.ignored) .segment-toggle-btn:hover {
  background: #e8f5e9;
  border-color: #4caf50;
}

.slicer-segment.ignored .segment-toggle-btn {
  background: #e91e63;
  color: #fff;
  border: 1px solid #c2185b;
}

.slicer-segment.ignored .segment-toggle-btn:hover {
  background: #c2185b;
}

/* Slicer Sticky Controls */
.slicer-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(5px);
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

/* Sequencer & Card Grid */
.sequencer-sticky-header {
  position: sticky;
  top: 10px;
  z-index: 40;
  background: #fff;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.sequencer-audio-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-grow: 1;
}

/* 일괄 작업 툴바 (스티키) */
.seq-batch-toolbar {
  position: sticky;
  top: 92px;
  z-index: 39;
  background: linear-gradient(135deg, #fff0f5 0%, #ffe4ec 100%);
  border: 1.5px solid #f48fb1;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.15);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  animation: slideDownFade 0.25s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.batch-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.batch-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.batch-count-badge {
  background: #e91e63;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}

.seq-checkbox-label {
  display: inline-flex;
  align-items: center;
  user-select: none;
  cursor: pointer;
  margin: 0;
}

.seq-card.is-selected {
  border: 2px solid #e91e63 !important;
  background-color: #fff5f8 !important;
  box-shadow: 0 4px 16px rgba(233, 30, 99, 0.18) !important;
}

.seq-card.sortable-selected {
  border: 2px dashed #e91e63 !important;
  background-color: #fce4ec !important;
  opacity: 0.85;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 200px;
}

/* 대폭 확대된 악보 카드 스타일 (3단 블록 레이아웃) */
.seq-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 14px 18px;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all 0.2s;
  position: relative;
}

.seq-card:hover {
  border-color: #f48fb1;
  box-shadow: 0 4px 15px rgba(233, 30, 99, 0.12);
}

.seq-card.active-play {
  border: 2px solid #e91e63;
  background: #fff9fa;
  box-shadow: 0 0 15px rgba(233, 30, 99, 0.2);
}

.seq-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #f2f2f2;
}

.seq-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seq-drag-handle {
  cursor: grab;
  color: #aaa;
  display: flex;
  align-items: center;
}

.seq-drag-handle:active {
  cursor: grabbing;
}

.seq-idx {
  font-weight: 700;
  font-size: 1.15rem;
  color: #e91e63;
}

/* 큼직한 악보 썸네일 */
.seq-thumb-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px;
  overflow: hidden;
}

.seq-thumb-large {
  width: 100%;
  max-width: 1100px;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.2s;
}

/* 카드 하단 컨트롤 바 */
.seq-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  padding-top: 6px;
}

.seq-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-group label {
  font-size: 0.9rem;
  color: #555;
  font-weight: 600;
  margin-right: 4px;
}

.control-group input[type="number"] {
  width: 70px !important;
  height: 34px !important;
  text-align: center;
  margin: 0 !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  padding: 0 5px !important;
  font-size: 1rem !important;
  font-weight: 600;
}

.btn-mini {
  padding: 0 10px;
  height: 32px;
  line-height: 32px;
  font-size: 0.8rem;
  border-radius: 4px;
  font-weight: 600;
}

.seq-time-info {
  font-size: 0.85rem;
  color: #777;
  min-width: 90px;
}

/* Floating Action / Bottom Save Bar */
.bottom-bar {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,0.98);
  padding: 15px 25px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  margin-top: 25px;
  border-radius: 0 0 16px 16px;
}

/* Whiteout Masking Modal Styles */
#modal-card-masker {
  max-width: 95vw;
  width: 1100px;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
}

.masker-canvas-container {
  position: relative;
  overflow: auto;
  max-height: 60vh;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  user-select: none;
}

.masker-canvas-container canvas {
  display: block;
  margin: 0 auto;
  cursor: crosshair;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.masker-guide-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fffde7;
  border: 1px solid #fff59d;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #5d4037;
}

/* Multi-Crop (조합 캡처) Styles */
.multi-crop-active {
  box-shadow: 0 0 0 3px #ff4081 !important;
}

.multi-crop-selection-rect {
  position: absolute;
  border: 2px dashed #e91e63;
  background: rgba(233, 30, 99, 0.15);
  pointer-events: auto;
  z-index: 25;
  box-sizing: border-box;
}

.multi-crop-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #e91e63;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  pointer-events: none;
}

.multi-crop-del-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #fff;
  color: #e91e63;
  border: 1px solid #e91e63;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  line-height: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.multi-crop-toolbar {
  display: none;
  background: #fce4ec;
  border: 1px solid #f8bbd0;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 15px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.multi-crop-toolbar.active {
  display: flex;
}

