/* ===========================================
   图集打包模块样式
   =========================================== */

#ap-upload-area {
  margin: 0 12px 8px;
  padding: 18px 0;
  border: 1.5px dashed #3A3A3A;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #141414;
  transition: border-color 0.2s;
  position: relative;
}
#ap-upload-area:hover { border-color: #00D4FF; }
#ap-upload-area span { font-size: 11px; color: #666; margin-top: 4px; }
#ap-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

#ap-image-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

/* 复用 crop.css 中的 img-list-item 样式 */
#ap-image-list .img-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
#ap-image-list .img-list-item:hover { background: #1F1F1F; }
#ap-image-list .img-list-item.selected {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.3);
}
#ap-image-list .img-list-item .thumb {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  object-fit: contain;
  background-image:
    linear-gradient(45deg, #222 25%, transparent 25%),
    linear-gradient(-45deg, #222 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222 75%),
    linear-gradient(-45deg, transparent 75%, #222 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  background-color: #2A2A2A;
  flex-shrink: 0;
}
#ap-image-list .img-list-item .img-info {
  flex: 1;
  min-width: 0;
}
#ap-image-list .img-list-item .img-name {
  font-size: 11px;
  color: #CCC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ap-image-list .img-list-item .img-size {
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}
#ap-image-list .img-list-item .img-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #3A3A3A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
#ap-image-list .img-list-item.selected .img-checkbox {
  background: #00D4FF;
  border-color: #00D4FF;
}
#ap-image-list .img-list-item .img-drag-handle {
  cursor: grab;
  color: #444;
  font-size: 12px;
  flex-shrink: 0;
  user-select: none;
}

/* List footer: totals + estimated atlas size */
#ap-list-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 10px;
  color: #555;
  border-top: 0.5px solid #1A1A1A;
  background: #0D0D0D;
}
#ap-list-footer .footer-value {
  color: #00D4FF;
  font-weight: 600;
}

/* Atlas Preview Area */
#ap-preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  position: relative;
}

#ap-canvas-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  /* 棋盘格背景 */
  background-image:
    linear-gradient(45deg, #1A1A1A 25%, transparent 25%),
    linear-gradient(-45deg, #1A1A1A 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1A1A1A 75%),
    linear-gradient(-45deg, transparent 75%, #1A1A1A 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #252525;
}

#ap-canvas {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  image-rendering: pixelated;
}

#ap-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #444;
}
#ap-empty-state p { font-size: 13px; color: #444; }
#ap-empty-state.hidden { display: none; }

/* Frame tooltip on hover */
#ap-frame-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  color: #EEE;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  display: none;
  border: 1px solid #333;
}

/* Stats bar */
#ap-stats {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  font-size: 11px;
  color: #888;
  border-top: 0.5px solid #2A2A2A;
  background: #141414;
  width: 100%;
  box-sizing: border-box;
}
#ap-stats .stat-item { display: flex; align-items: center; gap: 4px; }
#ap-stats .stat-value { color: #00D4FF; font-weight: 600; }

/* Progress */
#ap-progress-section {
  padding: 12px 16px;
  border-bottom: 0.5px solid #2A2A2A;
}
#ap-progress-bar {
  width: 100%;
  height: 6px;
  background: #1A1A1A;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
#ap-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #00D4FF, #7B2FFF);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}
#ap-progress-text {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: 4px;
}

/* Warning for large atlas */
.atlas-warning {
  font-size: 11px;
  color: #FFA500;
  padding: 6px 8px;
  background: rgba(255, 165, 0, 0.1);
  border-radius: 4px;
  margin-top: 4px;
  line-height: 1.4;
}
