/* Custom styles for Map Tool */

/* Canvas 기본 스타일 */
canvas {
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* 타일 팔레트 */
.tile-palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.tile-item {
  width: 64px;
  height: 64px;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s;
}

.tile-item:hover {
  border-color: #3b82f6;
  transform: scale(1.05);
}

.tile-item.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* 캔버스 컨테이너 */
.canvas-container {
  position: relative;
  overflow: hidden;
  border: 2px solid #d1d5db;
  background-color: #f9fafb;
  background-image:
    linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* 그리드 토글 */
.grid-visible {
  background-size: 32px 32px;
}

.grid-hidden {
  background-image: none;
}

/* 툴팁 */
.tooltip {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
}

/* 로딩 스피너 */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 3px solid #3b82f6;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 드래그 중 */
.dragging {
  opacity: 0.5;
  cursor: grabbing !important;
}

/* NPC 마커 */
.npc-marker {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 2px solid #ef4444;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
  transition: transform 0.2s;
}

.npc-marker:hover {
  transform: scale(1.2);
}

/* 퀘스트 트리거 영역 */
.quest-trigger {
  position: absolute;
  border: 2px dashed #3b82f6;
  border-radius: 50%;
  background-color: rgba(59, 130, 246, 0.1);
  pointer-events: none;
}

/* 반응형 */
@media (max-width: 768px) {
  .tile-palette {
    grid-template-columns: repeat(3, 1fr);
  }
}
