/* 이미지 선택 모달 */
.image-picker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.image-picker.active {
  opacity: 1;
  pointer-events: auto;
}

.image-picker-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.image-picker-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.image-picker-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-picker-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  color: var(--text-secondary);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close:hover {
  background: var(--gray-200);
  color: var(--text-primary);
}

.image-picker-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  overflow-y: auto;
  max-height: calc(80vh - 120px);
}

.image-option {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.image-option:hover {
  transform: scale(1.05);
}

.image-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 188, 156, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-option:hover .image-overlay {
  opacity: 1;
}

.image-overlay span {
  color: white;
  font-size: 16px;
  font-weight: 700;
}

.image-picker-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
  text-align: center;
}

.image-picker-footer small {
  color: var(--text-tertiary);
  font-size: 12px;
}

/* 선택된 이미지 미리보기 */
.selected-image-preview {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 16/9;
  border-radius: 12px;
  object-fit: cover;
  margin: 12px auto 0 auto;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 모바일 */
@media (max-width: 768px) {
  .image-picker-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .image-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
}
